Skip to content

Commit e523cb4

Browse files
committed
Handle hpost stream abort CURLE_READ_ERROR error code.
1 parent 435a0be commit e523cb4

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/lchttppost.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ static const char *LCURL_HTTPPOST = LCURL_HTTPPOST_NAME;
4444
# define LCURL_LEN_TYPE long
4545
#endif
4646

47-
/* 7.56.0 changed code for `curl_formget` if callback abort write
48-
* not sure is it bug or not so set only for single version
47+
/* 7.56.0 changed code for `curl_formget` if callback abort write.
48+
*
49+
* https://github.com/curl/curl/issues/1987#issuecomment-336139060
50+
* ... not sure its worth the effort to document its return codes to
51+
* any further extent then it currently is. This function is very
52+
* rarely used, and the new mime API doesn't even have a version of it.
4953
**/
50-
#if LCURL_CURL_VER_GE(7,56,0) && !LCURL_CURL_VER_GE(7,56,1)
54+
#if LCURL_CURL_VER_GE(7,56,0)
5155
# define LCURL_GET_CB_ERROR CURLE_READ_ERROR
5256
#else
5357
# define LCURL_GET_CB_ERROR (CURLcode)-1

test/test_curl.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ local fname = "./test.download"
2020

2121
local utils = require "utils"
2222

23-
-- libcurl 7.56.0 does not add `Content-Type: text/plain`
24-
-- not sure is it bug or not
23+
-- Bug. libcurl 7.56.0 does not add `Content-Type: text/plain`
2524
local text_plain = utils.is_curl_eq(7,56,0) and 'test/plain' or 'text/plain'
2625

2726
local GET_URL = "http://127.0.0.1:7090/get"

test/test_form.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ local skip = lunit.skip or function() end
1414

1515
local utils = require "utils"
1616

17-
-- libcurl 7.56.0 does not add `Content-Type: text/plain`
18-
-- not sure is it bug or not
17+
-- Bug. libcurl 7.56.0 does not add `Content-Type: text/plain`
1918
local text_plain = utils.is_curl_eq(7,56,0) and 'test/plain' or 'text/plain'
2019

2120
local curl = require "lcurl"

0 commit comments

Comments
 (0)