Handle hpost stream abort CURLE_READ_ERROR error code.

master
Alexey Melnichuk 2017-10-23 13:10:09 +03:00
parent 435a0be37b
commit e523cb4535
3 changed files with 9 additions and 7 deletions

View File

@ -44,10 +44,14 @@ static const char *LCURL_HTTPPOST = LCURL_HTTPPOST_NAME;
# define LCURL_LEN_TYPE long
#endif
/* 7.56.0 changed code for `curl_formget` if callback abort write
* not sure is it bug or not so set only for single version
/* 7.56.0 changed code for `curl_formget` if callback abort write.
*
* https://github.com/curl/curl/issues/1987#issuecomment-336139060
* ... not sure its worth the effort to document its return codes to
* any further extent then it currently is. This function is very
* rarely used, and the new mime API doesn't even have a version of it.
**/
#if LCURL_CURL_VER_GE(7,56,0) && !LCURL_CURL_VER_GE(7,56,1)
#if LCURL_CURL_VER_GE(7,56,0)
# define LCURL_GET_CB_ERROR CURLE_READ_ERROR
#else
# define LCURL_GET_CB_ERROR (CURLcode)-1

View File

@ -20,8 +20,7 @@ local fname = "./test.download"
local utils = require "utils"
-- libcurl 7.56.0 does not add `Content-Type: text/plain`
-- not sure is it bug or not
-- Bug. libcurl 7.56.0 does not add `Content-Type: text/plain`
local text_plain = utils.is_curl_eq(7,56,0) and 'test/plain' or 'text/plain'
local GET_URL = "http://127.0.0.1:7090/get"

View File

@ -14,8 +14,7 @@ local skip = lunit.skip or function() end
local utils = require "utils"
-- libcurl 7.56.0 does not add `Content-Type: text/plain`
-- not sure is it bug or not
-- Bug. libcurl 7.56.0 does not add `Content-Type: text/plain`
local text_plain = utils.is_curl_eq(7,56,0) and 'test/plain' or 'text/plain'
local curl = require "lcurl"