Skip to content

Compiling with DISABLE_NAGLE does not propogate tcp_proto_no and never sets TCP_NODELAY#3859

Open
davidtrihy-genesys wants to merge 1 commit intoOpenSIPS:3.6from
purecloudlabs:bug/tcp_nodelay
Open

Compiling with DISABLE_NAGLE does not propogate tcp_proto_no and never sets TCP_NODELAY#3859
davidtrihy-genesys wants to merge 1 commit intoOpenSIPS:3.6from
purecloudlabs:bug/tcp_nodelay

Conversation

@davidtrihy-genesys
Copy link
Copy Markdown
Contributor

Summary
Compiling with DISABLE_NAGLE does not set tcp_proto_no on TCP worker processes which causes the setsockopt for TCP_NODELAY to not be set when creating sockets

Details
Bug fix with 3.6 where this compile time define does not work anymore

Solution
getprotobyname("tcp"); is called in tcp_bind_listener which is only ever called in the TCP main process so the tcp_proto_no is always -1 in worker processes, the solution here was to just remove that call and use IPPROTO_TCP directly in the setsockopt the enums for the different protos in netinet/in.h are used in multiple different areas in the source code so changing TCP_NODELAY to use the enum directly matches the pattern of other socket options

Compatibility
It will make 3.6 behave consistently when the compile time flag is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant