aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/connect.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/connect.c b/lib/connect.c
index dcccfe4d2..33e4e0777 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -685,7 +685,14 @@ static void tcpnodelay(struct connectdata *conn,
socklen_t onoff = (socklen_t) data->set.tcp_nodelay;
int proto = IPPROTO_TCP;
-#ifdef HAVE_GETPROTOBYNAME
+#if 0
+ /* The use of getprotobyname() is disabled since it isn't thread-safe on
+ numerous systems. On these getprotobyname_r() should be used instead, but
+ that exists in at least one 4 arg version and one 5 arg version, and
+ since the proto number rarely changes anyway we now just use the hard
+ coded number. The "proper" fix would need a configure check for the
+ correct function much in the same style the gethostbyname_r versions are
+ detected. */
struct protoent *pe = getprotobyname("tcp");
if(pe)
proto = pe->p_proto;