size_t dest_limit = 0;
size_t total_limit = 0;
size_t shutdowns;
- int result = CPOOL_LIMIT_OK;
+ int res = CPOOL_LIMIT_OK;
if(!cpool)
return CPOOL_LIMIT_OK;
shutdowns = Curl_cshutdn_dest_count(cpool->idata, conn->destination);
}
if((live + shutdowns) >= dest_limit) {
- result = CPOOL_LIMIT_DEST;
+ res = CPOOL_LIMIT_DEST;
goto out;
}
}
shutdowns = Curl_cshutdn_count(cpool->idata);
}
if((cpool->num_conn + shutdowns) >= total_limit) {
- result = CPOOL_LIMIT_TOTAL;
+ res = CPOOL_LIMIT_TOTAL;
goto out;
}
}
out:
CPOOL_UNLOCK(cpool, cpool->idata);
- return result;
+ return res;
}
CURLcode Curl_cpool_add(struct Curl_easy *data,
}
if(done_cb) {
- result = done_cb(result, userdata);
+ result = done_cb(userdata);
}
CPOOL_UNLOCK(cpool, data);
return result;
void *userdata);
/* Act on the result of the find, may override it. */
-typedef bool Curl_cpool_done_match_cb(bool result, void *userdata);
+typedef bool Curl_cpool_done_match_cb(void *userdata);
/**
* Find a connection in the pool matching `destination`.
int curlx_win32_open(const char *filename, int oflag, ...)
{
int pmode = 0;
- int result = -1;
+ int res = -1;
TCHAR *fixed = NULL;
const TCHAR *target = NULL;
target = fixed;
else
target = filename_w;
- errno = _wsopen_s(&result, target, oflag, _SH_DENYNO, pmode);
+ errno = _wsopen_s(&res, target, oflag, _SH_DENYNO, pmode);
CURLX_FREE(filename_w);
}
else
target = fixed;
else
target = filename;
- errno = _sopen_s(&result, target, oflag, _SH_DENYNO, pmode);
+ errno = _sopen_s(&res, target, oflag, _SH_DENYNO, pmode);
#endif
CURLX_FREE(fixed);
- return result;
+ return res;
}
FILE *curlx_win32_fopen(const char *filename, const char *mode)
{
- FILE *result = NULL;
+ FILE *file = NULL;
TCHAR *fixed = NULL;
const TCHAR *target = NULL;
target = fixed;
else
target = filename_w;
- result = _wfsopen(target, mode_w, _SH_DENYNO);
+ file = _wfsopen(target, mode_w, _SH_DENYNO);
}
else
/* !checksrc! disable ERRNOVAR 1 */
target = fixed;
else
target = filename;
- result = _fsopen(target, mode, _SH_DENYNO);
+ file = _fsopen(target, mode, _SH_DENYNO);
#endif
CURLX_FREE(fixed);
- return result;
+ return file;
}
#if defined(__MINGW32__) && (__MINGW64_VERSION_MAJOR < 5)
FILE *curlx_win32_freopen(const char *filename, const char *mode, FILE *fp)
{
- FILE *result = NULL;
+ FILE *file = NULL;
TCHAR *fixed = NULL;
const TCHAR *target = NULL;
target = fixed;
else
target = filename_w;
- errno = _wfreopen_s(&result, target, mode_w, fp);
+ errno = _wfreopen_s(&file, target, mode_w, fp);
}
else
/* !checksrc! disable ERRNOVAR 1 */
target = fixed;
else
target = filename;
- errno = freopen_s(&result, target, mode, fp);
+ errno = freopen_s(&file, target, mode, fp);
#endif
CURLX_FREE(fixed);
- return result;
+ return file;
}
int curlx_win32_stat(const char *path, curlx_struct_stat *buffer)
{
- int result = -1;
+ int res = -1;
TCHAR *fixed = NULL;
const TCHAR *target = NULL;
target = fixed;
else
target = path_w;
- result = _wstati64(target, buffer);
+ res = _wstati64(target, buffer);
curlx_free(path_w);
}
else
target = fixed;
else
target = path;
- result = _stati64(target, buffer);
+ res = _stati64(target, buffer);
#endif
CURLX_FREE(fixed);
- return result;
+ return res;
}
#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_COOKIES) || \
}
struct context {
- struct ares_addrinfo *result;
+ struct ares_addrinfo *addr;
};
static void async_addrinfo_cb(void *userp, int status, int timeouts,
- struct ares_addrinfo *result)
+ struct ares_addrinfo *addr)
{
struct context *ctx = (struct context *)userp;
(void)timeouts;
if(ARES_SUCCESS == status) {
- ctx->result = result;
+ ctx->addr = addr;
}
}
/* Wait until no more requests are left to be processed */
ares_queue_wait_empty(channel, -1);
- if(ctx.result) {
+ if(ctx.addr) {
/* convert the c-ares version */
- *res = mk_getaddrinfo(ctx.result);
+ *res = mk_getaddrinfo(ctx.addr);
/* free the old */
- ares_freeaddrinfo(ctx.result);
+ ares_freeaddrinfo(ctx.addr);
}
else
rc = EAI_NONAME; /* got nothing */
static FILE *vmsfopenread(const char *file, const char *mode)
{
curlx_struct_stat statbuf;
- int result;
-
- result = curlx_stat(file, &statbuf);
-
- switch(statbuf.st_fab_rfm) {
- case FAB$C_VAR:
- case FAB$C_VFC:
- case FAB$C_STMCR:
- return curlx_fopen(file, FOPEN_READTEXT); /* VMS */
- break;
- default:
- return curlx_fopen(file, FOPEN_READTEXT, "rfm=stmlf", "ctx=stm");
+ int res = curlx_stat(file, &statbuf);
+
+ if(res != -1) {
+ switch(statbuf.st_fab_rfm) {
+ case FAB$C_VAR:
+ case FAB$C_VFC:
+ case FAB$C_STMCR:
+ return curlx_fopen(file, FOPEN_READTEXT); /* VMS */
+ break;
+ default:
+ return curlx_fopen(file, FOPEN_READTEXT, "rfm=stmlf", "ctx=stm");
+ }
}
+ return NULL;
}
#define fopen_read vmsfopenread
{
curl_mime *mime = (curl_mime *)instream;
curl_mimepart *part;
- int result = CURL_SEEKFUNC_OK;
+ int rc = CURL_SEEKFUNC_OK;
if(whence != SEEK_SET || offset)
return CURL_SEEKFUNC_CANTSEEK; /* Only support full rewind. */
for(part = mime->firstpart; part; part = part->nextpart) {
int res = mime_part_rewind(part);
if(res != CURL_SEEKFUNC_OK)
- result = res;
+ rc = res;
}
- if(result == CURL_SEEKFUNC_OK)
+ if(rc == CURL_SEEKFUNC_OK)
mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL);
- return result;
+ return rc;
}
/* Release part content. */
static CURLcode pgrsupdate(struct Curl_easy *data, bool showprogress)
{
if(!data->progress.hide) {
+ int rc;
if(data->set.fxferinfo) {
- int result;
/* There is a callback set, call that */
Curl_set_in_callback(data, TRUE);
- result = data->set.fxferinfo(data->set.progress_client,
- data->progress.dl.total_size,
- data->progress.dl.cur_size,
- data->progress.ul.total_size,
- data->progress.ul.cur_size);
+ rc = data->set.fxferinfo(data->set.progress_client,
+ data->progress.dl.total_size,
+ data->progress.dl.cur_size,
+ data->progress.ul.total_size,
+ data->progress.ul.cur_size);
Curl_set_in_callback(data, FALSE);
- if(result != CURL_PROGRESSFUNC_CONTINUE) {
- if(result) {
+ if(rc != CURL_PROGRESSFUNC_CONTINUE) {
+ if(rc) {
failf(data, "Callback aborted");
return CURLE_ABORTED_BY_CALLBACK;
}
}
}
else if(data->set.fprogress) {
- int result;
/* The older deprecated callback is set, call that */
Curl_set_in_callback(data, TRUE);
- result = data->set.fprogress(data->set.progress_client,
- (double)data->progress.dl.total_size,
- (double)data->progress.dl.cur_size,
- (double)data->progress.ul.total_size,
- (double)data->progress.ul.cur_size);
+ rc = data->set.fprogress(data->set.progress_client,
+ (double)data->progress.dl.total_size,
+ (double)data->progress.dl.cur_size,
+ (double)data->progress.ul.total_size,
+ (double)data->progress.ul.cur_size);
Curl_set_in_callback(data, FALSE);
- if(result != CURL_PROGRESSFUNC_CONTINUE) {
- if(result) {
+ if(rc != CURL_PROGRESSFUNC_CONTINUE) {
+ if(rc) {
failf(data, "Callback aborted");
return CURLE_ABORTED_BY_CALLBACK;
}
CURLcode code;
size_t actualread;
size_t nwritten;
- int result;
+ CURLcode result;
OM_uint32 gss_major_status, gss_minor_status, gss_status;
OM_uint32 gss_ret_flags;
int gss_conf_state, gss_enc;
return TRUE;
}
-static bool url_match_result(bool result, void *userdata)
+static bool url_match_result(void *userdata)
{
struct url_conn_match *match = userdata;
- (void)result;
if(match->found) {
/* Attach it now while still under lock, so the connection does
* no longer appear idle and can be reaped. */
(struct rustls_ssl_backend_data *)connssl->backend;
const struct rustls_connection *rconn = NULL;
CURLcode tmperr = CURLE_OK;
- int result;
+ CURLcode result;
bool wants_read;
bool wants_write;
#endif /* USE_ECH */
if(!backend->conn) {
- result = cr_init_backend(cf, data,
- (struct rustls_ssl_backend_data *)connssl->backend);
+ result =
+ cr_init_backend(cf, data,
+ (struct rustls_ssl_backend_data *)connssl->backend);
CURL_TRC_CF(data, cf, "cr_connect, init backend -> %d", result);
- if(result != CURLE_OK) {
+ if(result)
return result;
- }
connssl->state = ssl_connection_negotiating;
}
rconn = backend->conn;