aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-02-09 23:09:12 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-02-09 23:09:12 +0000
commit8c83422fe2edb0b634fbf2ea065c7f638f9fff3b (patch)
treeeb4f280b97ccced6c806571f18695d0ccb081272 /lib
parent61a1e3cd01c3b00d7a85edc775f49d9c785e1af4 (diff)
David Byron identified the lack of SSL_pending() use, and this is my take
at fixing this issue.
Diffstat (limited to 'lib')
-rw-r--r--lib/transfer.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 9b37988de..5758dad47 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -242,6 +242,19 @@ CURLcode Curl_readrewind(struct connectdata *conn)
return CURLE_OK;
}
+#ifdef USE_SSLEAY
+static int data_pending(struct connectdata *conn)
+{
+ if(conn->ssl[FIRSTSOCKET].handle)
+ /* SSL is in use */
+ return SSL_pending(conn->ssl[FIRSTSOCKET].handle);
+
+ return 0; /* nothing */
+}
+#else
+/* non-SSL never have pending data */
+#define data_pending(x) 0
+#endif
/*
* Curl_readwrite() is the low-level function to be called when data is to
@@ -1147,7 +1160,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
k->keepon &= ~KEEP_READ;
}
- } while(0);
+ } while(data_pending(conn));
} /* if( read from socket ) */