mirror of
https://github.com/curl/curl.git
synced 2026-08-05 10:46:19 +03:00
tool_formparse: polish error message + make two functions static
Closes #21510
This commit is contained in:
parent
e0df43b9d3
commit
21687202d9
2 changed files with 7 additions and 10 deletions
|
|
@ -192,8 +192,8 @@ void tool_mime_free(struct tool_mime *mime)
|
|||
}
|
||||
|
||||
/* Mime part callbacks for stdin. */
|
||||
size_t tool_mime_stdin_read(char *buffer,
|
||||
size_t size, size_t nitems, void *arg)
|
||||
static size_t tool_mime_stdin_read(char *buffer,
|
||||
size_t size, size_t nitems, void *arg)
|
||||
{
|
||||
struct tool_mime *sip = (struct tool_mime *)arg;
|
||||
curl_off_t bytesleft;
|
||||
|
|
@ -217,7 +217,8 @@ size_t tool_mime_stdin_read(char *buffer,
|
|||
if(ferror(stdin)) {
|
||||
char errbuf[STRERROR_LEN];
|
||||
/* Show error only once. */
|
||||
warnf("stdin: %s", curlx_strerror(errno, errbuf, sizeof(errbuf)));
|
||||
warnf("Failed to read from stdin: %s",
|
||||
curlx_strerror(errno, errbuf, sizeof(errbuf)));
|
||||
return CURL_READFUNC_ABORT;
|
||||
}
|
||||
}
|
||||
|
|
@ -226,7 +227,7 @@ size_t tool_mime_stdin_read(char *buffer,
|
|||
return nitems;
|
||||
}
|
||||
|
||||
int tool_mime_stdin_seek(void *instream, curl_off_t offset, int whence)
|
||||
static int tool_mime_stdin_seek(void *instream, curl_off_t offset, int whence)
|
||||
{
|
||||
struct tool_mime *sip = (struct tool_mime *)instream;
|
||||
|
||||
|
|
@ -294,8 +295,8 @@ static CURLcode tool2curlparts(CURL *curl, struct tool_mime *m,
|
|||
FALLTHROUGH();
|
||||
case TOOLMIME_STDINDATA:
|
||||
result = curl_mime_data_cb(part, m->size,
|
||||
(curl_read_callback)tool_mime_stdin_read,
|
||||
(curl_seek_callback)tool_mime_stdin_seek,
|
||||
tool_mime_stdin_read,
|
||||
tool_mime_stdin_seek,
|
||||
NULL, m);
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -57,10 +57,6 @@ struct tool_mime {
|
|||
curl_off_t curpos; /* Stdin current read position. */
|
||||
};
|
||||
|
||||
size_t tool_mime_stdin_read(char *buffer,
|
||||
size_t size, size_t nitems, void *arg);
|
||||
int tool_mime_stdin_seek(void *instream, curl_off_t offset, int whence);
|
||||
|
||||
int formparse(const char *input,
|
||||
struct tool_mime **mimeroot,
|
||||
struct tool_mime **mimecurrent,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue