Commit 303c9007 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

tcpnodelay: rename variable

Renamed the variable from 'proto' to 'level' simply because it is not
protocol you set but level and that is the name of the argument used in
man pages and the POSIX documentation of the setsockopt function.
parent 443ab77e
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -747,7 +747,7 @@ static void tcpnodelay(struct connectdata *conn,
#ifdef TCP_NODELAY
#ifdef TCP_NODELAY
  struct SessionHandle *data= conn->data;
  struct SessionHandle *data= conn->data;
  curl_socklen_t onoff = (curl_socklen_t) data->set.tcp_nodelay;
  curl_socklen_t onoff = (curl_socklen_t) data->set.tcp_nodelay;
  int proto = IPPROTO_TCP;
  int level = IPPROTO_TCP;


#if 0
#if 0
  /* The use of getprotobyname() is disabled since it isn't thread-safe on
  /* The use of getprotobyname() is disabled since it isn't thread-safe on
@@ -759,10 +759,10 @@ static void tcpnodelay(struct connectdata *conn,
     detected. */
     detected. */
  struct protoent *pe = getprotobyname("tcp");
  struct protoent *pe = getprotobyname("tcp");
  if(pe)
  if(pe)
    proto = pe->p_proto;
    level = pe->p_proto;
#endif
#endif


  if(setsockopt(sockfd, proto, TCP_NODELAY, (void *)&onoff,
  if(setsockopt(sockfd, level, TCP_NODELAY, (void *)&onoff,
                sizeof(onoff)) < 0)
                sizeof(onoff)) < 0)
    infof(data, "Could not set TCP_NODELAY: %s\n",
    infof(data, "Could not set TCP_NODELAY: %s\n",
          Curl_strerror(conn, SOCKERRNO));
          Curl_strerror(conn, SOCKERRNO));