summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-05-19 20:57:28 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-05-19 20:57:28 +0000
commit3cb0dd6685235fca006f9bb4923740dcb9c52f3f (patch)
treea6137cdede9c72d99780be291b11c4fda18fd7c7
parentc2a84aa6f02ee81c5c3e12b6d35cd0307fb24d7b (diff)
downloadgnurl-3cb0dd6685235fca006f9bb4923740dcb9c52f3f.tar.gz
gnurl-3cb0dd6685235fca006f9bb4923740dcb9c52f3f.tar.bz2
gnurl-3cb0dd6685235fca006f9bb4923740dcb9c52f3f.zip
when the multi handle was in DO and DOING states, the HTTP and HTTPS protocol
handler functions didn't return that the socket should be waited for writing, but instead it was treated as if no socket was needing monitoring so REMOVE was called prematurely
-rw-r--r--lib/http.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c
index 266c1cacb..acb0f94d7 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -111,6 +111,9 @@
* Forward declarations.
*/
+static int http_getsock_do(struct connectdata *conn,
+ curl_socket_t *socks,
+ int numsocks);
static CURLcode https_connecting(struct connectdata *conn, bool *done);
#ifdef USE_SSL
static int https_getsock(struct connectdata *conn,
@@ -131,7 +134,7 @@ const struct Curl_handler Curl_handler_http = {
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_getsock */
- ZERO_NULL, /* doing_getsock */
+ http_getsock_do, /* doing_getsock */
ZERO_NULL, /* disconnect */
PORT_HTTP, /* defport */
PROT_HTTP, /* protocol */
@@ -151,7 +154,7 @@ const struct Curl_handler Curl_handler_https = {
https_connecting, /* connecting */
ZERO_NULL, /* doing */
https_getsock, /* proto_getsock */
- ZERO_NULL, /* doing_getsock */
+ http_getsock_do, /* doing_getsock */
ZERO_NULL, /* disconnect */
PORT_HTTPS, /* defport */
PROT_HTTP | PROT_HTTPS | PROT_SSL /* protocol */
@@ -1726,6 +1729,19 @@ CURLcode Curl_http_connect(struct connectdata *conn, bool *done)
return CURLE_OK;
}
+/* this returns the socket to wait for in the DO and DOING state for the multi
+ interface and then we're always _sending_ a request and thus we wait for
+ the single socket to become writable only */
+static int http_getsock_do(struct connectdata *conn,
+ curl_socket_t *socks,
+ int numsocks)
+{
+ /* write mode */
+ (void)numsocks; /* unused, we trust it to be at least 1 */
+ socks[0] = conn->sock[FIRSTSOCKET];
+ return GETSOCK_WRITESOCK(0);
+}
+
static CURLcode https_connecting(struct connectdata *conn, bool *done)
{
CURLcode result;