summaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-08-05 10:32:08 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-08-12 13:17:57 +0200
commite79535bc5e8e25df8415b6b23671cbd8bd3c83a5 (patch)
treedf811d60b9433abd50856a9f62ee7bb8a3d9cfeb /lib/transfer.c
parent4ad8e142da463ab208d5b5565e53291c8e5ef038 (diff)
downloadcurl-e79535bc5e8e25df8415b6b23671cbd8bd3c83a5.tar.gz
SessionHandle: the protocol specific pointer is now a void *
All protocol handler structs are now opaque (void *) in the SessionHandle struct and moved in the request-specific sub-struct 'SingleRequest'. The intension is to keep the protocol specific knowledge in their own dedicated source files [protocol].c etc. There's some "leakage" where this policy is violated, to be addressed at a later point in time.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index db0318d5a..e899d19c4 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -810,9 +810,10 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
/* HTTP pollution, this should be written nicer to become more
protocol agnostic. */
int fillcount;
+ struct HTTP *http = data->req.protop;
if((k->exp100 == EXP100_SENDING_REQUEST) &&
- (data->state.proto.http->sending == HTTPSEND_BODY)) {
+ (http->sending == HTTPSEND_BODY)) {
/* If this call is to send body data, we must take some action:
We have sent off the full HTTP 1.1 request, and we shall now
go into the Expect: 100 state and await such a header */
@@ -827,7 +828,7 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
}
if(conn->handler->protocol&(CURLPROTO_HTTP|CURLPROTO_RTSP)) {
- if(data->state.proto.http->sending == HTTPSEND_REQUEST)
+ if(http->sending == HTTPSEND_REQUEST)
/* We're sending the HTTP request headers, not the data.
Remember that so we don't change the line endings. */
sending_http_headers = TRUE;
@@ -1852,7 +1853,7 @@ CURLcode Curl_retry_request(struct connectdata *conn,
data->req.headerbytecount == 0) &&
conn->bits.reuse &&
!data->set.opt_no_body &&
- data->set.rtspreq != RTSPREQ_RECEIVE)) {
+ data->set.rtspreq != RTSPREQ_RECEIVE)) {
/* We got no data, we attempted to re-use a connection and yet we want a
"body". This might happen if the connection was left alive when we were
done using it before, but that was closed when we wanted to read from
@@ -1870,9 +1871,11 @@ CURLcode Curl_retry_request(struct connectdata *conn,
transferred! */
- if((conn->handler->protocol&CURLPROTO_HTTP) &&
- data->state.proto.http->writebytecount)
- return Curl_readrewind(conn);
+ if(conn->handler->protocol&CURLPROTO_HTTP) {
+ struct HTTP *http = data->req.protop;
+ if(http->writebytecount)
+ return Curl_readrewind(conn);
+ }
}
return CURLE_OK;
}
@@ -1930,6 +1933,7 @@ Curl_setup_transfer(
k->keepon |= KEEP_RECV;
if(conn->writesockfd != CURL_SOCKET_BAD) {
+ struct HTTP *http = data->req.protop;
/* HTTP 1.1 magic:
Even if we require a 100-return code before uploading data, we might
@@ -1940,7 +1944,8 @@ Curl_setup_transfer(
state info where we wait for the 100-return code
*/
if((data->state.expect100header) &&
- (data->state.proto.http->sending == HTTPSEND_BODY)) {
+ (conn->handler->protocol&CURLPROTO_HTTP) &&
+ (http->sending == HTTPSEND_BODY)) {
/* wait with write until we either got 100-continue or a timeout */
k->exp100 = EXP100_AWAITING_CONTINUE;
k->start100 = Curl_tvnow();