Loading lib/easy.c +2 −4 Original line number Diff line number Diff line Loading @@ -1079,9 +1079,7 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action) /* even if one function returns error, this loops through and frees all buffers */ if(!result) result = Curl_client_chop_write(conn, writebuf[i].type, writebuf[i].buf, result = Curl_client_write(conn, writebuf[i].type, writebuf[i].buf, writebuf[i].len); free(writebuf[i].buf); } Loading lib/sendf.c +30 −26 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2018, 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 Loading Loading @@ -541,18 +541,20 @@ static CURLcode pausewrite(struct Curl_easy *data, } /* Curl_client_chop_write() writes chunks of data not larger than * CURL_MAX_WRITE_SIZE via client write callback(s) and * takes care of pause requests from the callbacks. /* chop_write() writes chunks of data not larger than CURL_MAX_WRITE_SIZE via * client write callback(s) and takes care of pause requests from the * callbacks. */ CURLcode Curl_client_chop_write(struct connectdata *conn, static CURLcode chop_write(struct connectdata *conn, int type, char *ptr, size_t len) char *optr, size_t olen) { struct Curl_easy *data = conn->data; curl_write_callback writeheader = NULL; curl_write_callback writebody = NULL; char *ptr = optr; size_t len = olen; if(!len) return CURLE_OK; Loading Loading @@ -598,10 +600,16 @@ CURLcode Curl_client_chop_write(struct connectdata *conn, } } ptr += chunklen; len -= chunklen; } if(writeheader) { size_t wrote; ptr = optr; len = olen; Curl_set_in_callback(data, true); wrote = writeheader(ptr, 1, chunklen, data->set.writeheader); wrote = writeheader(ptr, 1, len, data->set.writeheader); Curl_set_in_callback(data, false); if(CURL_WRITEFUNC_PAUSE == wrote) Loading @@ -610,16 +618,12 @@ CURLcode Curl_client_chop_write(struct connectdata *conn, pause, so this is saved for later with the HEADER bit only */ return pausewrite(data, CLIENTWRITE_HEADER, ptr, len); if(wrote != chunklen) { if(wrote != len) { failf(data, "Failed writing header"); return CURLE_WRITE_ERROR; } } ptr += chunklen; len -= chunklen; } return CURLE_OK; } Loading Loading @@ -661,7 +665,7 @@ CURLcode Curl_client_write(struct connectdata *conn, #endif /* CURL_DO_LINEEND_CONV */ } return Curl_client_chop_write(conn, type, ptr, len); return chop_write(conn, type, ptr, len); } CURLcode Curl_read_plain(curl_socket_t sockfd, Loading lib/sendf.h +1 −3 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2018, 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 Loading Loading @@ -51,8 +51,6 @@ void Curl_failf(struct Curl_easy *, const char *fmt, ...); #define CLIENTWRITE_HEADER (1<<1) #define CLIENTWRITE_BOTH (CLIENTWRITE_BODY|CLIENTWRITE_HEADER) CURLcode Curl_client_chop_write(struct connectdata *conn, int type, char *ptr, size_t len) WARN_UNUSED_RESULT; CURLcode Curl_client_write(struct connectdata *conn, int type, char *ptr, size_t len) WARN_UNUSED_RESULT; Loading Loading
lib/easy.c +2 −4 Original line number Diff line number Diff line Loading @@ -1079,9 +1079,7 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action) /* even if one function returns error, this loops through and frees all buffers */ if(!result) result = Curl_client_chop_write(conn, writebuf[i].type, writebuf[i].buf, result = Curl_client_write(conn, writebuf[i].type, writebuf[i].buf, writebuf[i].len); free(writebuf[i].buf); } Loading
lib/sendf.c +30 −26 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2018, 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 Loading Loading @@ -541,18 +541,20 @@ static CURLcode pausewrite(struct Curl_easy *data, } /* Curl_client_chop_write() writes chunks of data not larger than * CURL_MAX_WRITE_SIZE via client write callback(s) and * takes care of pause requests from the callbacks. /* chop_write() writes chunks of data not larger than CURL_MAX_WRITE_SIZE via * client write callback(s) and takes care of pause requests from the * callbacks. */ CURLcode Curl_client_chop_write(struct connectdata *conn, static CURLcode chop_write(struct connectdata *conn, int type, char *ptr, size_t len) char *optr, size_t olen) { struct Curl_easy *data = conn->data; curl_write_callback writeheader = NULL; curl_write_callback writebody = NULL; char *ptr = optr; size_t len = olen; if(!len) return CURLE_OK; Loading Loading @@ -598,10 +600,16 @@ CURLcode Curl_client_chop_write(struct connectdata *conn, } } ptr += chunklen; len -= chunklen; } if(writeheader) { size_t wrote; ptr = optr; len = olen; Curl_set_in_callback(data, true); wrote = writeheader(ptr, 1, chunklen, data->set.writeheader); wrote = writeheader(ptr, 1, len, data->set.writeheader); Curl_set_in_callback(data, false); if(CURL_WRITEFUNC_PAUSE == wrote) Loading @@ -610,16 +618,12 @@ CURLcode Curl_client_chop_write(struct connectdata *conn, pause, so this is saved for later with the HEADER bit only */ return pausewrite(data, CLIENTWRITE_HEADER, ptr, len); if(wrote != chunklen) { if(wrote != len) { failf(data, "Failed writing header"); return CURLE_WRITE_ERROR; } } ptr += chunklen; len -= chunklen; } return CURLE_OK; } Loading Loading @@ -661,7 +665,7 @@ CURLcode Curl_client_write(struct connectdata *conn, #endif /* CURL_DO_LINEEND_CONV */ } return Curl_client_chop_write(conn, type, ptr, len); return chop_write(conn, type, ptr, len); } CURLcode Curl_read_plain(curl_socket_t sockfd, Loading
lib/sendf.h +1 −3 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2018, 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 Loading Loading @@ -51,8 +51,6 @@ void Curl_failf(struct Curl_easy *, const char *fmt, ...); #define CLIENTWRITE_HEADER (1<<1) #define CLIENTWRITE_BOTH (CLIENTWRITE_BODY|CLIENTWRITE_HEADER) CURLcode Curl_client_chop_write(struct connectdata *conn, int type, char *ptr, size_t len) WARN_UNUSED_RESULT; CURLcode Curl_client_write(struct connectdata *conn, int type, char *ptr, size_t len) WARN_UNUSED_RESULT; Loading