aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-01-02 22:30:34 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-01-02 22:30:34 +0000
commitd9023c16abd0f6b89eb94bbad44d9723947f3c34 (patch)
tree8a82fda4f027bcdcad971efcfa4b3973011763a5
parent193d33fd4a4267c327e95cddc7d92103f187e2a3 (diff)
- I fixed two cases of missing return code checks when handling chunked
decoding where a write error (or abort return from a callback) didn't stop libcurl's processing.
-rw-r--r--CHANGES4
-rw-r--r--lib/http_chunks.c18
2 files changed, 16 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index 23dbddb9d..09c076e67 100644
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,10 @@
Changelog
Daniel S (2 Jan 2008)
+- I fixed two cases of missing return code checks when handling chunked
+ decoding where a write error (or abort return from a callback) didn't stop
+ libcurl's processing.
+
- I removed the socklen_t use from the public curl/curl.h header and instead
made it an unsigned int. The type was only used in the curl_sockaddr struct
definition (only used by the curl_opensocket_callback). On all platforms I
diff --git a/lib/http_chunks.c b/lib/http_chunks.c
index 2bf161560..d76586cb2 100644
--- a/lib/http_chunks.c
+++ b/lib/http_chunks.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -118,8 +118,11 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
/* the original data is written to the client, but we go on with the
chunk read process, to properly calculate the content length*/
- if(data->set.http_te_skip && !k->ignorebody)
- Curl_client_write(conn, CLIENTWRITE_BODY, datap,datalen);
+ if(data->set.http_te_skip && !k->ignorebody) {
+ result = Curl_client_write(conn, CLIENTWRITE_BODY, datap, datalen);
+ if(result)
+ return CHUNKE_WRITE_ERROR;
+ }
while(length) {
switch(ch->state) {
@@ -362,9 +365,12 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
return(CHUNKE_BAD_CHUNK);
}
#endif /* CURL_DOES_CONVERSIONS */
- if( !data->set.http_te_skip )
- Curl_client_write(conn, CLIENTWRITE_HEADER,
- conn->trailer, conn->trlPos);
+ if(!data->set.http_te_skip) {
+ result = Curl_client_write(conn, CLIENTWRITE_HEADER,
+ conn->trailer, conn->trlPos);
+ if(result)
+ return CHUNKE_WRITE_ERROR;
+ }
}
ch->state = CHUNK_TRAILER;
conn->trlPos=0;