mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:33:31 +03:00
tidy-up: miscellaneous
- drop more uses of the word "just". (not enforced here) - drop some uses of the "will" word. - "then" -> "than". - tests/http/testenv/curl.py: fix copy-paste typo in error message. - pytest: replace `shutdownh` with `shutdown` in test names. Spotted by GitHub Code Quality. - comment typos. - whitespace and newlines fixes. Closes #21830
This commit is contained in:
parent
032b15c434
commit
d229055549
116 changed files with 184 additions and 185 deletions
|
|
@ -202,7 +202,7 @@ static int decodedata(char **buf, /* dest buffer */
|
|||
/*
|
||||
* currently there is no way to tell apart an OOM condition in
|
||||
* curlx_base64_decode() from zero length decoded data. For now,
|
||||
* let's just assume it is an OOM condition, currently we have
|
||||
* let's assume it is an OOM condition, currently we have
|
||||
* no input for this function that decodes to zero length data.
|
||||
*/
|
||||
free(buf64);
|
||||
|
|
@ -231,7 +231,7 @@ static int decodedata(char **buf, /* dest buffer */
|
|||
* and the size of the data is stored at the addresses that caller specifies.
|
||||
*
|
||||
* If the returned data is a string the returned size will be the length of
|
||||
* the string excluding null-termination. Otherwise it will just be the size
|
||||
* the string excluding null-termination. Otherwise it will be the size
|
||||
* of the returned binary data.
|
||||
*
|
||||
* Calling function is responsible to free returned buffer.
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ struct rtspd_httprequest {
|
|||
#define CMD_AUTH_REQUIRED "auth_required"
|
||||
|
||||
/* 'idle' means that it will accept the request fine but never respond
|
||||
any data. Just keep the connection alive. */
|
||||
any data. Keep the connection alive. */
|
||||
#define CMD_IDLE "idle"
|
||||
|
||||
/* 'stream' means to send a never-ending stream of data */
|
||||
|
|
@ -890,7 +890,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req)
|
|||
|
||||
responsesize = count;
|
||||
do {
|
||||
/* Ok, we send no more than 200 bytes at a time, just to make sure that
|
||||
/* Ok, we send no more than 200 bytes at a time, to make sure that
|
||||
larger chunks are split up so that the client will need to do multiple
|
||||
recv() calls to get it and thus we exercise that code better */
|
||||
size_t num = count;
|
||||
|
|
|
|||
|
|
@ -68,14 +68,13 @@
|
|||
* 'exit_signal_handler' for both signals.
|
||||
*
|
||||
* The 'exit_signal_handler' upon the first SIGINT or SIGTERM received signal
|
||||
* will just set to one the global var 'got_exit_signal' storing in global var
|
||||
* sets to one the global var 'got_exit_signal' storing in global var
|
||||
* 'exit_signal' the signal that triggered this change.
|
||||
*
|
||||
* Nothing fancy that could introduce problems is used, the program at certain
|
||||
* points in its normal flow checks if var 'got_exit_signal' is set and in
|
||||
* case this is true it just makes its way out of loops and functions in
|
||||
* structured and well behaved manner to achieve proper program cleanup and
|
||||
* termination.
|
||||
* case this is true it makes its way out of loops and functions in structured
|
||||
* and well behaved manner to achieve proper program cleanup and termination.
|
||||
*
|
||||
* Even with the above mechanism implemented it is worthwhile to note that
|
||||
* other signals might still be received, or that there might be systems on
|
||||
|
|
@ -172,7 +171,7 @@ static ssize_t write_wincon(int fd, const void *buf, size_t count)
|
|||
#endif
|
||||
|
||||
/* On Windows, we sometimes get this for a broken pipe, seemingly
|
||||
* when the client just closed stdin? */
|
||||
* when the client closed stdin? */
|
||||
#define CURL_WIN32_EPIPE 109
|
||||
|
||||
/*
|
||||
|
|
@ -897,7 +896,7 @@ static bool disc_handshake(void)
|
|||
return FALSE;
|
||||
}
|
||||
else if(!memcmp("QUIT", buffer, 4)) {
|
||||
/* just die */
|
||||
/* die */
|
||||
logmsg("quits");
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -945,7 +944,7 @@ static bool juggle(curl_socket_t *sockfdp,
|
|||
}
|
||||
|
||||
#ifdef HAVE_GETPPID
|
||||
/* As a last resort, quit if sockfilt process becomes orphan. Just in case
|
||||
/* As a last resort, quit if sockfilt process becomes orphan. In case
|
||||
parent ftpserver process has died without killing its sockfilt children */
|
||||
if(getppid() <= 1) {
|
||||
logmsg("process becomes orphan, exiting");
|
||||
|
|
@ -1055,7 +1054,7 @@ static bool juggle(curl_socket_t *sockfdp,
|
|||
buffer[0], buffer[1], buffer[2], buffer[3]);
|
||||
|
||||
if(!memcmp("PING", buffer, 4)) {
|
||||
/* send reply on stdout, just proving we are alive */
|
||||
/* send reply on stdout, proving we are alive */
|
||||
if(!write_stdout("PONG\n", 5))
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1073,7 +1072,7 @@ static bool juggle(curl_socket_t *sockfdp,
|
|||
return FALSE;
|
||||
}
|
||||
else if(!memcmp("QUIT", buffer, 4)) {
|
||||
/* just die */
|
||||
/* die */
|
||||
logmsg("quits");
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ static const char *cmdfile = "log/server.cmd";
|
|||
#define CMD_AUTH_REQUIRED "auth_required"
|
||||
|
||||
/* 'idle' means that it will accept the request fine but never respond
|
||||
any data. Just keep the connection alive. */
|
||||
any data. Keep the connection alive. */
|
||||
#define CMD_IDLE "idle"
|
||||
|
||||
/* 'stream' means to send a never-ending stream of data */
|
||||
|
|
@ -304,7 +304,7 @@ static int sws_parse_servercmd(struct sws_httprequest *req)
|
|||
else {
|
||||
logmsg("Unknown <servercmd> instruction found: %s", cmd);
|
||||
}
|
||||
/* try to deal with CRLF or just LF */
|
||||
/* try to deal with CRLF or LF */
|
||||
check = strchr(cmd, '\r');
|
||||
if(!check)
|
||||
check = strchr(cmd, '\n');
|
||||
|
|
@ -966,7 +966,7 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req)
|
|||
|
||||
responsesize = count;
|
||||
do {
|
||||
/* Ok, we send no more than N bytes at a time, just to make sure that
|
||||
/* Ok, we send no more than N bytes at a time, to make sure that
|
||||
larger chunks are split up so that the client will need to do multiple
|
||||
recv() calls to get it and thus we exercise that code better */
|
||||
size_t num = count;
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ static ssize_t write_behind(struct testcase *test, int convert)
|
|||
|
||||
b = &bfs[nextone];
|
||||
if(b->counter < -1) /* anything to flush? */
|
||||
return 0; /* just nop if nothing to do */
|
||||
return 0; /* nop if nothing to do */
|
||||
|
||||
if(!test->ofile) {
|
||||
char outfile[256];
|
||||
|
|
@ -453,11 +453,11 @@ static ssize_t write_behind(struct testcase *test, int convert)
|
|||
while(ct--) { /* loop over the buffer */
|
||||
c = (unsigned char)*p++; /* pick up a character */
|
||||
if(prevchar == '\r') { /* if prev char was cr */
|
||||
if(c == '\n') /* if have cr,lf then just */
|
||||
if(c == '\n') /* if have cr,lf then */
|
||||
curl_lseek(test->ofile, -1, SEEK_CUR); /* smash lf on top of the cr */
|
||||
else if(c == '\0') /* if have cr,nul then */
|
||||
goto skipit; /* just skip over the putc */
|
||||
/* else just fall through and allow it */
|
||||
goto skipit; /* skip over the putc */
|
||||
/* else fall through and allow it */
|
||||
}
|
||||
/* formerly
|
||||
putc(c, file); */
|
||||
|
|
@ -570,7 +570,7 @@ static int tftpd_parse_servercmd(struct testcase *req)
|
|||
else {
|
||||
logmsg("Unknown <servercmd> instruction found: %s", cmd);
|
||||
}
|
||||
/* try to deal with CRLF or just LF */
|
||||
/* try to deal with CRLF or LF */
|
||||
check = strchr(cmd, '\r');
|
||||
if(!check)
|
||||
check = strchr(cmd, '\n');
|
||||
|
|
@ -858,7 +858,7 @@ send_ack:
|
|||
rap->th_block = htons(recvblock);
|
||||
(void)swrite(peer, &ackbuf.storage[0], 4);
|
||||
#if defined(HAVE_ALARM) && defined(SIGALRM)
|
||||
mysignal(SIGALRM, justtimeout); /* just abort read on timeout */
|
||||
mysignal(SIGALRM, justtimeout); /* abort read on timeout */
|
||||
alarm(rexmtval);
|
||||
#endif
|
||||
/* normally times out and quits */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue