mirror of
https://github.com/moparisthebest/curl
synced 2025-01-11 05:58:01 -05:00
OS400/ccsidcurl: replace use of Curl_vsetopt
(and make the code style comply) Fixes #3833
This commit is contained in:
parent
bdb2dbc103
commit
bccf1dce53
@ -1141,7 +1141,7 @@ curl_easy_setopt_ccsid(CURL * curl, CURLoption tag, ...)
|
|||||||
(int) STRING_LAST != (int) STRING_COPYPOSTFIELDS + 1)
|
(int) STRING_LAST != (int) STRING_COPYPOSTFIELDS + 1)
|
||||||
curl_mfprintf(stderr,
|
curl_mfprintf(stderr,
|
||||||
"*** WARNING: curl_easy_setopt_ccsid() should be reworked ***\n");
|
"*** WARNING: curl_easy_setopt_ccsid() should be reworked ***\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
data = (struct Curl_easy *) curl;
|
data = (struct Curl_easy *) curl;
|
||||||
va_start(arg, tag);
|
va_start(arg, tag);
|
||||||
@ -1235,8 +1235,8 @@ curl_easy_setopt_ccsid(CURL * curl, CURLoption tag, ...)
|
|||||||
if(!s) {
|
if(!s) {
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
result = CURLE_OUT_OF_MEMORY;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
result = curl_easy_setopt(curl, tag, s);
|
result = curl_easy_setopt(curl, tag, s);
|
||||||
free(s);
|
free(s);
|
||||||
@ -1254,7 +1254,7 @@ curl_easy_setopt_ccsid(CURL * curl, CURLoption tag, ...)
|
|||||||
if(!s || !pfsize || ccsid == NOCONV_CCSID || ccsid == ASCII_CCSID) {
|
if(!s || !pfsize || ccsid == NOCONV_CCSID || ccsid == ASCII_CCSID) {
|
||||||
result = curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, s);
|
result = curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, s);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pfsize == -1) {
|
if(pfsize == -1) {
|
||||||
/* Data is null-terminated. */
|
/* Data is null-terminated. */
|
||||||
@ -1272,7 +1272,7 @@ curl_easy_setopt_ccsid(CURL * curl, CURLoption tag, ...)
|
|||||||
if(pfsize < 0 || pfsize > SIZE_MAX) {
|
if(pfsize < 0 || pfsize > SIZE_MAX) {
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
result = CURLE_OUT_OF_MEMORY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = pfsize;
|
len = pfsize;
|
||||||
pfsize = len * MAX_CONV_EXPANSION;
|
pfsize = len * MAX_CONV_EXPANSION;
|
||||||
@ -1285,7 +1285,7 @@ curl_easy_setopt_ccsid(CURL * curl, CURLoption tag, ...)
|
|||||||
if(!cp) {
|
if(!cp) {
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
result = CURLE_OUT_OF_MEMORY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pfsize = convert(cp, pfsize, ASCII_CCSID, s, len, ccsid);
|
pfsize = convert(cp, pfsize, ASCII_CCSID, s, len, ccsid);
|
||||||
|
|
||||||
@ -1293,11 +1293,11 @@ curl_easy_setopt_ccsid(CURL * curl, CURLoption tag, ...)
|
|||||||
free(cp);
|
free(cp);
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
result = CURLE_OUT_OF_MEMORY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
data->set.postfieldsize = pfsize; /* Replace data size. */
|
data->set.postfieldsize = pfsize; /* Replace data size. */
|
||||||
s = cp;
|
s = cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, s);
|
result = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, s);
|
||||||
data->set.str[STRING_COPYPOSTFIELDS] = s; /* Give to library. */
|
data->set.str[STRING_COPYPOSTFIELDS] = s; /* Give to library. */
|
||||||
@ -1305,9 +1305,12 @@ curl_easy_setopt_ccsid(CURL * curl, CURLoption tag, ...)
|
|||||||
|
|
||||||
case CURLOPT_ERRORBUFFER: /* This is an output buffer. */
|
case CURLOPT_ERRORBUFFER: /* This is an output buffer. */
|
||||||
default:
|
default:
|
||||||
result = Curl_vsetopt(data, tag, arg);
|
{
|
||||||
|
long val = va_arg(arg, long);
|
||||||
|
result = curl_easy_setopt(curl, tag, val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user