[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 97/125: easy: fix connection ownership in curl_easy
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 97/125: easy: fix connection ownership in curl_easy_pause |
Date: |
Sun, 21 Jan 2018 23:42:32 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 2a6dbb8155d3e96640d74f56a3be5cd557c33769
Author: Basuke Suzuki <address@hidden>
AuthorDate: Fri Jan 5 15:39:07 2018 -0800
easy: fix connection ownership in curl_easy_pause
Before calling Curl_client_chop_write(), change the owner of connection
to the current Curl_easy handle. This will fix the issue #2217.
Fixes https://github.com/curl/curl/issues/2217
Closes https://github.com/curl/curl/pull/2221
---
lib/easy.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/lib/easy.c b/lib/easy.c
index 75f332b07..d34887913 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -1045,6 +1045,8 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int
action)
unsigned int i;
unsigned int count = data->state.tempcount;
struct tempbuf writebuf[3]; /* there can only be three */
+ struct connectdata *conn = data->easy_conn;
+ struct Curl_easy *saved_data = NULL;
/* copy the structs to allow for immediate re-pausing */
for(i = 0; i < data->state.tempcount; i++) {
@@ -1053,16 +1055,27 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int
action)
}
data->state.tempcount = 0;
+ /* set the connection's current owner */
+ if(conn->data != data) {
+ saved_data = conn->data;
+ conn->data = data;
+ }
+
for(i = 0; i < count; i++) {
/* even if one function returns error, this loops through and frees all
buffers */
if(!result)
- result = Curl_client_chop_write(data->easy_conn,
+ result = Curl_client_chop_write(conn,
writebuf[i].type,
writebuf[i].buf,
writebuf[i].len);
free(writebuf[i].buf);
}
+
+ /* recover previous owner of the connection */
+ if(saved_data)
+ conn->data = saved_data;
+
if(result)
return result;
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 90/125: openssl: fix memory leak of SSLKEYLOGFILE filename, (continued)
- [GNUnet-SVN] [gnurl] 90/125: openssl: fix memory leak of SSLKEYLOGFILE filename, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 98/125: http2: fix incorrect trailer buffer size, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 70/125: rand: add a clang-analyzer work-around, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 66/125: libssh: fix a syntax error in configure.ac, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 72/125: brotli: allow compiling with version 0.6.0., gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 111/125: CURLOPT_TCP_NODELAY.3: fix typo, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 104/125: test393: verify --max-filesize with excessive Content-Length, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 109/125: openssl: enable SSLKEYLOGFILE support by default, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 88/125: test1554: improve the error handling, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 87/125: test1554: add global initialization and cleanup, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 97/125: easy: fix connection ownership in curl_easy_pause,
gnunet <=
- [GNUnet-SVN] [gnurl] 89/125: Revert "curl/system.h: fix compilation with gcc on AIX PPC and IA64 HP-UX", gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 105/125: test394: verify abort of rubbish in Content-Length: value, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 83/125: tool_getparam: Support size modifiers for --max-filesize, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 100/125: setopt: fix SSLVERSION to allow CURL_SSLVERSION_MAX_ values, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 115/125: unit1307: test many wildcards too, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 106/125: test395: HTTP with overflow Content-Length value, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 101/125: RELEASE-NOTES: synced with 6fa10c8fa, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 110/125: smtp/pop3/imap_get_message: decrease the data length too..., gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 91/125: build: remove HAVE_LIMITS_H check, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 113/125: ftp-wildcard: fix matching an empty string with "*[^a]", gnunet, 2018/01/21