summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/connect.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-12-05 16:50:43 (GMT)
committerBrad King <brad.king@kitware.com>2016-12-05 16:50:43 (GMT)
commitf8a1ba202f51e70510f12f46fe0633ea908d5144 (patch)
treefe7f931cdb5c0049cd97660e3888a816dfd4a86f /Utilities/cmcurl/lib/connect.c
parent25d7b1ca9d3a160850ad1f147ff96ac7c55f7d9f (diff)
parent93cc249f3dd7ecd621cd063e4c08bbdb54d971e8 (diff)
downloadCMake-f8a1ba202f51e70510f12f46fe0633ea908d5144.zip
CMake-f8a1ba202f51e70510f12f46fe0633ea908d5144.tar.gz
CMake-f8a1ba202f51e70510f12f46fe0633ea908d5144.tar.bz2
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2016-11-02 (3c561c65)
Diffstat (limited to 'Utilities/cmcurl/lib/connect.c')
-rw-r--r--Utilities/cmcurl/lib/connect.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/Utilities/cmcurl/lib/connect.c b/Utilities/cmcurl/lib/connect.c
index 0047f9a..3df34d9 100644
--- a/Utilities/cmcurl/lib/connect.c
+++ b/Utilities/cmcurl/lib/connect.c
@@ -762,7 +762,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
#endif
/* check socket for connect */
- rc = Curl_socket_ready(CURL_SOCKET_BAD, conn->tempsock[i], 0);
+ rc = SOCKET_WRITABLE(conn->tempsock[i], 0);
if(rc == 0) { /* no connection yet */
error = 0;
@@ -1368,25 +1368,26 @@ CURLcode Curl_socket(struct connectdata *conn,
}
-#ifdef CURLDEBUG
/*
- * Curl_conncontrol() is used to set the conn->bits.close bit on or off. It
- * MUST be called with the connclose() or connkeep() macros with a stated
- * reason. The reason is only shown in debug builds but helps to figure out
- * decision paths when connections are or aren't re-used as expected.
+ * Curl_conncontrol() marks streams or connection for closure.
*/
-void Curl_conncontrol(struct connectdata *conn, bool closeit,
- const char *reason)
-{
-#if defined(CURL_DISABLE_VERBOSE_STRINGS)
- (void) reason;
+void Curl_conncontrol(struct connectdata *conn,
+ int ctrl /* see defines in header */
+#ifdef DEBUGBUILD
+ , const char *reason
#endif
- if(closeit != conn->bits.close) {
- infof(conn->data, "Marked for [%s]: %s\n", closeit?"closure":"keep alive",
- reason);
-
+ )
+{
+ /* close if a connection, or a stream that isn't multiplexed */
+ bool closeit = (ctrl == CONNCTRL_CONNECTION) ||
+ ((ctrl == CONNCTRL_STREAM) && !(conn->handler->flags & PROTOPT_STREAM));
+ if((ctrl == CONNCTRL_STREAM) &&
+ (conn->handler->flags & PROTOPT_STREAM))
+ DEBUGF(infof(conn->data, "Kill stream: %s\n", reason));
+ else if(closeit != conn->bits.close) {
+ DEBUGF(infof(conn->data, "Marked for [%s]: %s\n",
+ closeit?"closure":"keep alive", reason));
conn->bits.close = closeit; /* the only place in the source code that
should assign this bit */
}
}
-#endif