Moved the 'tcp_nodelay' member to the proper 'UserDefined' struct within the
authorDaniel Stenberg <daniel@haxx.se>
Tue, 13 Apr 2004 07:16:26 +0000 (07:16 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 13 Apr 2004 07:16:26 +0000 (07:16 +0000)
sessionhandle to make the duphandle() function work as supposed. Also tried
to start document functions the doxygen way (in the headers of the functions).
Can't make it work though...

lib/connect.c
lib/url.c
lib/urldata.h

index b58a8be..8bb4e2c 100644 (file)
@@ -489,7 +489,7 @@ static void Curl_setNoDelay(struct connectdata *conn,
 {
 #ifdef TCP_NODELAY
   struct SessionHandle *data= conn->data;
-  socklen_t onoff = (socklen_t) data->tcp_nodelay;
+  socklen_t onoff = (socklen_t) data->set.tcp_nodelay;
   if(setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (void *)&onoff,
                 sizeof(onoff)) < 0)
     infof(data, "Could not set TCP_NODELAY: %s\n",
@@ -580,7 +580,7 @@ CURLcode Curl_connecthost(struct connectdata *conn,  /* context */
     if (sockfd == CURL_SOCKET_BAD)
       continue;
 
-    else if(data->tcp_nodelay)
+    else if(data->set.tcp_nodelay)
       Curl_setNoDelay(conn, sockfd);
 #else
   /*
@@ -601,7 +601,7 @@ CURLcode Curl_connecthost(struct connectdata *conn,  /* context */
       return CURLE_COULDNT_CONNECT; /* big time error */
     }
 
-    else if(data->tcp_nodelay)
+    else if(data->set.tcp_nodelay)
       Curl_setNoDelay(conn, sockfd);
 
     /* nasty address work before connect can be made */
index 40794a9..635a019 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -246,6 +246,14 @@ CURLcode Curl_close(struct SessionHandle *data)
   return CURLE_OK;
 }
 
+/**
+ * Curl_open()
+ *
+ * @param curl is a pointer to a sessionhandle pointer that gets set by this
+ * function.
+ * @return CURLcode
+ */
+
 CURLcode Curl_open(struct SessionHandle **curl)
 {
   /* We don't yet support specifying the URL at this point */
@@ -1308,7 +1316,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
      * Enable or disable TCP_NODELAY, which will disable/enable the Nagle
      * algorithm
      */
-    data->tcp_nodelay = va_arg(param, long);
+    data->set.tcp_nodelay = va_arg(param, long);
     break;
 
   default:
@@ -1968,13 +1976,20 @@ CURLcode Curl_protocol_connect(struct connectdata *conn,
   return result; /* pass back status */
 }
 
-/*
+/**
  * CreateConnection() sets up a new connectdata struct, or re-uses an already
  * existing one, and resolves host name.
  *
  * if this function returns CURLE_OK and *async is set to TRUE, the resolve
  * response will be coming asynchronously. If *async is FALSE, the name is
  * already resolved.
+ *
+ * @param data The sessionhandle pointer
+ * @param in_connect is set to the next connection data pointer
+ * @param addr is set to the new dns entry for this connection
+ * @param async is set TRUE/FALSE depending on the nature of this lookup
+ * @return CURLcode
+ * @see SetupConnection()
  */
 
 static CURLcode CreateConnection(struct SessionHandle *data,
index 4f53d84..fb11504 100644 (file)
@@ -889,8 +889,9 @@ struct UserDefined {
   bool ftp_use_eprt;     /* if EPRT is to be attempted or not */
   curl_ftpssl ftp_ssl;   /* if AUTH TLS is to be attempted etc */
   bool no_signal;        /* do not use any signal/alarm handler */
+  bool global_dns_cache; /* subject for future removal */
+  bool tcp_nodelay;      /* whether to enable TCP_NODELAY or not */
 
-  bool global_dns_cache;
 };
 
 /*
@@ -918,9 +919,6 @@ struct SessionHandle {
 #if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H)
   ENGINE*  engine;
 #endif /* USE_SSLEAY */
-
-  /* This tells CreateConnection() whether to enable TCP_NODELAY or not */
-  int tcp_nodelay;
 };
 
 #define LIBCURL_NAME "libcurl"