mirror of
https://github.com/curl/curl.git
synced 2026-08-01 07:38:02 +03:00
code style: use spaces around pluses
This commit is contained in:
parent
ca86006deb
commit
e5743f08e7
104 changed files with 386 additions and 366 deletions
|
|
@ -118,7 +118,7 @@ static void memory_tracking_init(void)
|
|||
/* returns a hexdump in a static memory area */
|
||||
char *hexdump(const unsigned char *buffer, size_t len)
|
||||
{
|
||||
static char dump[200*3+1];
|
||||
static char dump[200 * 3 + 1];
|
||||
char *p = dump;
|
||||
size_t i;
|
||||
if(len > 200)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -78,7 +78,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
abort_on_test_timeout();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -99,7 +99,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
abort_on_test_timeout();
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &rd, &wr, &exc, &interval);
|
||||
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -118,7 +118,7 @@ int test(char *URL)
|
|||
case of (maxfd == -1), we call select(0, ...), which is basically equal
|
||||
to sleep. */
|
||||
|
||||
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
if(tutil_tvdiff(tutil_tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
|
||||
fprintf(stderr, "ABORTING TEST, since it seems "
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -87,7 +87,7 @@ static int do_one_request(CURLM *m, char *URL, char *resolve)
|
|||
timeout.tv_usec = 0;
|
||||
|
||||
multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
abort_on_test_timeout();
|
||||
multi_perform(m, &still_running);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -115,7 +115,7 @@ int test(char *URL)
|
|||
else {
|
||||
/* Note that on some platforms 'timeout' may be modified by select().
|
||||
If you need access to the original value save a copy beforehand. */
|
||||
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
}
|
||||
|
||||
switch(rc) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2013 - 2016, Linus Nielsen Feltzing, <linus@haxx.se>
|
||||
* Copyright (C) 2013 - 2017, Linus Nielsen Feltzing, <linus@haxx.se>
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -229,7 +229,7 @@ int test(char *URL)
|
|||
interval.tv_sec = 0;
|
||||
interval.tv_usec = 1000;
|
||||
|
||||
select_test(maxfd+1, &rd, &wr, &exc, &interval);
|
||||
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -73,7 +73,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -83,7 +83,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &rd, &wr, &exc, &interval);
|
||||
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -95,7 +95,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &rd, &wr, &exc, &interval);
|
||||
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -70,7 +70,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
abort_on_test_timeout();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -132,7 +132,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &rd, &wr, &exc, &interval);
|
||||
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &rd, &wr, &exc, &interval);
|
||||
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &rd, &wr, &exc, &interval);
|
||||
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &rd, &wr, &exc, &interval);
|
||||
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -63,7 +63,7 @@ static int perform(CURLM *multi)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
res_select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &interval);
|
||||
res_select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &interval);
|
||||
if(res)
|
||||
return res;
|
||||
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ static int loop(int num, CURLM *cm, const char *url, const char *userpwd,
|
|||
T.tv_usec = 0;
|
||||
}
|
||||
|
||||
res_select_test(M+1, &R, &W, &E, &T);
|
||||
res_select_test(M + 1, &R, &W, &E, &T);
|
||||
if(res)
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,30 +48,32 @@ void dump(const char *text,
|
|||
|
||||
fprintf(stream, "%s, %d bytes (0x%x)\n", text, (int)size, (int)size);
|
||||
|
||||
for(i = 0; i<size; i+= width) {
|
||||
for(i = 0; i<size; i += width) {
|
||||
|
||||
fprintf(stream, "%04x: ", (int)i);
|
||||
|
||||
if(!nohex) {
|
||||
/* hex not disabled, show it */
|
||||
for(c = 0; c < width; c++)
|
||||
if(i+c < size)
|
||||
fprintf(stream, "%02x ", ptr[i+c]);
|
||||
if(i + c < size)
|
||||
fprintf(stream, "%02x ", ptr[i + c]);
|
||||
else
|
||||
fputs(" ", stream);
|
||||
}
|
||||
|
||||
for(c = 0; (c < width) && (i+c < size); c++) {
|
||||
for(c = 0; (c < width) && (i + c < size); c++) {
|
||||
/* check for 0D0A; if found, skip past and start a new line of output */
|
||||
if(nohex && (i+c+1 < size) && ptr[i+c] == 0x0D && ptr[i+c+1] == 0x0A) {
|
||||
i+=(c+2-width);
|
||||
if(nohex && (i + c + 1 < size) && ptr[i + c] == 0x0D &&
|
||||
ptr[i + c + 1] == 0x0A) {
|
||||
i += (c + 2 - width);
|
||||
break;
|
||||
}
|
||||
fprintf(stream, "%c",
|
||||
(ptr[i+c] >= 0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
|
||||
(ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)? ptr[i + c] : '.');
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
if(nohex && (i+c+2 < size) && ptr[i+c+1] == 0x0D && ptr[i+c+2] == 0x0A) {
|
||||
i+=(c+3-width);
|
||||
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||
ptr[i + c + 2] == 0x0A) {
|
||||
i += (c + 3 - width);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1546,6 +1546,7 @@ static int test_weird_arguments(void)
|
|||
}
|
||||
|
||||
/* DBL_MAX value from Linux */
|
||||
/* !checksrc! disable PLUSNOSPACE 1 */
|
||||
#define MAXIMIZE -1.7976931348623157081452E+308
|
||||
|
||||
static int test_float_formatting(void)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -91,7 +91,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
abort_on_test_timeout();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2013, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -76,7 +76,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &rd, &wr, &exc, &interval);
|
||||
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *stream)
|
|||
}
|
||||
|
||||
data += 4;
|
||||
for(i = 0; i < message_size; i+= RTP_DATA_SIZE) {
|
||||
for(i = 0; i < message_size; i += RTP_DATA_SIZE) {
|
||||
if(message_size - i > RTP_DATA_SIZE) {
|
||||
if(memcmp(RTP_DATA, data + i, RTP_DATA_SIZE) != 0) {
|
||||
printf("RTP PAYLOAD CORRUPTED [%s]\n", data + i);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -88,7 +88,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2011, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -93,7 +93,7 @@ int test(char *URL)
|
|||
|
||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
abort_on_test_timeout();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -123,7 +123,7 @@ int test(char *URL)
|
|||
interval.tv_usec = 100000L; /* 100 ms */
|
||||
}
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &interval);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -120,11 +120,11 @@ int test(char *URL)
|
|||
interval.tv_usec = (itimeout%1000)*1000;
|
||||
}
|
||||
else {
|
||||
interval.tv_sec = TEST_HANG_TIMEOUT/1000+1;
|
||||
interval.tv_sec = TEST_HANG_TIMEOUT/1000 + 1;
|
||||
interval.tv_usec = 0;
|
||||
}
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &interval);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ int test(char *url)
|
|||
interval.tv_usec = (itimeout%1000)*1000;
|
||||
}
|
||||
else {
|
||||
interval.tv_sec = TEST_HANG_TIMEOUT/1000+1;
|
||||
interval.tv_sec = TEST_HANG_TIMEOUT/1000 + 1;
|
||||
interval.tv_usec = 0;
|
||||
|
||||
/* if there's no timeout and we get here on the last handle, we may
|
||||
|
|
@ -207,7 +207,7 @@ int test(char *url)
|
|||
}
|
||||
}
|
||||
|
||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &interval);
|
||||
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &interval);
|
||||
|
||||
abort_on_test_timeout();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -53,25 +53,27 @@ void libtest_debug_dump(const char *timebuf, const char *text, FILE *stream,
|
|||
if(!nohex) {
|
||||
/* hex not disabled, show it */
|
||||
for(c = 0; c < width; c++)
|
||||
if(i+c < size)
|
||||
fprintf(stream, "%02x ", ptr[i+c]);
|
||||
if(i + c < size)
|
||||
fprintf(stream, "%02x ", ptr[i + c]);
|
||||
else
|
||||
fputs(" ", stream);
|
||||
}
|
||||
|
||||
for(c = 0; (c < width) && (i+c < size); c++) {
|
||||
for(c = 0; (c < width) && (i + c < size); c++) {
|
||||
/* check for 0D0A; if found, skip past and start a new line of output */
|
||||
if(nohex &&
|
||||
(i+c+1 < size) && (ptr[i+c] == 0x0D) && (ptr[i+c+1] == 0x0A)) {
|
||||
i += (c+2-width);
|
||||
(i + c + 1 < size) && (ptr[i + c] == 0x0D) &&
|
||||
(ptr[i + c + 1] == 0x0A)) {
|
||||
i += (c + 2 - width);
|
||||
break;
|
||||
}
|
||||
fprintf(stream, "%c", ((ptr[i+c] >= 0x20) && (ptr[i+c] < 0x80)) ?
|
||||
ptr[i+c] : '.');
|
||||
fprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80)) ?
|
||||
ptr[i + c] : '.');
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
if(nohex &&
|
||||
(i+c+2 < size) && (ptr[i+c+1] == 0x0D) && (ptr[i+c+2] == 0x0A)) {
|
||||
i += (c+3-width);
|
||||
(i + c + 2 < size) && (ptr[i + c + 1] == 0x0D) &&
|
||||
(ptr[i + c + 2] == 0x0A)) {
|
||||
i += (c + 3 - width);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ static char *printable(char *inbuf, size_t inlength)
|
|||
inlength = strlen(inbuf);
|
||||
|
||||
if(inlength) {
|
||||
outincr = ((inlength/2) < (HEX_STR_LEN+1)) ? HEX_STR_LEN+1 : inlength/2;
|
||||
outincr = ((inlength/2) < (HEX_STR_LEN + 1)) ?
|
||||
HEX_STR_LEN + 1 : inlength/2;
|
||||
outsize = inlength + outincr;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -250,11 +250,11 @@ int getpart(char **outbuf, size_t *outlen,
|
|||
const char *main, const char *sub, FILE *stream)
|
||||
{
|
||||
# define MAX_TAG_LEN 79
|
||||
char couter[MAX_TAG_LEN+1]; /* current outermost section */
|
||||
char cmain[MAX_TAG_LEN+1]; /* current main section */
|
||||
char csub[MAX_TAG_LEN+1]; /* current sub section */
|
||||
char ptag[MAX_TAG_LEN+1]; /* potential tag */
|
||||
char patt[MAX_TAG_LEN+1]; /* potential attributes */
|
||||
char couter[MAX_TAG_LEN + 1]; /* current outermost section */
|
||||
char cmain[MAX_TAG_LEN + 1]; /* current main section */
|
||||
char csub[MAX_TAG_LEN + 1]; /* current sub section */
|
||||
char ptag[MAX_TAG_LEN + 1]; /* potential tag */
|
||||
char patt[MAX_TAG_LEN + 1]; /* potential attributes */
|
||||
char *buffer = NULL;
|
||||
char *ptr;
|
||||
char *end;
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ static int ProcessRequest(struct httprequest *req)
|
|||
SET_RTP_PKT_LEN(rtp_scratch, rtp_size);
|
||||
|
||||
/* Fill it with junk data */
|
||||
for(i = 0; i < rtp_size; i+= RTP_DATA_SIZE) {
|
||||
for(i = 0; i < rtp_size; i += RTP_DATA_SIZE) {
|
||||
memcpy(rtp_scratch + 4 + i, RTP_DATA, RTP_DATA_SIZE);
|
||||
}
|
||||
|
||||
|
|
@ -554,8 +554,8 @@ static int ProcessRequest(struct httprequest *req)
|
|||
/* if the host name starts with test, the port number used in the
|
||||
CONNECT line will be used as test number! */
|
||||
char *portp = strchr(doc, ':');
|
||||
if(portp && (*(portp+1) != '\0') && ISDIGIT(*(portp+1)))
|
||||
req->testno = strtol(portp+1, NULL, 10);
|
||||
if(portp && (*(portp + 1) != '\0') && ISDIGIT(*(portp + 1)))
|
||||
req->testno = strtol(portp + 1, NULL, 10);
|
||||
else
|
||||
req->testno = DOCNUMBER_CONNECT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -578,18 +578,18 @@ static int ProcessRequest(struct httprequest *req)
|
|||
}
|
||||
if(*p != ']')
|
||||
logmsg("Invalid CONNECT IPv6 address format");
|
||||
else if(*(p+1) != ':')
|
||||
else if(*(p + 1) != ':')
|
||||
logmsg("Invalid CONNECT IPv6 port format");
|
||||
else
|
||||
portp = p+1;
|
||||
portp = p + 1;
|
||||
|
||||
req->testno = part;
|
||||
}
|
||||
else
|
||||
portp = strchr(doc, ':');
|
||||
|
||||
if(portp && (*(portp+1) != '\0') && ISDIGIT(*(portp+1))) {
|
||||
unsigned long ulnum = strtoul(portp+1, NULL, 10);
|
||||
if(portp && (*(portp + 1) != '\0') && ISDIGIT(*(portp + 1))) {
|
||||
unsigned long ulnum = strtoul(portp + 1, NULL, 10);
|
||||
if(!ulnum || (ulnum > 65535UL))
|
||||
logmsg("Invalid CONNECT port received");
|
||||
else
|
||||
|
|
|
|||
|
|
@ -992,7 +992,7 @@ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size)
|
|||
|
||||
/* before increasing pointer, make sure it is still within the legal
|
||||
space */
|
||||
if((cp+1) < &buf.storage[size]) {
|
||||
if((cp + 1) < &buf.storage[size]) {
|
||||
++cp;
|
||||
if(first) {
|
||||
/* store the mode since we need it later */
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -130,7 +130,7 @@ UNITTEST_START
|
|||
key_len = strlen(data_key);
|
||||
|
||||
data_node->inuse = 1; /* hash will hold the reference */
|
||||
nodep = Curl_hash_add(&hp, data_key, key_len+1, data_node);
|
||||
nodep = Curl_hash_add(&hp, data_key, key_len + 1, data_node);
|
||||
abort_unless(nodep, "insertion into hash failed");
|
||||
/* Freeing will now be done by Curl_hash_destroy */
|
||||
data_node = NULL;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ static void splayprint(struct Curl_tree * t, int d, char output)
|
|||
if(t == NULL)
|
||||
return;
|
||||
|
||||
splayprint(t->larger, d+1, output);
|
||||
splayprint(t->larger, d + 1, output);
|
||||
for(i = 0; i<d; i++)
|
||||
if(output)
|
||||
printf(" ");
|
||||
|
|
@ -62,7 +62,7 @@ static void splayprint(struct Curl_tree * t, int d, char output)
|
|||
printf("\n");
|
||||
}
|
||||
|
||||
splayprint(t->smaller, d+1, output);
|
||||
splayprint(t->smaller, d + 1, output);
|
||||
}
|
||||
|
||||
UNITTEST_START
|
||||
|
|
@ -94,7 +94,7 @@ UNITTEST_START
|
|||
splayprint(root, 0, 1);
|
||||
|
||||
for(i = 0; i < NUM_NODES; i++) {
|
||||
int rem = (i+7)%NUM_NODES;
|
||||
int rem = (i + 7)%NUM_NODES;
|
||||
printf("Tree look:\n");
|
||||
splayprint(root, 0, 1);
|
||||
printf("remove pointer %d, payload %ld\n", rem,
|
||||
|
|
@ -119,13 +119,13 @@ UNITTEST_START
|
|||
/* add some nodes with the same key */
|
||||
for(j = 0; j <= i % 3; j++) {
|
||||
size_t payload = key.tv_usec*10 + j;
|
||||
nodes[i*3+j].payload = (void *)payload; /* for simplicity */
|
||||
root = Curl_splayinsert(key, root, &nodes[i*3+j]);
|
||||
nodes[i * 3 + j].payload = (void *)payload; /* for simplicity */
|
||||
root = Curl_splayinsert(key, root, &nodes[i * 3 + j]);
|
||||
}
|
||||
}
|
||||
|
||||
removed = NULL;
|
||||
for(i = 0; i <= 1100; i+= 100) {
|
||||
for(i = 0; i <= 1100; i += 100) {
|
||||
printf("Removing nodes not larger than %d\n", i);
|
||||
tv_now.tv_usec = i;
|
||||
root = Curl_splaygetbest(tv_now, root, &removed);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue