mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Moved the 'tcp_nodelay' member to the proper 'UserDefined' struct within the
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...
This commit is contained in:
parent
3647a6ddcd
commit
4e3aa250c4
@ -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 */
|
||||
|
19
lib/url.c
19
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,
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user