diff options
author | Björn Stenberg <bjorn@haxx.se> | 2018-02-10 15:13:15 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-02-15 09:36:03 +0100 |
commit | b46cfbc068ebe90f18e9777b9e877e4934c1b5e3 (patch) | |
tree | 4d88b0f4d9492f51a93251e488400ff7a8abba62 /lib/sendf.c | |
parent | 43a50a2580db2bfb28483a96964ae27b584472da (diff) | |
download | curl-b46cfbc068ebe90f18e9777b9e877e4934c1b5e3.tar.gz |
TODO fixed: Detect when called from within callbacks
Closes #2302
Diffstat (limited to 'lib/sendf.c')
-rw-r--r-- | lib/sendf.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/sendf.c b/lib/sendf.c index 027f97c47..0fca81555 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -37,6 +37,7 @@ #include "connect.h" #include "vtls/vtls.h" #include "ssh.h" +#include "easyif.h" #include "multiif.h" #include "non-ascii.h" #include "strerror.h" @@ -598,7 +599,10 @@ CURLcode Curl_client_chop_write(struct connectdata *conn, } if(writeheader) { - size_t wrote = writeheader(ptr, 1, chunklen, data->set.writeheader); + size_t wrote; + Curl_set_in_callback(data, true); + wrote = writeheader(ptr, 1, chunklen, data->set.writeheader); + Curl_set_in_callback(data, false); if(CURL_WRITEFUNC_PAUSE == wrote) /* here we pass in the HEADER bit only since if this was body as well @@ -798,8 +802,11 @@ static int showit(struct Curl_easy *data, curl_infotype type, } #endif /* CURL_DOES_CONVERSIONS */ - if(data->set.fdebug) + if(data->set.fdebug) { + Curl_set_in_callback(data, true); rc = (*data->set.fdebug)(data, type, ptr, size, data->set.debugdata); + Curl_set_in_callback(data, false); + } else { switch(type) { case CURLINFO_TEXT: |