mirror of
https://github.com/curl/curl.git
synced 2026-01-26 15:03:21 +00:00
curl: rename a struct OutStruct field to 'regular_file'
From 's_isreg'. It explains better in plain English what it is for. Closes #20222
This commit is contained in:
parent
8a25cf3d7c
commit
97a02fade6
@ -224,7 +224,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
||||
outs->filename = filename;
|
||||
|
||||
outs->is_cd_filename = TRUE;
|
||||
outs->s_isreg = TRUE;
|
||||
outs->regular_file = TRUE;
|
||||
outs->fopened = FALSE;
|
||||
outs->alloc_filename = TRUE;
|
||||
hdrcbdata->honor_cd_filename = FALSE; /* done now! */
|
||||
|
||||
@ -99,7 +99,7 @@ bool tool_create_output_file(struct OutStruct *outs,
|
||||
curlx_strerror(errno, errbuf, sizeof(errbuf)));
|
||||
return FALSE;
|
||||
}
|
||||
outs->s_isreg = TRUE;
|
||||
outs->regular_file = TRUE;
|
||||
outs->fopened = TRUE;
|
||||
outs->stream = file;
|
||||
outs->bytes = 0;
|
||||
@ -282,7 +282,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
|
||||
/* regular file */
|
||||
if(!*outs->filename)
|
||||
check_fails = TRUE;
|
||||
if(!outs->s_isreg)
|
||||
if(!outs->regular_file)
|
||||
check_fails = TRUE;
|
||||
if(outs->fopened && !outs->stream)
|
||||
check_fails = TRUE;
|
||||
@ -293,7 +293,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
|
||||
}
|
||||
else {
|
||||
/* standard stream */
|
||||
if(!outs->stream || outs->s_isreg || outs->fopened)
|
||||
if(!outs->stream || outs->regular_file || outs->fopened)
|
||||
check_fails = TRUE;
|
||||
if(outs->alloc_filename || outs->is_cd_filename || outs->init)
|
||||
check_fails = TRUE;
|
||||
|
||||
@ -346,14 +346,14 @@ static bool is_outfile_auto_resumable(struct OperationConfig *config,
|
||||
{
|
||||
struct OutStruct *outs = &per->outs;
|
||||
return config->use_resume && config->resume_from_current &&
|
||||
config->resume_from >= 0 && outs->init == config->resume_from &&
|
||||
outs->bytes > 0 && outs->filename && outs->s_isreg && outs->fopened &&
|
||||
outs->stream && !ferror(outs->stream) &&
|
||||
!config->customrequest && !per->uploadfile &&
|
||||
(config->httpreq == TOOL_HTTPREQ_UNSPEC ||
|
||||
config->httpreq == TOOL_HTTPREQ_GET) &&
|
||||
/* CURLE_WRITE_ERROR could mean outs->bytes is not accurate */
|
||||
result != CURLE_WRITE_ERROR && result != CURLE_RANGE_ERROR;
|
||||
config->resume_from >= 0 && outs->init == config->resume_from &&
|
||||
outs->bytes > 0 && outs->filename && outs->regular_file && outs->fopened &&
|
||||
outs->stream && !ferror(outs->stream) &&
|
||||
!config->customrequest && !per->uploadfile &&
|
||||
(config->httpreq == TOOL_HTTPREQ_UNSPEC ||
|
||||
config->httpreq == TOOL_HTTPREQ_GET) &&
|
||||
/* CURLE_WRITE_ERROR could mean outs->bytes is not accurate */
|
||||
result != CURLE_WRITE_ERROR && result != CURLE_RANGE_ERROR;
|
||||
}
|
||||
|
||||
static CURLcode retrycheck(struct OperationConfig *config,
|
||||
@ -676,7 +676,7 @@ static CURLcode post_per_transfer(struct per_transfer *per,
|
||||
result = CURLE_WRITE_ERROR;
|
||||
}
|
||||
|
||||
if(!outs->s_isreg && outs->stream) {
|
||||
if(!outs->regular_file && outs->stream) {
|
||||
/* Dump standard stream buffered data */
|
||||
rc = fflush(outs->stream);
|
||||
if(!result && rc) {
|
||||
@ -731,7 +731,7 @@ static CURLcode post_per_transfer(struct per_transfer *per,
|
||||
}
|
||||
|
||||
/* File time can only be set _after_ the file has been closed */
|
||||
if(!result && config->remote_time && outs->s_isreg && outs->filename) {
|
||||
if(!result && config->remote_time && outs->regular_file && outs->filename) {
|
||||
/* Ask libcurl if we got a remote file time */
|
||||
curl_off_t filetime = -1;
|
||||
curl_easy_getinfo(curl, CURLINFO_FILETIME_T, &filetime);
|
||||
@ -903,7 +903,7 @@ static CURLcode etag_store(struct OperationConfig *config,
|
||||
}
|
||||
else {
|
||||
etag_save->filename = config->etag_save_file;
|
||||
etag_save->s_isreg = TRUE;
|
||||
etag_save->regular_file = TRUE;
|
||||
etag_save->fopened = TRUE;
|
||||
etag_save->stream = newfile;
|
||||
}
|
||||
@ -956,7 +956,7 @@ static CURLcode setup_headerfile(struct OperationConfig *config,
|
||||
}
|
||||
else {
|
||||
heads->filename = config->headerfile;
|
||||
heads->s_isreg = TRUE;
|
||||
heads->regular_file = TRUE;
|
||||
heads->fopened = TRUE;
|
||||
heads->stream = newfile;
|
||||
}
|
||||
@ -1068,7 +1068,7 @@ static CURLcode setup_outfile(struct OperationConfig *config,
|
||||
outs->stream = NULL; /* open when needed */
|
||||
}
|
||||
outs->filename = per->outfile;
|
||||
outs->s_isreg = TRUE;
|
||||
outs->regular_file = TRUE;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -38,10 +38,10 @@
|
||||
* 'is_cd_filename' member is TRUE when string pointed by 'filename' has been
|
||||
* set using a server-specified Content-Disposition filename, otherwise FALSE.
|
||||
*
|
||||
* 's_isreg' member is TRUE when output goes to a regular file, this also
|
||||
* 'regular_file' member is TRUE when output goes to a regular file, this also
|
||||
* implies that output is 'seekable' and 'appendable' and also that member
|
||||
* 'filename' points to filename's string. For any standard stream member
|
||||
* 's_isreg' will be FALSE.
|
||||
* 'regular_file' will be FALSE.
|
||||
*
|
||||
* 'fopened' member is TRUE when output goes to a regular file and it
|
||||
* has been fopen'ed, requiring it to be closed later on. In any other
|
||||
@ -72,7 +72,7 @@ struct OutStruct {
|
||||
#endif
|
||||
BIT(alloc_filename);
|
||||
BIT(is_cd_filename);
|
||||
BIT(s_isreg);
|
||||
BIT(regular_file);
|
||||
BIT(fopened);
|
||||
BIT(out_null);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user