mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
code style: use spaces around pluses
This commit is contained in:
parent
ca86006deb
commit
e5743f08e7
@ -162,9 +162,9 @@ int main(void)
|
|||||||
T.tv_sec = L/1000;
|
T.tv_sec = L/1000;
|
||||||
T.tv_usec = (L%1000)*1000;
|
T.tv_usec = (L%1000)*1000;
|
||||||
|
|
||||||
if(0 > select(M+1, &R, &W, &E, &T)) {
|
if(0 > select(M + 1, &R, &W, &E, &T)) {
|
||||||
fprintf(stderr, "E: select(%i,,,,%li): %i: %s\n",
|
fprintf(stderr, "E: select(%i,,,,%li): %i: %s\n",
|
||||||
M+1, L, errno, strerror(errno));
|
M + 1, L, errno, strerror(errno));
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -93,7 +93,7 @@ int main(int argc, char *argv[])
|
|||||||
prttime = 1;
|
prttime = 1;
|
||||||
}
|
}
|
||||||
else if(strncasecmp(*argv, "-M=", 3) == 0) {
|
else if(strncasecmp(*argv, "-M=", 3) == 0) {
|
||||||
long m = strtol((*argv)+3, NULL, 10);
|
long m = strtol((*argv) + 3, NULL, 10);
|
||||||
switch(m) {
|
switch(m) {
|
||||||
case 1:
|
case 1:
|
||||||
url = URL_1M;
|
url = URL_1M;
|
||||||
|
@ -492,8 +492,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* pass our list of custom made headers */
|
/* pass our list of custom made headers */
|
||||||
|
|
||||||
contenttype = malloc(15+strlen(mimetype));
|
contenttype = malloc(15 + strlen(mimetype));
|
||||||
snprintf(contenttype, 15+strlen(mimetype), "Content-type: %s", mimetype);
|
snprintf(contenttype, 15 + strlen(mimetype), "Content-type: %s", mimetype);
|
||||||
headers = curl_slist_append(headers, contenttype);
|
headers = curl_slist_append(headers, contenttype);
|
||||||
curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers);
|
curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers);
|
||||||
|
|
||||||
|
@ -47,30 +47,32 @@ void dump(const char *text,
|
|||||||
fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
|
fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
|
||||||
text, (long)size, (long)size);
|
text, (long)size, (long)size);
|
||||||
|
|
||||||
for(i = 0; i<size; i+= width) {
|
for(i = 0; i<size; i += width) {
|
||||||
|
|
||||||
fprintf(stream, "%4.4lx: ", (long)i);
|
fprintf(stream, "%4.4lx: ", (long)i);
|
||||||
|
|
||||||
if(!nohex) {
|
if(!nohex) {
|
||||||
/* hex not disabled, show it */
|
/* hex not disabled, show it */
|
||||||
for(c = 0; c < width; c++)
|
for(c = 0; c < width; c++)
|
||||||
if(i+c < size)
|
if(i + c < size)
|
||||||
fprintf(stream, "%02x ", ptr[i+c]);
|
fprintf(stream, "%02x ", ptr[i + c]);
|
||||||
else
|
else
|
||||||
fputs(" ", stream);
|
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 */
|
/* 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) {
|
if(nohex && (i + c + 1 < size) && ptr[i + c] == 0x0D &&
|
||||||
i+=(c+2-width);
|
ptr[i + c + 1] == 0x0A) {
|
||||||
|
i += (c + 2 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fprintf(stream, "%c",
|
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 */
|
/* 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) {
|
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||||
i+=(c+3-width);
|
ptr[i + c + 2] == 0x0A) {
|
||||||
|
i += (c + 3 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ static int fill_buffer(URL_FILE *file, size_t want)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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) {
|
switch(rc) {
|
||||||
@ -398,7 +398,7 @@ char *url_fgets(char *ptr, size_t size, URL_FILE *file)
|
|||||||
/* look for newline or eof */
|
/* look for newline or eof */
|
||||||
for(loop = 0;loop < want;loop++) {
|
for(loop = 0;loop < want;loop++) {
|
||||||
if(file->buffer[loop] == '\n') {
|
if(file->buffer[loop] == '\n') {
|
||||||
want = loop+1;/* include newline */
|
want = loop + 1;/* include newline */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,7 @@ static gboolean fifo_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
|
|||||||
g_free(buf);
|
g_free(buf);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
buf = g_malloc(BUF_SIZE+1);
|
buf = g_malloc(BUF_SIZE + 1);
|
||||||
while(TRUE) {
|
while(TRUE) {
|
||||||
buf[BUF_SIZE]='\0';
|
buf[BUF_SIZE]='\0';
|
||||||
g_io_channel_read_chars(ch, buf, BUF_SIZE, &len, &err);
|
g_io_channel_read_chars(ch, buf, BUF_SIZE, &len, &err);
|
||||||
|
@ -74,30 +74,32 @@ void dump(const char *text, int num, unsigned char *ptr, size_t size,
|
|||||||
fprintf(stderr, "%d %s, %ld bytes (0x%lx)\n",
|
fprintf(stderr, "%d %s, %ld bytes (0x%lx)\n",
|
||||||
num, text, (long)size, (long)size);
|
num, text, (long)size, (long)size);
|
||||||
|
|
||||||
for(i = 0; i<size; i+= width) {
|
for(i = 0; i<size; i += width) {
|
||||||
|
|
||||||
fprintf(stderr, "%4.4lx: ", (long)i);
|
fprintf(stderr, "%4.4lx: ", (long)i);
|
||||||
|
|
||||||
if(!nohex) {
|
if(!nohex) {
|
||||||
/* hex not disabled, show it */
|
/* hex not disabled, show it */
|
||||||
for(c = 0; c < width; c++)
|
for(c = 0; c < width; c++)
|
||||||
if(i+c < size)
|
if(i + c < size)
|
||||||
fprintf(stderr, "%02x ", ptr[i+c]);
|
fprintf(stderr, "%02x ", ptr[i + c]);
|
||||||
else
|
else
|
||||||
fputs(" ", stderr);
|
fputs(" ", stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 */
|
/* 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) {
|
if(nohex && (i + c + 1 < size) && ptr[i + c] == 0x0D &&
|
||||||
i+=(c+2-width);
|
ptr[i + c + 1] == 0x0A) {
|
||||||
|
i += (c + 2 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "%c",
|
fprintf(stderr, "%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 */
|
/* 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) {
|
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||||
i+=(c+3-width);
|
ptr[i + c + 2] == 0x0A) {
|
||||||
|
i += (c + 3 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -269,7 +271,7 @@ int main(int argc, char **argv)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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) {
|
switch(rc) {
|
||||||
|
@ -54,30 +54,32 @@ void dump(const char *text, unsigned char *ptr, size_t size,
|
|||||||
fprintf(stderr, "%s, %ld bytes (0x%lx)\n",
|
fprintf(stderr, "%s, %ld bytes (0x%lx)\n",
|
||||||
text, (long)size, (long)size);
|
text, (long)size, (long)size);
|
||||||
|
|
||||||
for(i = 0; i<size; i+= width) {
|
for(i = 0; i<size; i += width) {
|
||||||
|
|
||||||
fprintf(stderr, "%4.4lx: ", (long)i);
|
fprintf(stderr, "%4.4lx: ", (long)i);
|
||||||
|
|
||||||
if(!nohex) {
|
if(!nohex) {
|
||||||
/* hex not disabled, show it */
|
/* hex not disabled, show it */
|
||||||
for(c = 0; c < width; c++)
|
for(c = 0; c < width; c++)
|
||||||
if(i+c < size)
|
if(i + c < size)
|
||||||
fprintf(stderr, "%02x ", ptr[i+c]);
|
fprintf(stderr, "%02x ", ptr[i + c]);
|
||||||
else
|
else
|
||||||
fputs(" ", stderr);
|
fputs(" ", stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 */
|
/* 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) {
|
if(nohex && (i + c + 1 < size) && ptr[i + c] == 0x0D &&
|
||||||
i+=(c+2-width);
|
ptr[i + c + 1] == 0x0A) {
|
||||||
|
i += (c + 2 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "%c",
|
fprintf(stderr, "%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 */
|
/* 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) {
|
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||||
i+=(c+3-width);
|
ptr[i + c + 2] == 0x0A) {
|
||||||
|
i += (c + 3 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -281,7 +283,7 @@ int main(void)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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) {
|
switch(rc) {
|
||||||
|
@ -75,30 +75,32 @@ void dump(const char *text, int num, unsigned char *ptr, size_t size,
|
|||||||
fprintf(stderr, "%d %s, %ld bytes (0x%lx)\n",
|
fprintf(stderr, "%d %s, %ld bytes (0x%lx)\n",
|
||||||
num, text, (long)size, (long)size);
|
num, text, (long)size, (long)size);
|
||||||
|
|
||||||
for(i = 0; i<size; i+= width) {
|
for(i = 0; i<size; i += width) {
|
||||||
|
|
||||||
fprintf(stderr, "%4.4lx: ", (long)i);
|
fprintf(stderr, "%4.4lx: ", (long)i);
|
||||||
|
|
||||||
if(!nohex) {
|
if(!nohex) {
|
||||||
/* hex not disabled, show it */
|
/* hex not disabled, show it */
|
||||||
for(c = 0; c < width; c++)
|
for(c = 0; c < width; c++)
|
||||||
if(i+c < size)
|
if(i + c < size)
|
||||||
fprintf(stderr, "%02x ", ptr[i+c]);
|
fprintf(stderr, "%02x ", ptr[i + c]);
|
||||||
else
|
else
|
||||||
fputs(" ", stderr);
|
fputs(" ", stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 */
|
/* 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) {
|
if(nohex && (i + c + 1 < size) && ptr[i + c] == 0x0D &&
|
||||||
i+=(c+2-width);
|
ptr[i + c + 1] == 0x0A) {
|
||||||
|
i += (c + 2 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "%c",
|
fprintf(stderr, "%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 */
|
/* 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) {
|
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||||
i+=(c+3-width);
|
ptr[i + c + 2] == 0x0A) {
|
||||||
|
i += (c + 3 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -333,7 +335,7 @@ int main(int argc, char **argv)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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) {
|
switch(rc) {
|
||||||
|
@ -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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -144,7 +144,7 @@ int main(void)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
|
if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
|
||||||
|
@ -130,7 +130,7 @@ int main(void)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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) {
|
switch(rc) {
|
||||||
|
@ -54,30 +54,32 @@ void dump(const char *text,
|
|||||||
fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
|
fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
|
||||||
text, (long)size, (long)size);
|
text, (long)size, (long)size);
|
||||||
|
|
||||||
for(i = 0; i<size; i+= width) {
|
for(i = 0; i<size; i += width) {
|
||||||
|
|
||||||
fprintf(stream, "%4.4lx: ", (long)i);
|
fprintf(stream, "%4.4lx: ", (long)i);
|
||||||
|
|
||||||
if(!nohex) {
|
if(!nohex) {
|
||||||
/* hex not disabled, show it */
|
/* hex not disabled, show it */
|
||||||
for(c = 0; c < width; c++)
|
for(c = 0; c < width; c++)
|
||||||
if(i+c < size)
|
if(i + c < size)
|
||||||
fprintf(stream, "%02x ", ptr[i+c]);
|
fprintf(stream, "%02x ", ptr[i + c]);
|
||||||
else
|
else
|
||||||
fputs(" ", stream);
|
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 */
|
/* 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) {
|
if(nohex && (i + c + 1 < size) && ptr[i + c] == 0x0D &&
|
||||||
i+=(c+2-width);
|
ptr[i + c + 1] == 0x0A) {
|
||||||
|
i += (c + 2 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fprintf(stream, "%c",
|
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 */
|
/* 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) {
|
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||||
i+=(c+3-width);
|
ptr[i + c + 2] == 0x0A) {
|
||||||
|
i += (c + 3 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -204,7 +206,7 @@ int main(void)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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) {
|
switch(rc) {
|
||||||
|
@ -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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -119,7 +119,7 @@ int main(void)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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) {
|
switch(rc) {
|
||||||
|
@ -135,7 +135,7 @@ int main(void)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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) {
|
switch(rc) {
|
||||||
|
@ -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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -144,7 +144,7 @@ int main(void)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
|
if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -211,7 +211,7 @@ int main(void)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
|
if(tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define MAX_STRING 256
|
#define MAX_STRING 256
|
||||||
#define MAX_STRING1 MAX_STRING+1
|
#define MAX_STRING1 MAX_STRING + 1
|
||||||
|
|
||||||
#define SYNCTIME_UA "synctime/1.0"
|
#define SYNCTIME_UA "synctime/1.0"
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ size_t SyncTime_CURL_WriteHeader(void *ptr, size_t size, size_t nmemb,
|
|||||||
SYSTime.wMilliseconds = 500; /* adjust to midpoint, 0.5 sec */
|
SYSTime.wMilliseconds = 500; /* adjust to midpoint, 0.5 sec */
|
||||||
for(i = 0; i<12; i++) {
|
for(i = 0; i<12; i++) {
|
||||||
if(strcmp(MthStr[i], TmpStr2) == 0) {
|
if(strcmp(MthStr[i], TmpStr2) == 0) {
|
||||||
SYSTime.wMonth = i+1;
|
SYSTime.wMonth = i + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ static CURLcode bindlocal(struct connectdata *conn,
|
|||||||
* as a hostname or ip address.
|
* as a hostname or ip address.
|
||||||
*/
|
*/
|
||||||
if(setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
|
if(setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
|
||||||
dev, (curl_socklen_t)strlen(dev)+1) != 0) {
|
dev, (curl_socklen_t)strlen(dev) + 1) != 0) {
|
||||||
error = SOCKERRNO;
|
error = SOCKERRNO;
|
||||||
infof(data, "SO_BINDTODEVICE %s failed with errno %d: %s;"
|
infof(data, "SO_BINDTODEVICE %s failed with errno %d: %s;"
|
||||||
" will do regular bind\n",
|
" will do regular bind\n",
|
||||||
|
@ -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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -227,7 +227,7 @@ static enum {
|
|||||||
|
|
||||||
extra_len = (data[1] << 8) | data[0];
|
extra_len = (data[1] << 8) | data[0];
|
||||||
|
|
||||||
if(len < (extra_len+2))
|
if(len < (extra_len + 2))
|
||||||
return GZIP_UNDERFLOW;
|
return GZIP_UNDERFLOW;
|
||||||
|
|
||||||
len -= (extra_len + 2);
|
len -= (extra_len + 2);
|
||||||
@ -288,7 +288,7 @@ Curl_unencode_gzip_write(struct connectdata *conn,
|
|||||||
|
|
||||||
if(strcmp(zlibVersion(), "1.2.0.4") >= 0) {
|
if(strcmp(zlibVersion(), "1.2.0.4") >= 0) {
|
||||||
/* zlib ver. >= 1.2.0.4 supports transparent gzip decompressing */
|
/* zlib ver. >= 1.2.0.4 supports transparent gzip decompressing */
|
||||||
if(inflateInit2(z, MAX_WBITS+32) != Z_OK) {
|
if(inflateInit2(z, MAX_WBITS + 32) != Z_OK) {
|
||||||
return process_zlib_error(conn, z);
|
return process_zlib_error(conn, z);
|
||||||
}
|
}
|
||||||
k->zlib_init = ZLIB_INIT_GZIP; /* Transparent gzip decompress state */
|
k->zlib_init = ZLIB_INIT_GZIP; /* Transparent gzip decompress state */
|
||||||
|
10
lib/cookie.c
10
lib/cookie.c
@ -125,7 +125,7 @@ static bool tailmatch(const char *cooke_domain, const char *hostname)
|
|||||||
if(hostname_len < cookie_domain_len)
|
if(hostname_len < cookie_domain_len)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(!strcasecompare(cooke_domain, hostname+hostname_len-cookie_domain_len))
|
if(!strcasecompare(cooke_domain, hostname + hostname_len-cookie_domain_len))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* A lead char of cookie_domain is not '.'.
|
/* A lead char of cookie_domain is not '.'.
|
||||||
@ -581,7 +581,7 @@ Curl_cookie_add(struct Curl_easy *data,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = semiptr+1;
|
ptr = semiptr + 1;
|
||||||
while(*ptr && ISBLANK(*ptr))
|
while(*ptr && ISBLANK(*ptr))
|
||||||
ptr++;
|
ptr++;
|
||||||
semiptr = strchr(ptr, ';'); /* now, find the next semicolon */
|
semiptr = strchr(ptr, ';'); /* now, find the next semicolon */
|
||||||
@ -645,8 +645,8 @@ Curl_cookie_add(struct Curl_easy *data,
|
|||||||
else
|
else
|
||||||
endslash = memrchr(path, '/', (size_t)(queryp - path));
|
endslash = memrchr(path, '/', (size_t)(queryp - path));
|
||||||
if(endslash) {
|
if(endslash) {
|
||||||
size_t pathlen = (size_t)(endslash-path+1); /* include ending slash */
|
size_t pathlen = (size_t)(endslash-path + 1); /* include end slash */
|
||||||
co->path = malloc(pathlen+1); /* one extra for the zero byte */
|
co->path = malloc(pathlen + 1); /* one extra for the zero byte */
|
||||||
if(co->path) {
|
if(co->path) {
|
||||||
memcpy(co->path, path, pathlen);
|
memcpy(co->path, path, pathlen);
|
||||||
co->path[pathlen] = 0; /* zero terminate */
|
co->path[pathlen] = 0; /* zero terminate */
|
||||||
@ -1202,7 +1202,7 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
|
|||||||
|
|
||||||
mainco = array[0]; /* start here */
|
mainco = array[0]; /* start here */
|
||||||
for(i = 0; i<matches-1; i++)
|
for(i = 0; i<matches-1; i++)
|
||||||
array[i]->next = array[i+1];
|
array[i]->next = array[i + 1];
|
||||||
array[matches-1]->next = NULL; /* terminate the list */
|
array[matches-1]->next = NULL; /* terminate the list */
|
||||||
|
|
||||||
free(array); /* remove the temporary data again */
|
free(array); /* remove the temporary data again */
|
||||||
|
@ -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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -151,7 +151,7 @@ static int setcharset(unsigned char **p, unsigned char *charset)
|
|||||||
(*p)++;
|
(*p)++;
|
||||||
}
|
}
|
||||||
else if(c == '[') {
|
else if(c == '[') {
|
||||||
char c2 = *((*p)+1);
|
char c2 = *((*p) + 1);
|
||||||
if(c2 == ':') { /* there has to be a keyword */
|
if(c2 == ':') { /* there has to be a keyword */
|
||||||
(*p) += 2;
|
(*p) += 2;
|
||||||
if(parsekeyword(p, charset)) {
|
if(parsekeyword(p, charset)) {
|
||||||
@ -319,9 +319,9 @@ static int loop(const unsigned char *pattern, const unsigned char *string)
|
|||||||
switch(state) {
|
switch(state) {
|
||||||
case CURLFNM_LOOP_DEFAULT:
|
case CURLFNM_LOOP_DEFAULT:
|
||||||
if(*p == '*') {
|
if(*p == '*') {
|
||||||
while(*(p+1) == '*') /* eliminate multiple stars */
|
while(*(p + 1) == '*') /* eliminate multiple stars */
|
||||||
p++;
|
p++;
|
||||||
if(*s == '\0' && *(p+1) == '\0')
|
if(*s == '\0' && *(p + 1) == '\0')
|
||||||
return CURL_FNMATCH_MATCH;
|
return CURL_FNMATCH_MATCH;
|
||||||
rc = loop(p + 1, s); /* *.txt matches .txt <=> .txt matches .txt */
|
rc = loop(p + 1, s); /* *.txt matches .txt <=> .txt matches .txt */
|
||||||
if(rc == CURL_FNMATCH_MATCH)
|
if(rc == CURL_FNMATCH_MATCH)
|
||||||
@ -351,7 +351,7 @@ static int loop(const unsigned char *pattern, const unsigned char *string)
|
|||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
else if(*p == '[') {
|
else if(*p == '[') {
|
||||||
unsigned char *pp = p+1; /* cannot handle with pointer to register */
|
unsigned char *pp = p + 1; /* cannot handle with pointer to register */
|
||||||
if(setcharset(&pp, charset)) {
|
if(setcharset(&pp, charset)) {
|
||||||
int found = FALSE;
|
int found = FALSE;
|
||||||
if(charset[(unsigned int)*s])
|
if(charset[(unsigned int)*s])
|
||||||
@ -381,7 +381,7 @@ static int loop(const unsigned char *pattern, const unsigned char *string)
|
|||||||
found = !found;
|
found = !found;
|
||||||
|
|
||||||
if(found) {
|
if(found) {
|
||||||
p = pp+1;
|
p = pp + 1;
|
||||||
s++;
|
s++;
|
||||||
memset(charset, 0, CURLFNM_CHSET_SIZE);
|
memset(charset, 0, CURLFNM_CHSET_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -780,7 +780,7 @@ CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash,
|
|||||||
|
|
||||||
/* Concatenate the HMAC MD5 output with the client nonce */
|
/* Concatenate the HMAC MD5 output with the client nonce */
|
||||||
memcpy(lmresp, hmac_output, 16);
|
memcpy(lmresp, hmac_output, 16);
|
||||||
memcpy(lmresp+16, challenge_client, 8);
|
memcpy(lmresp + 16, challenge_client, 8);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ char *Curl_dedotdotify(const char *input)
|
|||||||
size_t inlen = strlen(input);
|
size_t inlen = strlen(input);
|
||||||
char *clone;
|
char *clone;
|
||||||
size_t clen = inlen; /* the length of the cloned input */
|
size_t clen = inlen; /* the length of the cloned input */
|
||||||
char *out = malloc(inlen+1);
|
char *out = malloc(inlen + 1);
|
||||||
char *outptr;
|
char *outptr;
|
||||||
char *orgclone;
|
char *orgclone;
|
||||||
char *queryp;
|
char *queryp;
|
||||||
@ -172,7 +172,7 @@ char *Curl_dedotdotify(const char *input)
|
|||||||
from the correct index. */
|
from the correct index. */
|
||||||
size_t oindex = queryp - orgclone;
|
size_t oindex = queryp - orgclone;
|
||||||
qlen = strlen(&input[oindex]);
|
qlen = strlen(&input[oindex]);
|
||||||
memcpy(outptr, &input[oindex], qlen+1); /* include the ending zero byte */
|
memcpy(outptr, &input[oindex], qlen + 1); /* include the end zero byte */
|
||||||
}
|
}
|
||||||
|
|
||||||
free(orgclone);
|
free(orgclone);
|
||||||
|
@ -91,7 +91,7 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
|
|||||||
if(inlength < 0)
|
if(inlength < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
alloc = (inlength?(size_t)inlength:strlen(string))+1;
|
alloc = (inlength?(size_t)inlength:strlen(string)) + 1;
|
||||||
newlen = alloc;
|
newlen = alloc;
|
||||||
|
|
||||||
ns = malloc(alloc);
|
ns = malloc(alloc);
|
||||||
@ -148,7 +148,7 @@ CURLcode Curl_urldecode(struct Curl_easy *data,
|
|||||||
char **ostring, size_t *olen,
|
char **ostring, size_t *olen,
|
||||||
bool reject_ctrl)
|
bool reject_ctrl)
|
||||||
{
|
{
|
||||||
size_t alloc = (length?length:strlen(string))+1;
|
size_t alloc = (length?length:strlen(string)) + 1;
|
||||||
char *ns = malloc(alloc);
|
char *ns = malloc(alloc);
|
||||||
unsigned char in;
|
unsigned char in;
|
||||||
size_t strindex = 0;
|
size_t strindex = 0;
|
||||||
|
@ -165,7 +165,7 @@ static CURLcode file_range(struct connectdata *conn)
|
|||||||
else {
|
else {
|
||||||
/* X-Y */
|
/* X-Y */
|
||||||
totalsize = to-from;
|
totalsize = to-from;
|
||||||
data->req.maxdownload = totalsize+1; /* include last byte */
|
data->req.maxdownload = totalsize + 1; /* include last byte */
|
||||||
data->state.resume_from = from;
|
data->state.resume_from = from;
|
||||||
DEBUGF(infof(data, "RANGE from %" CURL_FORMAT_CURL_OFF_T
|
DEBUGF(infof(data, "RANGE from %" CURL_FORMAT_CURL_OFF_T
|
||||||
" getting %" CURL_FORMAT_CURL_OFF_T " bytes\n",
|
" getting %" CURL_FORMAT_CURL_OFF_T " bytes\n",
|
||||||
|
@ -644,7 +644,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||||||
/* copy name (without strdup; possibly contains null characters) */
|
/* copy name (without strdup; possibly contains null characters) */
|
||||||
form->name = Curl_memdup(form->name, form->namelength?
|
form->name = Curl_memdup(form->name, form->namelength?
|
||||||
form->namelength:
|
form->namelength:
|
||||||
strlen(form->name)+1);
|
strlen(form->name) + 1);
|
||||||
}
|
}
|
||||||
if(!form->name) {
|
if(!form->name) {
|
||||||
return_value = CURL_FORMADD_MEMORY;
|
return_value = CURL_FORMADD_MEMORY;
|
||||||
@ -658,7 +658,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||||||
/* copy value (without strdup; possibly contains null characters) */
|
/* copy value (without strdup; possibly contains null characters) */
|
||||||
size_t clen = (size_t) form->contentslength;
|
size_t clen = (size_t) form->contentslength;
|
||||||
if(!clen)
|
if(!clen)
|
||||||
clen = strlen(form->value)+1;
|
clen = strlen(form->value) + 1;
|
||||||
|
|
||||||
form->value = Curl_memdup(form->value, clen);
|
form->value = Curl_memdup(form->value, clen);
|
||||||
|
|
||||||
|
12
lib/ftp.c
12
lib/ftp.c
@ -975,7 +975,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
|||||||
char *port_start = NULL;
|
char *port_start = NULL;
|
||||||
char *port_sep = NULL;
|
char *port_sep = NULL;
|
||||||
|
|
||||||
addr = calloc(addrlen+1, 1);
|
addr = calloc(addrlen + 1, 1);
|
||||||
if(!addr)
|
if(!addr)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
@ -1018,7 +1018,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
|||||||
if(ip_end != NULL) {
|
if(ip_end != NULL) {
|
||||||
port_start = strchr(ip_end, ':');
|
port_start = strchr(ip_end, ':');
|
||||||
if(port_start) {
|
if(port_start) {
|
||||||
port_min = curlx_ultous(strtoul(port_start+1, NULL, 10));
|
port_min = curlx_ultous(strtoul(port_start + 1, NULL, 10));
|
||||||
port_sep = strchr(port_start, '-');
|
port_sep = strchr(port_start, '-');
|
||||||
if(port_sep) {
|
if(port_sep) {
|
||||||
port_max = curlx_ultous(strtoul(port_sep + 1, NULL, 10));
|
port_max = curlx_ultous(strtoul(port_sep + 1, NULL, 10));
|
||||||
@ -1474,7 +1474,7 @@ static CURLcode ftp_state_list(struct connectdata *conn)
|
|||||||
/* chop off the file part if format is dir/dir/file */
|
/* chop off the file part if format is dir/dir/file */
|
||||||
slashPos = strrchr(lstArg, '/');
|
slashPos = strrchr(lstArg, '/');
|
||||||
if(slashPos)
|
if(slashPos)
|
||||||
*(slashPos+1) = '\0';
|
*(slashPos + 1) = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2266,7 +2266,7 @@ static CURLcode ftp_state_size_resp(struct connectdata *conn,
|
|||||||
/* get the size from the ascii string: */
|
/* get the size from the ascii string: */
|
||||||
if(ftpcode == 213)
|
if(ftpcode == 213)
|
||||||
/* ignores parsing errors, which will make the size remain unknown */
|
/* ignores parsing errors, which will make the size remain unknown */
|
||||||
(void)curlx_strtoofft(buf+4, NULL, 0, &filesize);
|
(void)curlx_strtoofft(buf + 4, NULL, 0, &filesize);
|
||||||
|
|
||||||
if(instate == FTP_SIZE) {
|
if(instate == FTP_SIZE) {
|
||||||
#ifdef CURL_FTP_HTTPSTYLE_HEAD
|
#ifdef CURL_FTP_HTTPSTYLE_HEAD
|
||||||
@ -3498,7 +3498,7 @@ static CURLcode ftp_range(struct connectdata *conn)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* X-Y */
|
/* X-Y */
|
||||||
data->req.maxdownload = (to-from)+1; /* include last byte */
|
data->req.maxdownload = (to - from) + 1; /* include last byte */
|
||||||
data->state.resume_from = from;
|
data->state.resume_from = from;
|
||||||
DEBUGF(infof(conn->data, "FTP RANGE from %" CURL_FORMAT_CURL_OFF_T
|
DEBUGF(infof(conn->data, "FTP RANGE from %" CURL_FORMAT_CURL_OFF_T
|
||||||
" getting %" CURL_FORMAT_CURL_OFF_T " bytes\n",
|
" getting %" CURL_FORMAT_CURL_OFF_T " bytes\n",
|
||||||
@ -4196,7 +4196,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
ftpc->dirdepth = 1; /* we consider it to be a single dir */
|
ftpc->dirdepth = 1; /* we consider it to be a single dir */
|
||||||
filename = slash_pos ? slash_pos+1 : cur_pos; /* rest is file name */
|
filename = slash_pos ? slash_pos + 1 : cur_pos; /* rest is file name */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
filename = cur_pos; /* this is a file name only */
|
filename = cur_pos; /* this is a file name only */
|
||||||
|
@ -421,7 +421,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
|
|||||||
else if(c == '\n') {
|
else if(c == '\n') {
|
||||||
finfo->b_data[parser->item_length - 1] = 0;
|
finfo->b_data[parser->item_length - 1] = 0;
|
||||||
if(strncmp("total ", finfo->b_data, 6) == 0) {
|
if(strncmp("total ", finfo->b_data, 6) == 0) {
|
||||||
char *endptr = finfo->b_data+6;
|
char *endptr = finfo->b_data + 6;
|
||||||
/* here we can deal with directory size, pass the leading white
|
/* here we can deal with directory size, pass the leading white
|
||||||
spaces and then the digits */
|
spaces and then the digits */
|
||||||
while(ISSPACE(*endptr))
|
while(ISSPACE(*endptr))
|
||||||
@ -609,7 +609,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
|
|||||||
char *p;
|
char *p;
|
||||||
curl_off_t fsize;
|
curl_off_t fsize;
|
||||||
finfo->b_data[parser->item_offset + parser->item_length - 1] = 0;
|
finfo->b_data[parser->item_offset + parser->item_length - 1] = 0;
|
||||||
if(!curlx_strtoofft(finfo->b_data+parser->item_offset,
|
if(!curlx_strtoofft(finfo->b_data + parser->item_offset,
|
||||||
&p, 10, &fsize)) {
|
&p, 10, &fsize)) {
|
||||||
if(p[0] == '\0' && fsize != CURL_OFF_T_MAX &&
|
if(p[0] == '\0' && fsize != CURL_OFF_T_MAX &&
|
||||||
fsize != CURL_OFF_T_MIN) {
|
fsize != CURL_OFF_T_MIN) {
|
||||||
|
@ -303,7 +303,7 @@ Curl_hash_next_element(struct curl_hash_iterator *iter)
|
|||||||
for(i = iter->slot_index;i < h->slots;i++) {
|
for(i = iter->slot_index;i < h->slots;i++) {
|
||||||
if(h->table[i].head) {
|
if(h->table[i].head) {
|
||||||
iter->current_element = h->table[i].head;
|
iter->current_element = h->table[i].head;
|
||||||
iter->slot_index = i+1;
|
iter->slot_index = i + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ static int hostmatch(char *hostname, char *pattern)
|
|||||||
match. */
|
match. */
|
||||||
wildcard_enabled = 1;
|
wildcard_enabled = 1;
|
||||||
pattern_label_end = strchr(pattern, '.');
|
pattern_label_end = strchr(pattern, '.');
|
||||||
if(pattern_label_end == NULL || strchr(pattern_label_end+1, '.') == NULL ||
|
if(pattern_label_end == NULL || strchr(pattern_label_end + 1, '.') == NULL ||
|
||||||
pattern_wildcard > pattern_label_end ||
|
pattern_wildcard > pattern_label_end ||
|
||||||
strncasecompare(pattern, "xn--", 4)) {
|
strncasecompare(pattern, "xn--", 4)) {
|
||||||
wildcard_enabled = 0;
|
wildcard_enabled = 0;
|
||||||
@ -116,9 +116,9 @@ static int hostmatch(char *hostname, char *pattern)
|
|||||||
return CURL_HOST_NOMATCH;
|
return CURL_HOST_NOMATCH;
|
||||||
|
|
||||||
prefixlen = pattern_wildcard - pattern;
|
prefixlen = pattern_wildcard - pattern;
|
||||||
suffixlen = pattern_label_end - (pattern_wildcard+1);
|
suffixlen = pattern_label_end - (pattern_wildcard + 1);
|
||||||
return strncasecompare(pattern, hostname, prefixlen) &&
|
return strncasecompare(pattern, hostname, prefixlen) &&
|
||||||
strncasecompare(pattern_wildcard+1, hostname_label_end - suffixlen,
|
strncasecompare(pattern_wildcard + 1, hostname_label_end - suffixlen,
|
||||||
suffixlen) ?
|
suffixlen) ?
|
||||||
CURL_HOST_MATCH : CURL_HOST_NOMATCH;
|
CURL_HOST_MATCH : CURL_HOST_NOMATCH;
|
||||||
}
|
}
|
||||||
|
10
lib/hostip.c
10
lib/hostip.c
@ -304,7 +304,7 @@ fetch_addr(struct connectdata *conn,
|
|||||||
entry_len = strlen(entry_id);
|
entry_len = strlen(entry_id);
|
||||||
|
|
||||||
/* See if its already in our dns cache */
|
/* See if its already in our dns cache */
|
||||||
dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len+1);
|
dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1);
|
||||||
|
|
||||||
if(dns && (data->set.dns_cache_timeout != -1)) {
|
if(dns && (data->set.dns_cache_timeout != -1)) {
|
||||||
/* See whether the returned entry is stale. Done before we release lock */
|
/* See whether the returned entry is stale. Done before we release lock */
|
||||||
@ -316,7 +316,7 @@ fetch_addr(struct connectdata *conn,
|
|||||||
if(hostcache_timestamp_remove(&user, dns)) {
|
if(hostcache_timestamp_remove(&user, dns)) {
|
||||||
infof(data, "Hostname in DNS cache was stale, zapped\n");
|
infof(data, "Hostname in DNS cache was stale, zapped\n");
|
||||||
dns = NULL; /* the memory deallocation is being handled by the hash */
|
dns = NULL; /* the memory deallocation is being handled by the hash */
|
||||||
Curl_hash_delete(data->dns.hostcache, entry_id, entry_len+1);
|
Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,7 +403,7 @@ Curl_cache_addr(struct Curl_easy *data,
|
|||||||
dns->timestamp = 1; /* zero indicates CURLOPT_RESOLVE entry */
|
dns->timestamp = 1; /* zero indicates CURLOPT_RESOLVE entry */
|
||||||
|
|
||||||
/* Store the resolved data in our DNS cache. */
|
/* Store the resolved data in our DNS cache. */
|
||||||
dns2 = Curl_hash_add(data->dns.hostcache, entry_id, entry_len+1,
|
dns2 = Curl_hash_add(data->dns.hostcache, entry_id, entry_len + 1,
|
||||||
(void *)dns);
|
(void *)dns);
|
||||||
if(!dns2) {
|
if(!dns2) {
|
||||||
free(dns);
|
free(dns);
|
||||||
@ -807,7 +807,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data)
|
|||||||
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
||||||
|
|
||||||
/* delete entry, ignore if it didn't exist */
|
/* delete entry, ignore if it didn't exist */
|
||||||
Curl_hash_delete(data->dns.hostcache, entry_id, entry_len+1);
|
Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1);
|
||||||
|
|
||||||
if(data->share)
|
if(data->share)
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||||
@ -848,7 +848,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data)
|
|||||||
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
||||||
|
|
||||||
/* See if its already in our dns cache */
|
/* See if its already in our dns cache */
|
||||||
dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len+1);
|
dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1);
|
||||||
|
|
||||||
/* free the allocated entry_id again */
|
/* free the allocated entry_id again */
|
||||||
free(entry_id);
|
free(entry_id);
|
||||||
|
@ -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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -249,7 +249,7 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if(CURL_HOSTENT_SIZE >=
|
if(CURL_HOSTENT_SIZE >=
|
||||||
(sizeof(struct hostent)+sizeof(struct hostent_data))) {
|
(sizeof(struct hostent) + sizeof(struct hostent_data))) {
|
||||||
|
|
||||||
/* August 22nd, 2000: Albert Chin-A-Young brought an updated version
|
/* August 22nd, 2000: Albert Chin-A-Young brought an updated version
|
||||||
* that should work! September 20: Richard Prescott worked on the buffer
|
* that should work! September 20: Richard Prescott worked on the buffer
|
||||||
|
20
lib/http.c
20
lib/http.c
@ -1132,7 +1132,7 @@ CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
|||||||
/* there was body data sent beyond the initial header part, pass that
|
/* there was body data sent beyond the initial header part, pass that
|
||||||
on to the debug callback too */
|
on to the debug callback too */
|
||||||
Curl_debug(conn->data, CURLINFO_DATA_OUT,
|
Curl_debug(conn->data, CURLINFO_DATA_OUT,
|
||||||
ptr+headlen, bodylen, conn);
|
ptr + headlen, bodylen, conn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1244,7 +1244,7 @@ CURLcode Curl_add_buffer(Curl_send_buffer *in, const void *inptr, size_t size)
|
|||||||
(~(size * 2) < (in->size_used * 2)))
|
(~(size * 2) < (in->size_used * 2)))
|
||||||
new_size = (size_t)-1;
|
new_size = (size_t)-1;
|
||||||
else
|
else
|
||||||
new_size = (in->size_used+size) * 2;
|
new_size = (in->size_used + size) * 2;
|
||||||
|
|
||||||
if(in->buffer)
|
if(in->buffer)
|
||||||
/* we have a buffer, enlarge the existing one */
|
/* we have a buffer, enlarge the existing one */
|
||||||
@ -2788,7 +2788,7 @@ checkhttpprefix(struct Curl_easy *data,
|
|||||||
failf(data, "Failed to allocate memory for conversion!");
|
failf(data, "Failed to allocate memory for conversion!");
|
||||||
return FALSE; /* can't return CURLE_OUT_OF_MEMORY so return FALSE */
|
return FALSE; /* can't return CURLE_OUT_OF_MEMORY so return FALSE */
|
||||||
}
|
}
|
||||||
if(CURLE_OK != Curl_convert_from_network(data, scratch, strlen(s)+1)) {
|
if(CURLE_OK != Curl_convert_from_network(data, scratch, strlen(s) + 1)) {
|
||||||
/* Curl_convert_from_network calls failf if unsuccessful */
|
/* Curl_convert_from_network calls failf if unsuccessful */
|
||||||
free(scratch);
|
free(scratch);
|
||||||
return FALSE; /* can't return CURLE_foobar so return FALSE */
|
return FALSE; /* can't return CURLE_foobar so return FALSE */
|
||||||
@ -2827,7 +2827,7 @@ checkrtspprefix(struct Curl_easy *data,
|
|||||||
failf(data, "Failed to allocate memory for conversion!");
|
failf(data, "Failed to allocate memory for conversion!");
|
||||||
return FALSE; /* can't return CURLE_OUT_OF_MEMORY so return FALSE */
|
return FALSE; /* can't return CURLE_OUT_OF_MEMORY so return FALSE */
|
||||||
}
|
}
|
||||||
if(CURLE_OK != Curl_convert_from_network(data, scratch, strlen(s)+1)) {
|
if(CURLE_OK != Curl_convert_from_network(data, scratch, strlen(s) + 1)) {
|
||||||
/* Curl_convert_from_network calls failf if unsuccessful */
|
/* Curl_convert_from_network calls failf if unsuccessful */
|
||||||
result = FALSE; /* can't return CURLE_foobar so return FALSE */
|
result = FALSE; /* can't return CURLE_foobar so return FALSE */
|
||||||
}
|
}
|
||||||
@ -2881,7 +2881,7 @@ static CURLcode header_append(struct Curl_easy *data,
|
|||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
newsize = CURLMAX((k->hbuflen+ length)*3/2, data->state.headersize*2);
|
newsize = CURLMAX((k->hbuflen + length) * 3 / 2, data->state.headersize*2);
|
||||||
hbufp_index = k->hbufp - data->state.headerbuff;
|
hbufp_index = k->hbufp - data->state.headerbuff;
|
||||||
newbuff = realloc(data->state.headerbuff, newsize);
|
newbuff = realloc(data->state.headerbuff, newsize);
|
||||||
if(!newbuff) {
|
if(!newbuff) {
|
||||||
@ -2981,7 +2981,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* decrease the size of the remaining (supposed) header line */
|
/* decrease the size of the remaining (supposed) header line */
|
||||||
rest_length = (k->end_ptr - k->str)+1;
|
rest_length = (k->end_ptr - k->str) + 1;
|
||||||
*nread -= (ssize_t)rest_length;
|
*nread -= (ssize_t)rest_length;
|
||||||
|
|
||||||
k->str = k->end_ptr + 1; /* move past new line */
|
k->str = k->end_ptr + 1; /* move past new line */
|
||||||
@ -3308,7 +3308,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
|
|||||||
#define HEADER1 scratch
|
#define HEADER1 scratch
|
||||||
#define SCRATCHSIZE 21
|
#define SCRATCHSIZE 21
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
char scratch[SCRATCHSIZE+1]; /* "HTTP/major.minor 123" */
|
char scratch[SCRATCHSIZE + 1]; /* "HTTP/major.minor 123" */
|
||||||
/* We can't really convert this yet because we
|
/* We can't really convert this yet because we
|
||||||
don't know if it's the 1st header line or the body.
|
don't know if it's the 1st header line or the body.
|
||||||
So we do a partial conversion into a scratch area,
|
So we do a partial conversion into a scratch area,
|
||||||
@ -3499,7 +3499,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
|
|||||||
if(!k->ignorecl && !data->set.ignorecl &&
|
if(!k->ignorecl && !data->set.ignorecl &&
|
||||||
checkprefix("Content-Length:", k->p)) {
|
checkprefix("Content-Length:", k->p)) {
|
||||||
curl_off_t contentlength;
|
curl_off_t contentlength;
|
||||||
if(!curlx_strtoofft(k->p+15, NULL, 10, &contentlength)) {
|
if(!curlx_strtoofft(k->p + 15, NULL, 10, &contentlength)) {
|
||||||
if(data->set.max_filesize &&
|
if(data->set.max_filesize &&
|
||||||
contentlength > data->set.max_filesize) {
|
contentlength > data->set.max_filesize) {
|
||||||
failf(data, "Maximum file size exceeded");
|
failf(data, "Maximum file size exceeded");
|
||||||
@ -3713,7 +3713,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
|
|||||||
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE,
|
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE,
|
||||||
CURL_LOCK_ACCESS_SINGLE);
|
CURL_LOCK_ACCESS_SINGLE);
|
||||||
Curl_cookie_add(data,
|
Curl_cookie_add(data,
|
||||||
data->cookies, TRUE, k->p+11,
|
data->cookies, TRUE, k->p + 11,
|
||||||
/* If there is a custom-set Host: name, use it
|
/* If there is a custom-set Host: name, use it
|
||||||
here, or else use real peer host name. */
|
here, or else use real peer host name. */
|
||||||
conn->allocptr.cookiehost?
|
conn->allocptr.cookiehost?
|
||||||
@ -3725,7 +3725,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
|
|||||||
else if(checkprefix("Last-Modified:", k->p) &&
|
else if(checkprefix("Last-Modified:", k->p) &&
|
||||||
(data->set.timecondition || data->set.get_filetime) ) {
|
(data->set.timecondition || data->set.get_filetime) ) {
|
||||||
time_t secs = time(NULL);
|
time_t secs = time(NULL);
|
||||||
k->timeofdoc = curl_getdate(k->p+strlen("Last-Modified:"),
|
k->timeofdoc = curl_getdate(k->p + strlen("Last-Modified:"),
|
||||||
&secs);
|
&secs);
|
||||||
if(data->set.get_filetime)
|
if(data->set.get_filetime)
|
||||||
data->info.filetime = (long)k->timeofdoc;
|
data->info.filetime = (long)k->timeofdoc;
|
||||||
|
@ -389,7 +389,7 @@ char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header)
|
|||||||
/* sub-match, make sure that it is followed by a colon */
|
/* sub-match, make sure that it is followed by a colon */
|
||||||
if(stream->push_headers[i][len] != ':')
|
if(stream->push_headers[i][len] != ':')
|
||||||
continue;
|
continue;
|
||||||
return &stream->push_headers[i][len+1];
|
return &stream->push_headers[i][len + 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope,
|
|||||||
return IF2IP_NOT_FOUND;
|
return IF2IP_NOT_FOUND;
|
||||||
|
|
||||||
memset(&req, 0, sizeof(req));
|
memset(&req, 0, sizeof(req));
|
||||||
memcpy(req.ifr_name, interf, len+1);
|
memcpy(req.ifr_name, interf, len + 1);
|
||||||
req.ifr_addr.sa_family = AF_INET;
|
req.ifr_addr.sa_family = AF_INET;
|
||||||
|
|
||||||
if(ioctl(dummy, SIOCGIFADDR, &req) < 0) {
|
if(ioctl(dummy, SIOCGIFADDR, &req) < 0) {
|
||||||
|
@ -141,7 +141,7 @@ static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size)
|
|||||||
*/
|
*/
|
||||||
if(i == 6 && best.base == 0 &&
|
if(i == 6 && best.base == 0 &&
|
||||||
(best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
|
(best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
|
||||||
if(!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp))) {
|
if(!inet_ntop4(src + 12, tp, sizeof(tmp) - (tp - tmp))) {
|
||||||
errno = ENOSPC;
|
errno = ENOSPC;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ void *curl_domalloc(size_t wantedsize, int line, const char *source)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* alloc at least 64 bytes */
|
/* alloc at least 64 bytes */
|
||||||
size = sizeof(struct memdebug)+wantedsize;
|
size = sizeof(struct memdebug) + wantedsize;
|
||||||
|
|
||||||
mem = (Curl_cmalloc)(size);
|
mem = (Curl_cmalloc)(size);
|
||||||
if(mem) {
|
if(mem) {
|
||||||
@ -225,7 +225,7 @@ char *curl_dostrdup(const char *str, int line, const char *source)
|
|||||||
if(countcheck("strdup", line, source))
|
if(countcheck("strdup", line, source))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
len = strlen(str)+1;
|
len = strlen(str) + 1;
|
||||||
|
|
||||||
mem = curl_domalloc(len, 0, NULL); /* NULL prevents logging */
|
mem = curl_domalloc(len, 0, NULL); /* NULL prevents logging */
|
||||||
if(mem)
|
if(mem)
|
||||||
@ -271,7 +271,7 @@ void *curl_dorealloc(void *ptr, size_t wantedsize,
|
|||||||
{
|
{
|
||||||
struct memdebug *mem = NULL;
|
struct memdebug *mem = NULL;
|
||||||
|
|
||||||
size_t size = sizeof(struct memdebug)+wantedsize;
|
size_t size = sizeof(struct memdebug) + wantedsize;
|
||||||
|
|
||||||
DEBUGASSERT(wantedsize != 0);
|
DEBUGASSERT(wantedsize != 0);
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ static char *Curl_basename(char *path)
|
|||||||
s2 = strrchr(path, '\\');
|
s2 = strrchr(path, '\\');
|
||||||
|
|
||||||
if(s1 && s2) {
|
if(s1 && s2) {
|
||||||
path = (s1 > s2? s1 : s2)+1;
|
path = (s1 > s2? s1 : s2) + 1;
|
||||||
}
|
}
|
||||||
else if(s1)
|
else if(s1)
|
||||||
path = s1 + 1;
|
path = s1 + 1;
|
||||||
|
@ -1040,7 +1040,7 @@ static int alloc_addbyter(int output, FILE *data)
|
|||||||
infop->alloc = 32;
|
infop->alloc = 32;
|
||||||
infop->len = 0;
|
infop->len = 0;
|
||||||
}
|
}
|
||||||
else if(infop->len+1 >= infop->alloc) {
|
else if(infop->len + 1 >= infop->alloc) {
|
||||||
char *newptr = NULL;
|
char *newptr = NULL;
|
||||||
size_t newsize = infop->alloc*2;
|
size_t newsize = infop->alloc*2;
|
||||||
|
|
||||||
|
@ -1231,7 +1231,7 @@ static void do_complete(struct connectdata *conn)
|
|||||||
{
|
{
|
||||||
conn->data->req.chunk = FALSE;
|
conn->data->req.chunk = FALSE;
|
||||||
conn->data->req.maxfd = (conn->sockfd>conn->writesockfd?
|
conn->data->req.maxfd = (conn->sockfd>conn->writesockfd?
|
||||||
conn->sockfd:conn->writesockfd)+1;
|
conn->sockfd:conn->writesockfd) + 1;
|
||||||
Curl_pgrsTime(conn->data, TIMER_PRETRANSFER);
|
Curl_pgrsTime(conn->data, TIMER_PRETRANSFER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ static CURLcode ldap_connect(struct connectdata *conn, bool *done)
|
|||||||
(void)done;
|
(void)done;
|
||||||
|
|
||||||
strcpy(hosturl, "ldap");
|
strcpy(hosturl, "ldap");
|
||||||
ptr = hosturl+4;
|
ptr = hosturl + 4;
|
||||||
if(conn->handler->flags & PROTOPT_SSL)
|
if(conn->handler->flags & PROTOPT_SSL)
|
||||||
*ptr++ = 's';
|
*ptr++ = 's';
|
||||||
snprintf(ptr, sizeof(hosturl)-(ptr-hosturl), "://%s:%d",
|
snprintf(ptr, sizeof(hosturl)-(ptr-hosturl), "://%s:%d",
|
||||||
|
@ -167,20 +167,20 @@ static const struct tzinfo tz[]= {
|
|||||||
RFC 1123) had their signs wrong. Here we use the correct signs to match
|
RFC 1123) had their signs wrong. Here we use the correct signs to match
|
||||||
actual military usage.
|
actual military usage.
|
||||||
*/
|
*/
|
||||||
{"A", +1 * 60}, /* Alpha */
|
{"A", 1 * 60}, /* Alpha */
|
||||||
{"B", +2 * 60}, /* Bravo */
|
{"B", 2 * 60}, /* Bravo */
|
||||||
{"C", +3 * 60}, /* Charlie */
|
{"C", 3 * 60}, /* Charlie */
|
||||||
{"D", +4 * 60}, /* Delta */
|
{"D", 4 * 60}, /* Delta */
|
||||||
{"E", +5 * 60}, /* Echo */
|
{"E", 5 * 60}, /* Echo */
|
||||||
{"F", +6 * 60}, /* Foxtrot */
|
{"F", 6 * 60}, /* Foxtrot */
|
||||||
{"G", +7 * 60}, /* Golf */
|
{"G", 7 * 60}, /* Golf */
|
||||||
{"H", +8 * 60}, /* Hotel */
|
{"H", 8 * 60}, /* Hotel */
|
||||||
{"I", +9 * 60}, /* India */
|
{"I", 9 * 60}, /* India */
|
||||||
/* "J", Juliet is not used as a timezone, to indicate the observer's local
|
/* "J", Juliet is not used as a timezone, to indicate the observer's local
|
||||||
time */
|
time */
|
||||||
{"K", +10 * 60}, /* Kilo */
|
{"K", 10 * 60}, /* Kilo */
|
||||||
{"L", +11 * 60}, /* Lima */
|
{"L", 11 * 60}, /* Lima */
|
||||||
{"M", +12 * 60}, /* Mike */
|
{"M", 12 * 60}, /* Mike */
|
||||||
{"N", -1 * 60}, /* November */
|
{"N", -1 * 60}, /* November */
|
||||||
{"O", -2 * 60}, /* Oscar */
|
{"O", -2 * 60}, /* Oscar */
|
||||||
{"P", -3 * 60}, /* Papa */
|
{"P", -3 * 60}, /* Papa */
|
||||||
|
@ -297,7 +297,7 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
|
|||||||
* it would have been populated with something of size int to begin
|
* it would have been populated with something of size int to begin
|
||||||
* with, even though its datatype may be larger than an int.
|
* with, even though its datatype may be larger than an int.
|
||||||
*/
|
*/
|
||||||
DEBUGASSERT((ptr+pp->cache_size) <= (buf+data->set.buffer_size+1));
|
DEBUGASSERT((ptr + pp->cache_size) <= (buf + data->set.buffer_size + 1));
|
||||||
memcpy(ptr, pp->cache, pp->cache_size);
|
memcpy(ptr, pp->cache, pp->cache_size);
|
||||||
gotbytes = (ssize_t)pp->cache_size;
|
gotbytes = (ssize_t)pp->cache_size;
|
||||||
free(pp->cache); /* free the cache */
|
free(pp->cache); /* free the cache */
|
||||||
@ -380,7 +380,7 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
|
|||||||
memmove(buf, pp->linestart_resp, n);
|
memmove(buf, pp->linestart_resp, n);
|
||||||
buf[n] = 0; /* zero terminate */
|
buf[n] = 0; /* zero terminate */
|
||||||
keepon = FALSE;
|
keepon = FALSE;
|
||||||
pp->linestart_resp = ptr+1; /* advance pointer */
|
pp->linestart_resp = ptr + 1; /* advance pointer */
|
||||||
i++; /* skip this before getting out */
|
i++; /* skip this before getting out */
|
||||||
|
|
||||||
*size = pp->nread_resp; /* size of the response */
|
*size = pp->nread_resp; /* size of the response */
|
||||||
@ -388,7 +388,7 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
perline = 0; /* line starts over here */
|
perline = 0; /* line starts over here */
|
||||||
pp->linestart_resp = ptr+1;
|
pp->linestart_resp = ptr + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ static size_t convert_lineends(struct Curl_easy *data,
|
|||||||
if(*startPtr == '\n') {
|
if(*startPtr == '\n') {
|
||||||
/* This block of incoming data starts with the
|
/* This block of incoming data starts with the
|
||||||
previous block's LF so get rid of it */
|
previous block's LF so get rid of it */
|
||||||
memmove(startPtr, startPtr+1, size-1);
|
memmove(startPtr, startPtr + 1, size-1);
|
||||||
size--;
|
size--;
|
||||||
/* and it wasn't a bare CR but a CRLF conversion instead */
|
/* and it wasn't a bare CR but a CRLF conversion instead */
|
||||||
data->state.crlf_conversions++;
|
data->state.crlf_conversions++;
|
||||||
@ -75,7 +75,7 @@ static size_t convert_lineends(struct Curl_easy *data,
|
|||||||
inPtr = outPtr = memchr(startPtr, '\r', size);
|
inPtr = outPtr = memchr(startPtr, '\r', size);
|
||||||
if(inPtr) {
|
if(inPtr) {
|
||||||
/* at least one CR, now look for CRLF */
|
/* at least one CR, now look for CRLF */
|
||||||
while(inPtr < (startPtr+size-1)) {
|
while(inPtr < (startPtr + size-1)) {
|
||||||
/* note that it's size-1, so we'll never look past the last byte */
|
/* note that it's size-1, so we'll never look past the last byte */
|
||||||
if(memcmp(inPtr, "\r\n", 2) == 0) {
|
if(memcmp(inPtr, "\r\n", 2) == 0) {
|
||||||
/* CRLF found, bump past the CR and copy the NL */
|
/* CRLF found, bump past the CR and copy the NL */
|
||||||
@ -98,7 +98,7 @@ static size_t convert_lineends(struct Curl_easy *data,
|
|||||||
inPtr++;
|
inPtr++;
|
||||||
} /* end of while loop */
|
} /* end of while loop */
|
||||||
|
|
||||||
if(inPtr < startPtr+size) {
|
if(inPtr < startPtr + size) {
|
||||||
/* handle last byte */
|
/* handle last byte */
|
||||||
if(*inPtr == '\r') {
|
if(*inPtr == '\r') {
|
||||||
/* deal with a CR at the end of the buffer */
|
/* deal with a CR at the end of the buffer */
|
||||||
@ -112,7 +112,7 @@ static size_t convert_lineends(struct Curl_easy *data,
|
|||||||
}
|
}
|
||||||
outPtr++;
|
outPtr++;
|
||||||
}
|
}
|
||||||
if(outPtr < startPtr+size)
|
if(outPtr < startPtr + size)
|
||||||
/* tidy up by null terminating the now shorter data */
|
/* tidy up by null terminating the now shorter data */
|
||||||
*outPtr = '\0';
|
*outPtr = '\0';
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ CURLcode Curl_SOCKS4(const char *proxy_user,
|
|||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
}
|
}
|
||||||
/* copy the proxy name WITH trailing zero */
|
/* copy the proxy name WITH trailing zero */
|
||||||
memcpy(socksreq + 8, proxy_user, plen+1);
|
memcpy(socksreq + 8, proxy_user, plen + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -65,7 +65,7 @@ static int check_gss_err(struct Curl_easy *data,
|
|||||||
&msg_ctx, &status_string);
|
&msg_ctx, &status_string);
|
||||||
if(maj_stat == GSS_S_COMPLETE) {
|
if(maj_stat == GSS_S_COMPLETE) {
|
||||||
if(sizeof(buf) > len + status_string.length + 1) {
|
if(sizeof(buf) > len + status_string.length + 1) {
|
||||||
strcpy(buf+len, (char *) status_string.value);
|
strcpy(buf + len, (char *) status_string.value);
|
||||||
len += status_string.length;
|
len += status_string.length;
|
||||||
}
|
}
|
||||||
gss_release_buffer(&min_stat, &status_string);
|
gss_release_buffer(&min_stat, &status_string);
|
||||||
@ -74,7 +74,7 @@ static int check_gss_err(struct Curl_easy *data,
|
|||||||
gss_release_buffer(&min_stat, &status_string);
|
gss_release_buffer(&min_stat, &status_string);
|
||||||
}
|
}
|
||||||
if(sizeof(buf) > len + 3) {
|
if(sizeof(buf) > len + 3) {
|
||||||
strcpy(buf+len, ".\n");
|
strcpy(buf + len, ".\n");
|
||||||
len += 2;
|
len += 2;
|
||||||
}
|
}
|
||||||
msg_ctx = 0;
|
msg_ctx = 0;
|
||||||
@ -86,7 +86,7 @@ static int check_gss_err(struct Curl_easy *data,
|
|||||||
&msg_ctx, &status_string);
|
&msg_ctx, &status_string);
|
||||||
if(maj_stat == GSS_S_COMPLETE) {
|
if(maj_stat == GSS_S_COMPLETE) {
|
||||||
if(sizeof(buf) > len + status_string.length)
|
if(sizeof(buf) > len + status_string.length)
|
||||||
strcpy(buf+len, (char *) status_string.value);
|
strcpy(buf + len, (char *) status_string.value);
|
||||||
gss_release_buffer(&min_stat, &status_string);
|
gss_release_buffer(&min_stat, &status_string);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -146,11 +146,12 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
service.value = malloc(serviceptr_length +
|
service.value = malloc(serviceptr_length +
|
||||||
strlen(conn->socks_proxy.host.name)+2);
|
strlen(conn->socks_proxy.host.name) + 2);
|
||||||
if(!service.value)
|
if(!service.value)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
service.length = serviceptr_length + strlen(conn->socks_proxy.host.name)+1;
|
service.length = serviceptr_length +
|
||||||
snprintf(service.value, service.length+1, "%s@%s",
|
strlen(conn->socks_proxy.host.name) + 1;
|
||||||
|
snprintf(service.value, service.length + 1, "%s@%s",
|
||||||
serviceptr, conn->socks_proxy.host.name);
|
serviceptr, conn->socks_proxy.host.name);
|
||||||
|
|
||||||
gss_major_status = gss_import_name(&gss_minor_status, &service,
|
gss_major_status = gss_import_name(&gss_minor_status, &service,
|
||||||
@ -196,7 +197,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
socksreq[0] = 1; /* GSS-API subnegotiation version */
|
socksreq[0] = 1; /* GSS-API subnegotiation version */
|
||||||
socksreq[1] = 1; /* authentication message type */
|
socksreq[1] = 1; /* authentication message type */
|
||||||
us_length = htons((short)gss_send_token.length);
|
us_length = htons((short)gss_send_token.length);
|
||||||
memcpy(socksreq+2, &us_length, sizeof(short));
|
memcpy(socksreq + 2, &us_length, sizeof(short));
|
||||||
|
|
||||||
code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written);
|
code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written);
|
||||||
if(code || (4 != written)) {
|
if(code || (4 != written)) {
|
||||||
@ -261,7 +262,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&us_length, socksreq+2, sizeof(short));
|
memcpy(&us_length, socksreq + 2, sizeof(short));
|
||||||
us_length = ntohs(us_length);
|
us_length = ntohs(us_length);
|
||||||
|
|
||||||
gss_recv_token.length = us_length;
|
gss_recv_token.length = us_length;
|
||||||
@ -312,7 +313,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
failf(data, "Failed to determine user name.");
|
failf(data, "Failed to determine user name.");
|
||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
}
|
}
|
||||||
user = malloc(gss_send_token.length+1);
|
user = malloc(gss_send_token.length + 1);
|
||||||
if(!user) {
|
if(!user) {
|
||||||
gss_delete_sec_context(&gss_status, &gss_context, NULL);
|
gss_delete_sec_context(&gss_status, &gss_context, NULL);
|
||||||
gss_release_name(&gss_status, &gss_client_name);
|
gss_release_name(&gss_status, &gss_client_name);
|
||||||
@ -376,7 +377,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
*/
|
*/
|
||||||
if(data->set.socks5_gssapi_nec) {
|
if(data->set.socks5_gssapi_nec) {
|
||||||
us_length = htons((short)1);
|
us_length = htons((short)1);
|
||||||
memcpy(socksreq+2, &us_length, sizeof(short));
|
memcpy(socksreq + 2, &us_length, sizeof(short));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gss_send_token.length = 1;
|
gss_send_token.length = 1;
|
||||||
@ -401,7 +402,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
gss_release_buffer(&gss_status, &gss_send_token);
|
gss_release_buffer(&gss_status, &gss_send_token);
|
||||||
|
|
||||||
us_length = htons((short)gss_w_token.length);
|
us_length = htons((short)gss_w_token.length);
|
||||||
memcpy(socksreq+2, &us_length, sizeof(short));
|
memcpy(socksreq + 2, &us_length, sizeof(short));
|
||||||
}
|
}
|
||||||
|
|
||||||
code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written);
|
code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written);
|
||||||
@ -455,7 +456,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&us_length, socksreq+2, sizeof(short));
|
memcpy(&us_length, socksreq + 2, sizeof(short));
|
||||||
us_length = ntohs(us_length);
|
us_length = ntohs(us_length);
|
||||||
|
|
||||||
gss_recv_token.length = us_length;
|
gss_recv_token.length = us_length;
|
||||||
|
@ -108,7 +108,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
if(!service_name)
|
if(!service_name)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
snprintf(service_name, service_length +
|
snprintf(service_name, service_length +
|
||||||
strlen(conn->socks_proxy.host.name)+2, "%s/%s",
|
strlen(conn->socks_proxy.host.name) + 2, "%s/%s",
|
||||||
service, conn->socks_proxy.host.name);
|
service, conn->socks_proxy.host.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
socksreq[0] = 1; /* GSS-API subnegotiation version */
|
socksreq[0] = 1; /* GSS-API subnegotiation version */
|
||||||
socksreq[1] = 1; /* authentication message type */
|
socksreq[1] = 1; /* authentication message type */
|
||||||
us_length = htons((short)sspi_send_token.cbBuffer);
|
us_length = htons((short)sspi_send_token.cbBuffer);
|
||||||
memcpy(socksreq+2, &us_length, sizeof(short));
|
memcpy(socksreq + 2, &us_length, sizeof(short));
|
||||||
|
|
||||||
code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written);
|
code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written);
|
||||||
if(code || (4 != written)) {
|
if(code || (4 != written)) {
|
||||||
@ -283,7 +283,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&us_length, socksreq+2, sizeof(short));
|
memcpy(&us_length, socksreq + 2, sizeof(short));
|
||||||
us_length = ntohs(us_length);
|
us_length = ntohs(us_length);
|
||||||
|
|
||||||
sspi_recv_token.cbBuffer = us_length;
|
sspi_recv_token.cbBuffer = us_length;
|
||||||
@ -377,7 +377,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
|
|
||||||
if(data->set.socks5_gssapi_nec) {
|
if(data->set.socks5_gssapi_nec) {
|
||||||
us_length = htons((short)1);
|
us_length = htons((short)1);
|
||||||
memcpy(socksreq+2, &us_length, sizeof(short));
|
memcpy(socksreq + 2, &us_length, sizeof(short));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
status = s_pSecFn->QueryContextAttributes(&sspi_context,
|
status = s_pSecFn->QueryContextAttributes(&sspi_context,
|
||||||
@ -445,8 +445,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
memcpy((PUCHAR) sspi_send_token.pvBuffer +(int)sspi_w_token[0].cbBuffer,
|
memcpy((PUCHAR) sspi_send_token.pvBuffer +(int)sspi_w_token[0].cbBuffer,
|
||||||
sspi_w_token[1].pvBuffer, sspi_w_token[1].cbBuffer);
|
sspi_w_token[1].pvBuffer, sspi_w_token[1].cbBuffer);
|
||||||
memcpy((PUCHAR) sspi_send_token.pvBuffer
|
memcpy((PUCHAR) sspi_send_token.pvBuffer
|
||||||
+sspi_w_token[0].cbBuffer
|
+ sspi_w_token[0].cbBuffer
|
||||||
+sspi_w_token[1].cbBuffer,
|
+ sspi_w_token[1].cbBuffer,
|
||||||
sspi_w_token[2].pvBuffer, sspi_w_token[2].cbBuffer);
|
sspi_w_token[2].pvBuffer, sspi_w_token[2].cbBuffer);
|
||||||
|
|
||||||
s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer);
|
s_pSecFn->FreeContextBuffer(sspi_w_token[0].pvBuffer);
|
||||||
@ -460,7 +460,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
sspi_w_token[2].cbBuffer = 0;
|
sspi_w_token[2].cbBuffer = 0;
|
||||||
|
|
||||||
us_length = htons((short)sspi_send_token.cbBuffer);
|
us_length = htons((short)sspi_send_token.cbBuffer);
|
||||||
memcpy(socksreq+2, &us_length, sizeof(short));
|
memcpy(socksreq + 2, &us_length, sizeof(short));
|
||||||
}
|
}
|
||||||
|
|
||||||
code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written);
|
code = Curl_write_plain(conn, sock, (char *)socksreq, 4, &written);
|
||||||
@ -517,7 +517,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
|
|||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&us_length, socksreq+2, sizeof(short));
|
memcpy(&us_length, socksreq + 2, sizeof(short));
|
||||||
us_length = ntohs(us_length);
|
us_length = ntohs(us_length);
|
||||||
|
|
||||||
sspi_w_token[0].cbBuffer = us_length;
|
sspi_w_token[0].cbBuffer = us_length;
|
||||||
|
20
lib/ssh.c
20
lib/ssh.c
@ -428,14 +428,14 @@ static CURLcode ssh_getworkingpath(struct connectdata *conn,
|
|||||||
|
|
||||||
/* Check for /~/, indicating relative to the user's home directory */
|
/* Check for /~/, indicating relative to the user's home directory */
|
||||||
if(conn->handler->protocol & CURLPROTO_SCP) {
|
if(conn->handler->protocol & CURLPROTO_SCP) {
|
||||||
real_path = malloc(working_path_len+1);
|
real_path = malloc(working_path_len + 1);
|
||||||
if(real_path == NULL) {
|
if(real_path == NULL) {
|
||||||
free(working_path);
|
free(working_path);
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
if((working_path_len > 3) && (!memcmp(working_path, "/~/", 3)))
|
if((working_path_len > 3) && (!memcmp(working_path, "/~/", 3)))
|
||||||
/* It is referenced to the home directory, so strip the leading '/~/' */
|
/* It is referenced to the home directory, so strip the leading '/~/' */
|
||||||
memcpy(real_path, working_path+3, 4 + working_path_len-3);
|
memcpy(real_path, working_path + 3, 4 + working_path_len-3);
|
||||||
else
|
else
|
||||||
memcpy(real_path, working_path, 1 + working_path_len);
|
memcpy(real_path, working_path, 1 + working_path_len);
|
||||||
}
|
}
|
||||||
@ -451,19 +451,19 @@ static CURLcode ssh_getworkingpath(struct connectdata *conn,
|
|||||||
leading '/' */
|
leading '/' */
|
||||||
memcpy(real_path, homedir, homelen);
|
memcpy(real_path, homedir, homelen);
|
||||||
real_path[homelen] = '/';
|
real_path[homelen] = '/';
|
||||||
real_path[homelen+1] = '\0';
|
real_path[homelen + 1] = '\0';
|
||||||
if(working_path_len > 3) {
|
if(working_path_len > 3) {
|
||||||
memcpy(real_path+homelen+1, working_path + 3,
|
memcpy(real_path + homelen + 1, working_path + 3,
|
||||||
1 + working_path_len -3);
|
1 + working_path_len -3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
real_path = malloc(working_path_len+1);
|
real_path = malloc(working_path_len + 1);
|
||||||
if(real_path == NULL) {
|
if(real_path == NULL) {
|
||||||
free(working_path);
|
free(working_path);
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
memcpy(real_path, working_path, 1+working_path_len);
|
memcpy(real_path, working_path, 1 + working_path_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1983,13 +1983,13 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
sshc->actualcode = result?result:CURLE_SSH;
|
sshc->actualcode = result?result:CURLE_SSH;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sshc->readdir_filename = malloc(PATH_MAX+1);
|
sshc->readdir_filename = malloc(PATH_MAX + 1);
|
||||||
if(!sshc->readdir_filename) {
|
if(!sshc->readdir_filename) {
|
||||||
state(conn, SSH_SFTP_CLOSE);
|
state(conn, SSH_SFTP_CLOSE);
|
||||||
sshc->actualcode = CURLE_OUT_OF_MEMORY;
|
sshc->actualcode = CURLE_OUT_OF_MEMORY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sshc->readdir_longentry = malloc(PATH_MAX+1);
|
sshc->readdir_longentry = malloc(PATH_MAX + 1);
|
||||||
if(!sshc->readdir_longentry) {
|
if(!sshc->readdir_longentry) {
|
||||||
Curl_safefree(sshc->readdir_filename);
|
Curl_safefree(sshc->readdir_filename);
|
||||||
state(conn, SSH_SFTP_CLOSE);
|
state(conn, SSH_SFTP_CLOSE);
|
||||||
@ -2023,7 +2023,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
result = Curl_client_write(conn, CLIENTWRITE_BODY,
|
result = Curl_client_write(conn, CLIENTWRITE_BODY,
|
||||||
tmpLine, sshc->readdir_len+1);
|
tmpLine, sshc->readdir_len + 1);
|
||||||
free(tmpLine);
|
free(tmpLine);
|
||||||
|
|
||||||
if(result) {
|
if(result) {
|
||||||
@ -2032,7 +2032,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
}
|
}
|
||||||
/* since this counts what we send to the client, we include the
|
/* since this counts what we send to the client, we include the
|
||||||
newline in this counter */
|
newline in this counter */
|
||||||
data->req.bytecount += sshc->readdir_len+1;
|
data->req.bytecount += sshc->readdir_len + 1;
|
||||||
|
|
||||||
/* output debug output if that is requested */
|
/* output debug output if that is requested */
|
||||||
if(data->set.verbose) {
|
if(data->set.verbose) {
|
||||||
|
@ -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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -44,11 +44,11 @@ char *curlx_strdup(const char *str)
|
|||||||
if(len >= ((size_t)-1) / sizeof(char))
|
if(len >= ((size_t)-1) / sizeof(char))
|
||||||
return (char *)NULL;
|
return (char *)NULL;
|
||||||
|
|
||||||
newstr = malloc((len+1)*sizeof(char));
|
newstr = malloc((len + 1)*sizeof(char));
|
||||||
if(!newstr)
|
if(!newstr)
|
||||||
return (char *)NULL;
|
return (char *)NULL;
|
||||||
|
|
||||||
memcpy(newstr, str, (len+1)*sizeof(char));
|
memcpy(newstr, str, (len + 1)*sizeof(char));
|
||||||
|
|
||||||
return newstr;
|
return newstr;
|
||||||
|
|
||||||
|
10
lib/telnet.c
10
lib/telnet.c
@ -76,7 +76,7 @@
|
|||||||
} WHILE_FALSE
|
} WHILE_FALSE
|
||||||
#define CURL_SB_ACCUM(x,c) \
|
#define CURL_SB_ACCUM(x,c) \
|
||||||
do { \
|
do { \
|
||||||
if(x->subpointer < (x->subbuffer+sizeof x->subbuffer)) \
|
if(x->subpointer < (x->subbuffer + sizeof x->subbuffer)) \
|
||||||
*x->subpointer++ = (c); \
|
*x->subpointer++ = (c); \
|
||||||
} WHILE_FALSE
|
} WHILE_FALSE
|
||||||
|
|
||||||
@ -935,7 +935,7 @@ static void suboption(struct connectdata *conn)
|
|||||||
struct Curl_easy *data = conn->data;
|
struct Curl_easy *data = conn->data;
|
||||||
struct TELNET *tn = (struct TELNET *)data->req.protop;
|
struct TELNET *tn = (struct TELNET *)data->req.protop;
|
||||||
|
|
||||||
printsub(data, '<', (unsigned char *)tn->subbuffer, CURL_SB_LEN(tn)+2);
|
printsub(data, '<', (unsigned char *)tn->subbuffer, CURL_SB_LEN(tn) + 2);
|
||||||
switch(CURL_SB_GET(tn)) {
|
switch(CURL_SB_GET(tn)) {
|
||||||
case CURL_TELOPT_TTYPE:
|
case CURL_TELOPT_TTYPE:
|
||||||
len = strlen(tn->subopt_ttype) + 4 + 2;
|
len = strlen(tn->subopt_ttype) + 4 + 2;
|
||||||
@ -1033,7 +1033,7 @@ static void sendsuboption(struct connectdata *conn, int option)
|
|||||||
CURL_SB_TERM(tn);
|
CURL_SB_TERM(tn);
|
||||||
/* data suboption is now ready */
|
/* data suboption is now ready */
|
||||||
|
|
||||||
printsub(data, '>', (unsigned char *)tn->subbuffer+2,
|
printsub(data, '>', (unsigned char *)tn->subbuffer + 2,
|
||||||
CURL_SB_LEN(tn)-2);
|
CURL_SB_LEN(tn)-2);
|
||||||
|
|
||||||
/* we send the header of the suboption... */
|
/* we send the header of the suboption... */
|
||||||
@ -1044,9 +1044,9 @@ static void sendsuboption(struct connectdata *conn, int option)
|
|||||||
}
|
}
|
||||||
/* ... then the window size with the send_telnet_data() function
|
/* ... then the window size with the send_telnet_data() function
|
||||||
to deal with 0xFF cases ... */
|
to deal with 0xFF cases ... */
|
||||||
send_telnet_data(conn, (char *)tn->subbuffer+3, 4);
|
send_telnet_data(conn, (char *)tn->subbuffer + 3, 4);
|
||||||
/* ... and the footer */
|
/* ... and the footer */
|
||||||
bytes_written = swrite(conn->sock[FIRSTSOCKET], tn->subbuffer+7, 2);
|
bytes_written = swrite(conn->sock[FIRSTSOCKET], tn->subbuffer + 7, 2);
|
||||||
if(bytes_written < 0) {
|
if(bytes_written < 0) {
|
||||||
err = SOCKERRNO;
|
err = SOCKERRNO;
|
||||||
failf(data, "Sending data failed (%d)", err);
|
failf(data, "Sending data failed (%d)", err);
|
||||||
|
42
lib/tftp.c
42
lib/tftp.c
@ -217,7 +217,7 @@ static CURLcode tftp_set_timeouts(tftp_state_data_t *state)
|
|||||||
if(start) {
|
if(start) {
|
||||||
|
|
||||||
maxtime = (time_t)(timeout_ms + 500) / 1000;
|
maxtime = (time_t)(timeout_ms + 500) / 1000;
|
||||||
state->max_time = state->start_time+maxtime;
|
state->max_time = state->start_time + maxtime;
|
||||||
|
|
||||||
/* Set per-block timeout to total */
|
/* Set per-block timeout to total */
|
||||||
timeout = maxtime;
|
timeout = maxtime;
|
||||||
@ -241,7 +241,7 @@ static CURLcode tftp_set_timeouts(tftp_state_data_t *state)
|
|||||||
else
|
else
|
||||||
maxtime = 3600;
|
maxtime = 3600;
|
||||||
|
|
||||||
state->max_time = state->start_time+maxtime;
|
state->max_time = state->start_time + maxtime;
|
||||||
|
|
||||||
/* Set per-block timeout to total */
|
/* Set per-block timeout to total */
|
||||||
timeout = maxtime;
|
timeout = maxtime;
|
||||||
@ -321,7 +321,7 @@ static const char *tftp_option_get(const char *buf, size_t len,
|
|||||||
return NULL;
|
return NULL;
|
||||||
*option = buf;
|
*option = buf;
|
||||||
|
|
||||||
loc += Curl_strnlen(buf+loc, len-loc);
|
loc += Curl_strnlen(buf + loc, len-loc);
|
||||||
loc++; /* NULL term */
|
loc++; /* NULL term */
|
||||||
|
|
||||||
if(loc > len)
|
if(loc > len)
|
||||||
@ -475,7 +475,7 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
/* If we are uploading, send an WRQ */
|
/* If we are uploading, send an WRQ */
|
||||||
setpacketevent(&state->spacket, TFTP_EVENT_WRQ);
|
setpacketevent(&state->spacket, TFTP_EVENT_WRQ);
|
||||||
state->conn->data->req.upload_fromhere =
|
state->conn->data->req.upload_fromhere =
|
||||||
(char *)state->spacket.data+4;
|
(char *)state->spacket.data + 4;
|
||||||
if(data->state.infilesize != -1)
|
if(data->state.infilesize != -1)
|
||||||
Curl_pgrsSetUploadSize(data, data->state.infilesize);
|
Curl_pgrsSetUploadSize(data, data->state.infilesize);
|
||||||
}
|
}
|
||||||
@ -497,7 +497,7 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
return CURLE_TFTP_ILLEGAL; /* too long file name field */
|
return CURLE_TFTP_ILLEGAL; /* too long file name field */
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf((char *)state->spacket.data+2,
|
snprintf((char *)state->spacket.data + 2,
|
||||||
state->blksize,
|
state->blksize,
|
||||||
"%s%c%s%c", filename, '\0', mode, '\0');
|
"%s%c%s%c", filename, '\0', mode, '\0');
|
||||||
sbytes = 4 + strlen(filename) + strlen(mode);
|
sbytes = 4 + strlen(filename) + strlen(mode);
|
||||||
@ -512,25 +512,25 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
strcpy(buf, "0"); /* the destination is large enough */
|
strcpy(buf, "0"); /* the destination is large enough */
|
||||||
|
|
||||||
sbytes += tftp_option_add(state, sbytes,
|
sbytes += tftp_option_add(state, sbytes,
|
||||||
(char *)state->spacket.data+sbytes,
|
(char *)state->spacket.data + sbytes,
|
||||||
TFTP_OPTION_TSIZE);
|
TFTP_OPTION_TSIZE);
|
||||||
sbytes += tftp_option_add(state, sbytes,
|
sbytes += tftp_option_add(state, sbytes,
|
||||||
(char *)state->spacket.data+sbytes, buf);
|
(char *)state->spacket.data + sbytes, buf);
|
||||||
/* add blksize option */
|
/* add blksize option */
|
||||||
snprintf(buf, sizeof(buf), "%d", state->requested_blksize);
|
snprintf(buf, sizeof(buf), "%d", state->requested_blksize);
|
||||||
sbytes += tftp_option_add(state, sbytes,
|
sbytes += tftp_option_add(state, sbytes,
|
||||||
(char *)state->spacket.data+sbytes,
|
(char *)state->spacket.data + sbytes,
|
||||||
TFTP_OPTION_BLKSIZE);
|
TFTP_OPTION_BLKSIZE);
|
||||||
sbytes += tftp_option_add(state, sbytes,
|
sbytes += tftp_option_add(state, sbytes,
|
||||||
(char *)state->spacket.data+sbytes, buf);
|
(char *)state->spacket.data + sbytes, buf);
|
||||||
|
|
||||||
/* add timeout option */
|
/* add timeout option */
|
||||||
snprintf(buf, sizeof(buf), "%d", state->retry_time);
|
snprintf(buf, sizeof(buf), "%d", state->retry_time);
|
||||||
sbytes += tftp_option_add(state, sbytes,
|
sbytes += tftp_option_add(state, sbytes,
|
||||||
(char *)state->spacket.data+sbytes,
|
(char *)state->spacket.data + sbytes,
|
||||||
TFTP_OPTION_INTERVAL);
|
TFTP_OPTION_INTERVAL);
|
||||||
sbytes += tftp_option_add(state, sbytes,
|
sbytes += tftp_option_add(state, sbytes,
|
||||||
(char *)state->spacket.data+sbytes, buf);
|
(char *)state->spacket.data + sbytes, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the typecase for the 3rd argument is mostly for systems that do
|
/* the typecase for the 3rd argument is mostly for systems that do
|
||||||
@ -576,7 +576,7 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
|
|
||||||
/* the next blocknum is x + 1 but it needs to wrap at an unsigned 16bit
|
/* the next blocknum is x + 1 but it needs to wrap at an unsigned 16bit
|
||||||
boundary */
|
boundary */
|
||||||
#define NEXT_BLOCKNUM(x) (((x)+1)&0xffff)
|
#define NEXT_BLOCKNUM(x) (((x) + 1)&0xffff)
|
||||||
|
|
||||||
/**********************************************************
|
/**********************************************************
|
||||||
*
|
*
|
||||||
@ -627,7 +627,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if completed (That is, a less than full packet is received) */
|
/* Check if completed (That is, a less than full packet is received) */
|
||||||
if(state->rbytes < (ssize_t)state->blksize+4) {
|
if(state->rbytes < (ssize_t)state->blksize + 4) {
|
||||||
state->state = TFTP_STATE_FIN;
|
state->state = TFTP_STATE_FIN;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -743,7 +743,7 @@ static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
else {
|
else {
|
||||||
/* Re-send the data packet */
|
/* Re-send the data packet */
|
||||||
sbytes = sendto(state->sockfd, (void *)state->spacket.data,
|
sbytes = sendto(state->sockfd, (void *)state->spacket.data,
|
||||||
4+state->sbytes, SEND_4TH_ARG,
|
4 + state->sbytes, SEND_4TH_ARG,
|
||||||
(struct sockaddr *)&state->remote_addr,
|
(struct sockaddr *)&state->remote_addr,
|
||||||
state->remote_addrlen);
|
state->remote_addrlen);
|
||||||
/* Check all sbytes were sent */
|
/* Check all sbytes were sent */
|
||||||
@ -776,7 +776,7 @@ static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
* data block.
|
* data block.
|
||||||
* */
|
* */
|
||||||
state->sbytes = 0;
|
state->sbytes = 0;
|
||||||
state->conn->data->req.upload_fromhere = (char *)state->spacket.data+4;
|
state->conn->data->req.upload_fromhere = (char *)state->spacket.data + 4;
|
||||||
do {
|
do {
|
||||||
result = Curl_fillreadbuffer(state->conn, state->blksize - state->sbytes,
|
result = Curl_fillreadbuffer(state->conn, state->blksize - state->sbytes,
|
||||||
&cb);
|
&cb);
|
||||||
@ -813,7 +813,7 @@ static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
else {
|
else {
|
||||||
/* Re-send the data packet */
|
/* Re-send the data packet */
|
||||||
sbytes = sendto(state->sockfd, (void *)state->spacket.data,
|
sbytes = sendto(state->sockfd, (void *)state->spacket.data,
|
||||||
4+state->sbytes, SEND_4TH_ARG,
|
4 + state->sbytes, SEND_4TH_ARG,
|
||||||
(struct sockaddr *)&state->remote_addr,
|
(struct sockaddr *)&state->remote_addr,
|
||||||
state->remote_addrlen);
|
state->remote_addrlen);
|
||||||
/* Check all sbytes were sent */
|
/* Check all sbytes were sent */
|
||||||
@ -1109,7 +1109,7 @@ static CURLcode tftp_receive_packet(struct connectdata *conn)
|
|||||||
fromlen = sizeof(fromaddr);
|
fromlen = sizeof(fromaddr);
|
||||||
state->rbytes = (int)recvfrom(state->sockfd,
|
state->rbytes = (int)recvfrom(state->sockfd,
|
||||||
(void *)state->rpacket.data,
|
(void *)state->rpacket.data,
|
||||||
state->blksize+4,
|
state->blksize + 4,
|
||||||
0,
|
0,
|
||||||
(struct sockaddr *)&fromaddr,
|
(struct sockaddr *)&fromaddr,
|
||||||
&fromlen);
|
&fromlen);
|
||||||
@ -1135,7 +1135,7 @@ static CURLcode tftp_receive_packet(struct connectdata *conn)
|
|||||||
if(state->rbytes > 4 &&
|
if(state->rbytes > 4 &&
|
||||||
(NEXT_BLOCKNUM(state->block) == getrpacketblock(&state->rpacket))) {
|
(NEXT_BLOCKNUM(state->block) == getrpacketblock(&state->rpacket))) {
|
||||||
result = Curl_client_write(conn, CLIENTWRITE_BODY,
|
result = Curl_client_write(conn, CLIENTWRITE_BODY,
|
||||||
(char *)state->rpacket.data+4,
|
(char *)state->rpacket.data + 4,
|
||||||
state->rbytes-4);
|
state->rbytes-4);
|
||||||
if(result) {
|
if(result) {
|
||||||
tftp_state_machine(state, TFTP_EVENT_ERROR);
|
tftp_state_machine(state, TFTP_EVENT_ERROR);
|
||||||
@ -1149,14 +1149,14 @@ static CURLcode tftp_receive_packet(struct connectdata *conn)
|
|||||||
{
|
{
|
||||||
unsigned short error = getrpacketblock(&state->rpacket);
|
unsigned short error = getrpacketblock(&state->rpacket);
|
||||||
state->error = (tftp_error_t)error;
|
state->error = (tftp_error_t)error;
|
||||||
infof(data, "%s\n", (const char *)state->rpacket.data+4);
|
infof(data, "%s\n", (const char *)state->rpacket.data + 4);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TFTP_EVENT_ACK:
|
case TFTP_EVENT_ACK:
|
||||||
break;
|
break;
|
||||||
case TFTP_EVENT_OACK:
|
case TFTP_EVENT_OACK:
|
||||||
result = tftp_parse_option_ack(state,
|
result = tftp_parse_option_ack(state,
|
||||||
(const char *)state->rpacket.data+2,
|
(const char *)state->rpacket.data + 2,
|
||||||
state->rbytes-2);
|
state->rbytes-2);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
@ -1200,7 +1200,7 @@ static long tftp_state_timeout(struct connectdata *conn, tftp_event_t *event)
|
|||||||
state->state = TFTP_STATE_FIN;
|
state->state = TFTP_STATE_FIN;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(current > state->rx_time+state->retry_time) {
|
if(current > state->rx_time + state->retry_time) {
|
||||||
if(event)
|
if(event)
|
||||||
*event = TFTP_EVENT_TIMEOUT;
|
*event = TFTP_EVENT_TIMEOUT;
|
||||||
time(&state->rx_time); /* update even though we received nothing */
|
time(&state->rx_time); /* update even though we received nothing */
|
||||||
|
@ -241,7 +241,7 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp)
|
|||||||
/* mark this as done once this chunk is transferred */
|
/* mark this as done once this chunk is transferred */
|
||||||
data->req.upload_done = TRUE;
|
data->req.upload_done = TRUE;
|
||||||
|
|
||||||
nread+=(int)strlen(endofline_native); /* for the added end of line */
|
nread += (int)strlen(endofline_native); /* for the added end of line */
|
||||||
}
|
}
|
||||||
#ifdef CURL_DOES_CONVERSIONS
|
#ifdef CURL_DOES_CONVERSIONS
|
||||||
else if((data->set.prefer_ascii) && (!sending_http_headers)) {
|
else if((data->set.prefer_ascii) && (!sending_http_headers)) {
|
||||||
@ -1622,7 +1622,7 @@ static char *concat_url(const char *base, const char *relurl)
|
|||||||
that position instead */
|
that position instead */
|
||||||
pathsep = strchr(protsep, '/');
|
pathsep = strchr(protsep, '/');
|
||||||
if(pathsep)
|
if(pathsep)
|
||||||
protsep = pathsep+1;
|
protsep = pathsep + 1;
|
||||||
else
|
else
|
||||||
protsep = NULL;
|
protsep = NULL;
|
||||||
|
|
||||||
@ -1793,7 +1793,7 @@ CURLcode Curl_follow(struct Curl_easy *data,
|
|||||||
/* This is an absolute URL, don't allow the custom port number */
|
/* This is an absolute URL, don't allow the custom port number */
|
||||||
disallowport = TRUE;
|
disallowport = TRUE;
|
||||||
|
|
||||||
newest = malloc(newlen+1); /* get memory for this */
|
newest = malloc(newlen + 1); /* get memory for this */
|
||||||
if(!newest)
|
if(!newest)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
22
lib/url.c
22
lib/url.c
@ -4480,7 +4480,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
|||||||
|
|
||||||
/* This cannot be done with strcpy() in a portable manner, since the
|
/* This cannot be done with strcpy() in a portable manner, since the
|
||||||
memory areas overlap! */
|
memory areas overlap! */
|
||||||
memmove(path, path + 2, strlen(path + 2)+1);
|
memmove(path, path + 2, strlen(path + 2) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4521,7 +4521,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
|||||||
ptr++;
|
ptr++;
|
||||||
|
|
||||||
/* This cannot be made with strcpy, as the memory chunks overlap! */
|
/* This cannot be made with strcpy, as the memory chunks overlap! */
|
||||||
memmove(path, ptr, strlen(ptr)+1);
|
memmove(path, ptr, strlen(ptr) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(MSDOS) && !defined(WIN32) && !defined(__CYGWIN__)
|
#if !defined(MSDOS) && !defined(WIN32) && !defined(__CYGWIN__)
|
||||||
@ -4622,7 +4622,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
|||||||
*/
|
*/
|
||||||
at = strchr(conn->host.name, '@');
|
at = strchr(conn->host.name, '@');
|
||||||
if(at)
|
if(at)
|
||||||
query = strchr(at+1, '?');
|
query = strchr(at + 1, '?');
|
||||||
else
|
else
|
||||||
query = strchr(conn->host.name, '?');
|
query = strchr(conn->host.name, '?');
|
||||||
|
|
||||||
@ -4640,10 +4640,10 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
|||||||
|
|
||||||
/* move the existing path plus the zero byte forward, to make room for
|
/* move the existing path plus the zero byte forward, to make room for
|
||||||
the host-name part */
|
the host-name part */
|
||||||
memmove(path+hostlen+1, path, pathlen+1);
|
memmove(path + hostlen + 1, path, pathlen + 1);
|
||||||
|
|
||||||
/* now copy the trailing host part in front of the existing path */
|
/* now copy the trailing host part in front of the existing path */
|
||||||
memcpy(path+1, query, hostlen);
|
memcpy(path + 1, query, hostlen);
|
||||||
|
|
||||||
path[0]='/'; /* prepend the missing slash */
|
path[0]='/'; /* prepend the missing slash */
|
||||||
rebuild_url = TRUE;
|
rebuild_url = TRUE;
|
||||||
@ -4664,7 +4664,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
|||||||
/* We need this function to deal with overlapping memory areas. We know
|
/* We need this function to deal with overlapping memory areas. We know
|
||||||
that the memory area 'path' points to is 'urllen' bytes big and that
|
that the memory area 'path' points to is 'urllen' bytes big and that
|
||||||
is bigger than the path. Use +1 to move the zero byte too. */
|
is bigger than the path. Use +1 to move the zero byte too. */
|
||||||
memmove(&path[1], path, strlen(path)+1);
|
memmove(&path[1], path, strlen(path) + 1);
|
||||||
path[0] = '/';
|
path[0] = '/';
|
||||||
rebuild_url = TRUE;
|
rebuild_url = TRUE;
|
||||||
}
|
}
|
||||||
@ -4770,7 +4770,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
|||||||
if(*endp == ']') {
|
if(*endp == ']') {
|
||||||
/* The address scope was well formed. Knock it out of the
|
/* The address scope was well formed. Knock it out of the
|
||||||
hostname. */
|
hostname. */
|
||||||
memmove(percent, endp, strlen(endp)+1);
|
memmove(percent, endp, strlen(endp) + 1);
|
||||||
conn->scope_id = (unsigned int)scope;
|
conn->scope_id = (unsigned int)scope;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -5100,7 +5100,7 @@ static CURLcode parse_proxy(struct Curl_easy *data,
|
|||||||
/* Parse the protocol part if present */
|
/* Parse the protocol part if present */
|
||||||
endofprot = strstr(proxy, "://");
|
endofprot = strstr(proxy, "://");
|
||||||
if(endofprot) {
|
if(endofprot) {
|
||||||
proxyptr = endofprot+3;
|
proxyptr = endofprot + 3;
|
||||||
if(checkprefix("https", proxy))
|
if(checkprefix("https", proxy))
|
||||||
proxytype = CURLPROXY_HTTPS;
|
proxytype = CURLPROXY_HTTPS;
|
||||||
else if(checkprefix("socks5h", proxy))
|
else if(checkprefix("socks5h", proxy))
|
||||||
@ -5813,7 +5813,7 @@ static CURLcode parse_remote_port(struct Curl_easy *data,
|
|||||||
char *rest;
|
char *rest;
|
||||||
long port;
|
long port;
|
||||||
|
|
||||||
port = strtol(portptr+1, &rest, 10); /* Port number must be decimal */
|
port = strtol(portptr + 1, &rest, 10); /* Port number must be decimal */
|
||||||
|
|
||||||
if((port < 0) || (port > 0xffff)) {
|
if((port < 0) || (port > 0xffff)) {
|
||||||
/* Single unix standard says port numbers are 16 bits long */
|
/* Single unix standard says port numbers are 16 bits long */
|
||||||
@ -6448,14 +6448,14 @@ static CURLcode create_conn(struct Curl_easy *data,
|
|||||||
Curl_safefree(data->state.pathbuffer);
|
Curl_safefree(data->state.pathbuffer);
|
||||||
data->state.path = NULL;
|
data->state.path = NULL;
|
||||||
|
|
||||||
data->state.pathbuffer = malloc(urllen+2);
|
data->state.pathbuffer = malloc(urllen + 2);
|
||||||
if(NULL == data->state.pathbuffer) {
|
if(NULL == data->state.pathbuffer) {
|
||||||
result = CURLE_OUT_OF_MEMORY; /* really bad error */
|
result = CURLE_OUT_OF_MEMORY; /* really bad error */
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
data->state.path = data->state.pathbuffer;
|
data->state.path = data->state.pathbuffer;
|
||||||
|
|
||||||
conn->host.rawalloc = malloc(urllen+2);
|
conn->host.rawalloc = malloc(urllen + 2);
|
||||||
if(NULL == conn->host.rawalloc) {
|
if(NULL == conn->host.rawalloc) {
|
||||||
Curl_safefree(data->state.pathbuffer);
|
Curl_safefree(data->state.pathbuffer);
|
||||||
data->state.path = NULL;
|
data->state.path = NULL;
|
||||||
|
@ -1129,7 +1129,7 @@ struct Progress {
|
|||||||
struct curltime dl_limit_start;
|
struct curltime dl_limit_start;
|
||||||
curl_off_t dl_limit_size;
|
curl_off_t dl_limit_size;
|
||||||
|
|
||||||
#define CURR_TIME (5+1) /* 6 entries for 5 seconds */
|
#define CURR_TIME (5 + 1) /* 6 entries for 5 seconds */
|
||||||
|
|
||||||
curl_off_t speeder[ CURR_TIME ];
|
curl_off_t speeder[ CURR_TIME ];
|
||||||
struct curltime speeder_time[ CURR_TIME ];
|
struct curltime speeder_time[ CURR_TIME ];
|
||||||
@ -1251,7 +1251,7 @@ struct UrlState {
|
|||||||
size_t headersize; /* size of the allocation */
|
size_t headersize; /* size of the allocation */
|
||||||
|
|
||||||
char *buffer; /* download buffer */
|
char *buffer; /* download buffer */
|
||||||
char uploadbuffer[UPLOAD_BUFSIZE+1]; /* upload buffer */
|
char uploadbuffer[UPLOAD_BUFSIZE + 1]; /* upload buffer */
|
||||||
curl_off_t current_speed; /* the ProgressShow() function sets this,
|
curl_off_t current_speed; /* the ProgressShow() function sets this,
|
||||||
bytes / second */
|
bytes / second */
|
||||||
bool this_is_a_follow; /* this is a followed Location: request */
|
bool this_is_a_follow; /* this is a followed Location: request */
|
||||||
|
@ -368,7 +368,7 @@ static int passwd_callback(char *buf, int num, int encrypting,
|
|||||||
if(!encrypting) {
|
if(!encrypting) {
|
||||||
int klen = curlx_uztosi(strlen((char *)global_passwd));
|
int klen = curlx_uztosi(strlen((char *)global_passwd));
|
||||||
if(num > klen) {
|
if(num > klen) {
|
||||||
memcpy(buf, global_passwd, klen+1);
|
memcpy(buf, global_passwd, klen + 1);
|
||||||
return klen;
|
return klen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1455,7 +1455,7 @@ static CURLcode verifyhost(struct connectdata *conn, X509 *server_cert)
|
|||||||
if(ASN1_STRING_type(tmp) == V_ASN1_UTF8STRING) {
|
if(ASN1_STRING_type(tmp) == V_ASN1_UTF8STRING) {
|
||||||
j = ASN1_STRING_length(tmp);
|
j = ASN1_STRING_length(tmp);
|
||||||
if(j >= 0) {
|
if(j >= 0) {
|
||||||
peer_CN = OPENSSL_malloc(j+1);
|
peer_CN = OPENSSL_malloc(j + 1);
|
||||||
if(peer_CN) {
|
if(peer_CN) {
|
||||||
memcpy(peer_CN, ASN1_STRING_get0_data(tmp), j);
|
memcpy(peer_CN, ASN1_STRING_get0_data(tmp), j);
|
||||||
peer_CN[j] = '\0';
|
peer_CN[j] = '\0';
|
||||||
|
@ -697,7 +697,7 @@ CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data,
|
|||||||
snprintf(output, outlen, "%s:", label);
|
snprintf(output, outlen, "%s:", label);
|
||||||
|
|
||||||
/* memcpy the value (it might not be zero terminated) */
|
/* memcpy the value (it might not be zero terminated) */
|
||||||
memcpy(&output[labellen+1], value, valuelen);
|
memcpy(&output[labellen + 1], value, valuelen);
|
||||||
|
|
||||||
/* zero terminate the output */
|
/* zero terminate the output */
|
||||||
output[labellen + 1 + valuelen] = 0;
|
output[labellen + 1 + valuelen] = 0;
|
||||||
|
@ -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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -238,37 +238,40 @@ static void dump(const char *timebuf, const char *text,
|
|||||||
if(tracetype == TRACE_BIN) {
|
if(tracetype == TRACE_BIN) {
|
||||||
/* hex not disabled, show it */
|
/* hex not disabled, show it */
|
||||||
for(c = 0; c < width; c++)
|
for(c = 0; c < width; c++)
|
||||||
if(i+c < size)
|
if(i + c < size)
|
||||||
fprintf(stream, "%02x ", ptr[i+c]);
|
fprintf(stream, "%02x ", ptr[i + c]);
|
||||||
else
|
else
|
||||||
fputs(" ", stream);
|
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 */
|
/* check for 0D0A; if found, skip past and start a new line of output */
|
||||||
if((tracetype == TRACE_ASCII) &&
|
if((tracetype == TRACE_ASCII) &&
|
||||||
(i+c+1 < size) && (ptr[i+c] == 0x0D) && (ptr[i+c+1] == 0x0A)) {
|
(i + c + 1 < size) && (ptr[i + c] == 0x0D) &&
|
||||||
i += (c+2-width);
|
(ptr[i + c + 1] == 0x0A)) {
|
||||||
|
i += (c + 2 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef CURL_DOES_CONVERSIONS
|
#ifdef CURL_DOES_CONVERSIONS
|
||||||
/* repeat the 0D0A check above but use the host encoding for CRLF */
|
/* repeat the 0D0A check above but use the host encoding for CRLF */
|
||||||
if((tracetype == TRACE_ASCII) &&
|
if((tracetype == TRACE_ASCII) &&
|
||||||
(i+c+1 < size) && (ptr[i+c] == '\r') && (ptr[i+c+1] == '\n')) {
|
(i + c + 1 < size) && (ptr[i + c] == '\r') &&
|
||||||
i += (c+2-width);
|
(ptr[i + c + 1] == '\n')) {
|
||||||
|
i += (c + 2 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* convert to host encoding and print this character */
|
/* convert to host encoding and print this character */
|
||||||
fprintf(stream, "%c", convert_char(infotype, ptr[i+c]));
|
fprintf(stream, "%c", convert_char(infotype, ptr[i + c]));
|
||||||
#else
|
#else
|
||||||
(void)infotype;
|
(void)infotype;
|
||||||
fprintf(stream, "%c", ((ptr[i+c] >= 0x20) && (ptr[i+c] < 0x80)) ?
|
fprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80)) ?
|
||||||
ptr[i+c] : UNPRINTABLE_CHAR);
|
ptr[i + c] : UNPRINTABLE_CHAR);
|
||||||
#endif /* CURL_DOES_CONVERSIONS */
|
#endif /* CURL_DOES_CONVERSIONS */
|
||||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||||
if((tracetype == TRACE_ASCII) &&
|
if((tracetype == TRACE_ASCII) &&
|
||||||
(i+c+2 < size) && (ptr[i+c+1] == 0x0D) && (ptr[i+c+2] == 0x0A)) {
|
(i + c + 2 < size) && (ptr[i + c + 1] == 0x0D) &&
|
||||||
i += (c+3-width);
|
(ptr[i + c + 2] == 0x0A)) {
|
||||||
|
i += (c + 3 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ static char *parse_filename(const char *ptr, size_t len)
|
|||||||
char stop = '\0';
|
char stop = '\0';
|
||||||
|
|
||||||
/* simple implementation of strndup() */
|
/* simple implementation of strndup() */
|
||||||
copy = malloc(len+1);
|
copy = malloc(len + 1);
|
||||||
if(!copy)
|
if(!copy)
|
||||||
return NULL;
|
return NULL;
|
||||||
memcpy(copy, ptr, len);
|
memcpy(copy, ptr, len);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2014, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -44,7 +44,7 @@ int tool_progress_cb(void *clientp,
|
|||||||
/* The original progress-bar source code was written for curl by Lars Aas,
|
/* The original progress-bar source code was written for curl by Lars Aas,
|
||||||
and this new edition inherits some of his concepts. */
|
and this new edition inherits some of his concepts. */
|
||||||
|
|
||||||
char line[MAX_BARLENGTH+1];
|
char line[MAX_BARLENGTH + 1];
|
||||||
char format[40];
|
char format[40];
|
||||||
double frac;
|
double frac;
|
||||||
double percent;
|
double percent;
|
||||||
|
@ -80,7 +80,7 @@ static char *get_param_word(char **str, char **end_pos)
|
|||||||
while(*ptr && NULL == strchr(end_chars, *ptr))
|
while(*ptr && NULL == strchr(end_chars, *ptr))
|
||||||
++ptr;
|
++ptr;
|
||||||
*str = ptr;
|
*str = ptr;
|
||||||
return word_begin+1;
|
return word_begin + 1;
|
||||||
}
|
}
|
||||||
++ptr;
|
++ptr;
|
||||||
}
|
}
|
||||||
|
@ -449,7 +449,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||||||
if(('-' != flag[0]) ||
|
if(('-' != flag[0]) ||
|
||||||
(('-' == flag[0]) && ('-' == flag[1]))) {
|
(('-' == flag[0]) && ('-' == flag[1]))) {
|
||||||
/* this should be a long name */
|
/* this should be a long name */
|
||||||
const char *word = ('-' == flag[0]) ? flag+2 : flag;
|
const char *word = ('-' == flag[0]) ? flag + 2 : flag;
|
||||||
size_t fnam = strlen(word);
|
size_t fnam = strlen(word);
|
||||||
int numhits = 0;
|
int numhits = 0;
|
||||||
|
|
||||||
@ -1004,7 +1004,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||||||
#ifdef USE_METALINK
|
#ifdef USE_METALINK
|
||||||
int mlmaj, mlmin, mlpatch;
|
int mlmaj, mlmin, mlpatch;
|
||||||
metalink_get_version(&mlmaj, &mlmin, &mlpatch);
|
metalink_get_version(&mlmaj, &mlmin, &mlpatch);
|
||||||
if((mlmaj*10000)+(mlmin*100)+mlpatch < CURL_REQ_LIBMETALINK_VERS) {
|
if((mlmaj*10000)+(mlmin*100) + mlpatch < CURL_REQ_LIBMETALINK_VERS) {
|
||||||
warnf(global,
|
warnf(global,
|
||||||
"--metalink option cannot be used because the version of "
|
"--metalink option cannot be used because the version of "
|
||||||
"the linked libmetalink library is too old. "
|
"the linked libmetalink library is too old. "
|
||||||
@ -1354,11 +1354,11 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||||||
memcpy(config->postfields, oldpost, (size_t)oldlen);
|
memcpy(config->postfields, oldpost, (size_t)oldlen);
|
||||||
/* use byte value 0x26 for '&' to accommodate non-ASCII platforms */
|
/* use byte value 0x26 for '&' to accommodate non-ASCII platforms */
|
||||||
config->postfields[oldlen] = '\x26';
|
config->postfields[oldlen] = '\x26';
|
||||||
memcpy(&config->postfields[oldlen+1], postdata, size);
|
memcpy(&config->postfields[oldlen + 1], postdata, size);
|
||||||
config->postfields[oldlen+1+size] = '\0';
|
config->postfields[oldlen + 1 + size] = '\0';
|
||||||
Curl_safefree(oldpost);
|
Curl_safefree(oldpost);
|
||||||
Curl_safefree(postdata);
|
Curl_safefree(postdata);
|
||||||
config->postfieldsize += size+1;
|
config->postfieldsize += size + 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
config->postfields = postdata;
|
config->postfields = postdata;
|
||||||
|
@ -680,7 +680,7 @@ static metalink_checksum *new_metalink_checksum_from_hex_digest
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for(i = 0; i < len; i += 2) {
|
for(i = 0; i < len; i += 2) {
|
||||||
digest[i/2] = hex_to_uint(hex_digest+i);
|
digest[i/2] = hex_to_uint(hex_digest + i);
|
||||||
}
|
}
|
||||||
chksum = malloc(sizeof(metalink_checksum));
|
chksum = malloc(sizeof(metalink_checksum));
|
||||||
if(chksum) {
|
if(chksum) {
|
||||||
@ -903,8 +903,8 @@ static int check_content_type(const char *content_type, const char *media_type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return curl_strnequal(ptr, media_type, media_type_len) &&
|
return curl_strnequal(ptr, media_type, media_type_len) &&
|
||||||
(*(ptr+media_type_len) == '\0' || *(ptr+media_type_len) == ' ' ||
|
(*(ptr + media_type_len) == '\0' || *(ptr + media_type_len) == ' ' ||
|
||||||
*(ptr+media_type_len) == '\t' || *(ptr+media_type_len) == ';');
|
*(ptr + media_type_len) == '\t' || *(ptr + media_type_len) == ';');
|
||||||
}
|
}
|
||||||
|
|
||||||
int check_metalink_content_type(const char *content_type)
|
int check_metalink_content_type(const char *content_type)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2015, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -63,7 +63,7 @@ static void voutf(struct GlobalConfig *config,
|
|||||||
|
|
||||||
(void)fwrite(ptr, cut + 1, 1, config->errors);
|
(void)fwrite(ptr, cut + 1, 1, config->errors);
|
||||||
fputs("\n", config->errors);
|
fputs("\n", config->errors);
|
||||||
ptr += cut+1; /* skip the space too */
|
ptr += cut + 1; /* skip the space too */
|
||||||
len -= cut;
|
len -= cut;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -800,7 +800,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
|
|||||||
|
|
||||||
if(urlnum > 1 && !global->mute) {
|
if(urlnum > 1 && !global->mute) {
|
||||||
fprintf(global->errors, "\n[%lu/%lu]: %s --> %s\n",
|
fprintf(global->errors, "\n[%lu/%lu]: %s --> %s\n",
|
||||||
li+1, urlnum, this_url, outfile ? outfile : "<stdout>");
|
li + 1, urlnum, this_url, outfile ? outfile : "<stdout>");
|
||||||
if(separator)
|
if(separator)
|
||||||
printf("%s%s\n", CURLseparator, this_url);
|
printf("%s%s\n", CURLseparator, this_url);
|
||||||
}
|
}
|
||||||
|
@ -73,13 +73,13 @@ ParameterError file2string(char **bufp, FILE *file)
|
|||||||
if(ptr)
|
if(ptr)
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
buflen = strlen(buffer);
|
buflen = strlen(buffer);
|
||||||
ptr = realloc(string, stringlen+buflen+1);
|
ptr = realloc(string, stringlen + buflen + 1);
|
||||||
if(!ptr) {
|
if(!ptr) {
|
||||||
Curl_safefree(string);
|
Curl_safefree(string);
|
||||||
return PARAM_NO_MEM;
|
return PARAM_NO_MEM;
|
||||||
}
|
}
|
||||||
string = ptr;
|
string = ptr;
|
||||||
strcpy(string+stringlen, buffer);
|
strcpy(string + stringlen, buffer);
|
||||||
stringlen += buflen;
|
stringlen += buflen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,27 +99,27 @@ ParameterError file2memory(char **bufp, size_t *size, FILE *file)
|
|||||||
do {
|
do {
|
||||||
if(!buffer || (alloc == nused)) {
|
if(!buffer || (alloc == nused)) {
|
||||||
/* size_t overflow detection for huge files */
|
/* size_t overflow detection for huge files */
|
||||||
if(alloc+1 > ((size_t)-1)/2) {
|
if(alloc + 1 > ((size_t)-1)/2) {
|
||||||
Curl_safefree(buffer);
|
Curl_safefree(buffer);
|
||||||
return PARAM_NO_MEM;
|
return PARAM_NO_MEM;
|
||||||
}
|
}
|
||||||
alloc *= 2;
|
alloc *= 2;
|
||||||
/* allocate an extra char, reserved space, for null termination */
|
/* allocate an extra char, reserved space, for null termination */
|
||||||
newbuf = realloc(buffer, alloc+1);
|
newbuf = realloc(buffer, alloc + 1);
|
||||||
if(!newbuf) {
|
if(!newbuf) {
|
||||||
Curl_safefree(buffer);
|
Curl_safefree(buffer);
|
||||||
return PARAM_NO_MEM;
|
return PARAM_NO_MEM;
|
||||||
}
|
}
|
||||||
buffer = newbuf;
|
buffer = newbuf;
|
||||||
}
|
}
|
||||||
nread = fread(buffer+nused, 1, alloc-nused, file);
|
nread = fread(buffer + nused, 1, alloc-nused, file);
|
||||||
nused += nread;
|
nused += nread;
|
||||||
} while(nread);
|
} while(nread);
|
||||||
/* null terminate the buffer in case it's used as a string later */
|
/* null terminate the buffer in case it's used as a string later */
|
||||||
buffer[nused] = '\0';
|
buffer[nused] = '\0';
|
||||||
/* free trailing slack space, if possible */
|
/* free trailing slack space, if possible */
|
||||||
if(alloc != nused) {
|
if(alloc != nused) {
|
||||||
newbuf = realloc(buffer, nused+1);
|
newbuf = realloc(buffer, nused + 1);
|
||||||
if(!newbuf) {
|
if(!newbuf) {
|
||||||
Curl_safefree(buffer);
|
Curl_safefree(buffer);
|
||||||
return PARAM_NO_MEM;
|
return PARAM_NO_MEM;
|
||||||
@ -474,7 +474,7 @@ static CURLcode checkpasswd(const char *kind, /* for what purpose */
|
|||||||
|
|
||||||
/* append the password separated with a colon */
|
/* append the password separated with a colon */
|
||||||
passptr[userlen] = ':';
|
passptr[userlen] = ':';
|
||||||
memcpy(&passptr[userlen+1], passwd, passwdlen+1);
|
memcpy(&passptr[userlen + 1], passwd, passwdlen + 1);
|
||||||
*userpwd = passptr;
|
*userpwd = passptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2015, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -35,11 +35,11 @@ char *strdup(const char *str)
|
|||||||
if(len >= ((size_t)-1) / sizeof(char))
|
if(len >= ((size_t)-1) / sizeof(char))
|
||||||
return (char *)NULL;
|
return (char *)NULL;
|
||||||
|
|
||||||
newstr = malloc((len+1)*sizeof(char));
|
newstr = malloc((len + 1)*sizeof(char));
|
||||||
if(!newstr)
|
if(!newstr)
|
||||||
return (char *)NULL;
|
return (char *)NULL;
|
||||||
|
|
||||||
memcpy(newstr, str, (len+1)*sizeof(char));
|
memcpy(newstr, str, (len + 1)*sizeof(char));
|
||||||
|
|
||||||
return newstr;
|
return newstr;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ static CURLcode glob_fixed(URLGlob *glob, char *fixed, size_t len)
|
|||||||
if(!pat->content.Set.elements)
|
if(!pat->content.Set.elements)
|
||||||
return GLOBERROR("out of memory", 0, CURLE_OUT_OF_MEMORY);
|
return GLOBERROR("out of memory", 0, CURLE_OUT_OF_MEMORY);
|
||||||
|
|
||||||
pat->content.Set.elements[0] = malloc(len+1);
|
pat->content.Set.elements[0] = malloc(len + 1);
|
||||||
if(!pat->content.Set.elements[0])
|
if(!pat->content.Set.elements[0])
|
||||||
return GLOBERROR("out of memory", 0, CURLE_OUT_OF_MEMORY);
|
return GLOBERROR("out of memory", 0, CURLE_OUT_OF_MEMORY);
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ static CURLcode glob_set(URLGlob *glob, char **patternp,
|
|||||||
CURLE_URL_MALFORMAT);
|
CURLE_URL_MALFORMAT);
|
||||||
|
|
||||||
/* add 1 to size since it'll be incremented below */
|
/* add 1 to size since it'll be incremented below */
|
||||||
if(multiply(amount, pat->content.Set.size+1))
|
if(multiply(amount, pat->content.Set.size + 1))
|
||||||
return GLOBERROR("range overflow", 0, CURLE_URL_MALFORMAT);
|
return GLOBERROR("range overflow", 0, CURLE_URL_MALFORMAT);
|
||||||
|
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
@ -207,7 +207,7 @@ static CURLcode glob_range(URLGlob *glob, char **patternp,
|
|||||||
if(errno || &pattern[4] == endp || *endp != ']')
|
if(errno || &pattern[4] == endp || *endp != ']')
|
||||||
step = 0;
|
step = 0;
|
||||||
else
|
else
|
||||||
pattern = endp+1;
|
pattern = endp + 1;
|
||||||
}
|
}
|
||||||
else if(end_c != ']')
|
else if(end_c != ']')
|
||||||
/* then this is wrong */
|
/* then this is wrong */
|
||||||
@ -264,7 +264,7 @@ static CURLcode glob_range(URLGlob *glob, char **patternp,
|
|||||||
if(*endp != '-')
|
if(*endp != '-')
|
||||||
endp = NULL;
|
endp = NULL;
|
||||||
else {
|
else {
|
||||||
pattern = endp+1;
|
pattern = endp + 1;
|
||||||
while(*pattern && ISBLANK(*pattern))
|
while(*pattern && ISBLANK(*pattern))
|
||||||
pattern++;
|
pattern++;
|
||||||
if(!ISDIGIT(*pattern)) {
|
if(!ISDIGIT(*pattern)) {
|
||||||
@ -277,7 +277,7 @@ static CURLcode glob_range(URLGlob *glob, char **patternp,
|
|||||||
/* overflow */
|
/* overflow */
|
||||||
endp = NULL;
|
endp = NULL;
|
||||||
else if(*endp == ':') {
|
else if(*endp == ':') {
|
||||||
pattern = endp+1;
|
pattern = endp + 1;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
step_n = strtoul(pattern, &endp, 10);
|
step_n = strtoul(pattern, &endp, 10);
|
||||||
if(errno)
|
if(errno)
|
||||||
@ -287,7 +287,7 @@ static CURLcode glob_range(URLGlob *glob, char **patternp,
|
|||||||
else
|
else
|
||||||
step_n = 1;
|
step_n = 1;
|
||||||
if(endp && (*endp == ']')) {
|
if(endp && (*endp == ']')) {
|
||||||
pattern = endp+1;
|
pattern = endp + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
endp = NULL;
|
endp = NULL;
|
||||||
@ -384,8 +384,8 @@ static CURLcode glob_parse(URLGlob *glob, char *pattern,
|
|||||||
|
|
||||||
/* only allow \ to escape known "special letters" */
|
/* only allow \ to escape known "special letters" */
|
||||||
if(*pattern == '\\' &&
|
if(*pattern == '\\' &&
|
||||||
(*(pattern+1) == '{' || *(pattern+1) == '[' ||
|
(*(pattern + 1) == '{' || *(pattern + 1) == '[' ||
|
||||||
*(pattern+1) == '}' || *(pattern+1) == ']') ) {
|
*(pattern + 1) == '}' || *(pattern + 1) == ']') ) {
|
||||||
|
|
||||||
/* escape character, skip '\' */
|
/* escape character, skip '\' */
|
||||||
++pattern;
|
++pattern;
|
||||||
|
@ -118,7 +118,7 @@ static void memory_tracking_init(void)
|
|||||||
/* returns a hexdump in a static memory area */
|
/* returns a hexdump in a static memory area */
|
||||||
char *hexdump(const unsigned char *buffer, size_t len)
|
char *hexdump(const unsigned char *buffer, size_t len)
|
||||||
{
|
{
|
||||||
static char dump[200*3+1];
|
static char dump[200 * 3 + 1];
|
||||||
char *p = dump;
|
char *p = dump;
|
||||||
size_t i;
|
size_t i;
|
||||||
if(len > 200)
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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. */
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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
|
case of (maxfd == -1), we call select(0, ...), which is basically equal
|
||||||
to sleep. */
|
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) {
|
if(tutil_tvdiff(tutil_tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
|
||||||
fprintf(stderr, "ABORTING TEST, since it seems "
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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;
|
timeout.tv_usec = 0;
|
||||||
|
|
||||||
multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd);
|
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();
|
abort_on_test_timeout();
|
||||||
multi_perform(m, &still_running);
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -115,7 +115,7 @@ int test(char *URL)
|
|||||||
else {
|
else {
|
||||||
/* Note that on some platforms 'timeout' may be modified by select().
|
/* Note that on some platforms 'timeout' may be modified by select().
|
||||||
If you need access to the original value save a copy beforehand. */
|
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) {
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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_sec = 0;
|
||||||
interval.tv_usec = 1000;
|
interval.tv_usec = 1000;
|
||||||
|
|
||||||
select_test(maxfd+1, &rd, &wr, &exc, &interval);
|
select_test(maxfd + 1, &rd, &wr, &exc, &interval);
|
||||||
|
|
||||||
abort_on_test_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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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. */
|
/* 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();
|
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. */
|
/* 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();
|
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. */
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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)
|
if(res)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ static int loop(int num, CURLM *cm, const char *url, const char *userpwd,
|
|||||||
T.tv_usec = 0;
|
T.tv_usec = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
res_select_test(M+1, &R, &W, &E, &T);
|
res_select_test(M + 1, &R, &W, &E, &T);
|
||||||
if(res)
|
if(res)
|
||||||
return 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);
|
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);
|
fprintf(stream, "%04x: ", (int)i);
|
||||||
|
|
||||||
if(!nohex) {
|
if(!nohex) {
|
||||||
/* hex not disabled, show it */
|
/* hex not disabled, show it */
|
||||||
for(c = 0; c < width; c++)
|
for(c = 0; c < width; c++)
|
||||||
if(i+c < size)
|
if(i + c < size)
|
||||||
fprintf(stream, "%02x ", ptr[i+c]);
|
fprintf(stream, "%02x ", ptr[i + c]);
|
||||||
else
|
else
|
||||||
fputs(" ", stream);
|
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 */
|
/* 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) {
|
if(nohex && (i + c + 1 < size) && ptr[i + c] == 0x0D &&
|
||||||
i+=(c+2-width);
|
ptr[i + c + 1] == 0x0A) {
|
||||||
|
i += (c + 2 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fprintf(stream, "%c",
|
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 */
|
/* 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) {
|
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||||
i+=(c+3-width);
|
ptr[i + c + 2] == 0x0A) {
|
||||||
|
i += (c + 3 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ int test(char *URL)
|
|||||||
|
|
||||||
/* At this point, maxfd is guaranteed to be greater or equal than -1. */
|
/* 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();
|
abort_on_test_timeout();
|
||||||
}
|
}
|
||||||
|
@ -1546,6 +1546,7 @@ static int test_weird_arguments(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* DBL_MAX value from Linux */
|
/* DBL_MAX value from Linux */
|
||||||
|
/* !checksrc! disable PLUSNOSPACE 1 */
|
||||||
#define MAXIMIZE -1.7976931348623157081452E+308
|
#define MAXIMIZE -1.7976931348623157081452E+308
|
||||||
|
|
||||||
static int test_float_formatting(void)
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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;
|
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(message_size - i > RTP_DATA_SIZE) {
|
||||||
if(memcmp(RTP_DATA, data + i, RTP_DATA_SIZE) != 0) {
|
if(memcmp(RTP_DATA, data + i, RTP_DATA_SIZE) != 0) {
|
||||||
printf("RTP PAYLOAD CORRUPTED [%s]\n", data + i);
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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. */
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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 */
|
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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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;
|
interval.tv_usec = (itimeout%1000)*1000;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
interval.tv_sec = TEST_HANG_TIMEOUT/1000+1;
|
interval.tv_sec = TEST_HANG_TIMEOUT/1000 + 1;
|
||||||
interval.tv_usec = 0;
|
interval.tv_usec = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
select_test(maxfd+1, &fdread, &fdwrite, &fdexcep, &interval);
|
select_test(maxfd + 1, &fdread, &fdwrite, &fdexcep, &interval);
|
||||||
|
|
||||||
abort_on_test_timeout();
|
abort_on_test_timeout();
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ int test(char *url)
|
|||||||
interval.tv_usec = (itimeout%1000)*1000;
|
interval.tv_usec = (itimeout%1000)*1000;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
interval.tv_sec = TEST_HANG_TIMEOUT/1000+1;
|
interval.tv_sec = TEST_HANG_TIMEOUT/1000 + 1;
|
||||||
interval.tv_usec = 0;
|
interval.tv_usec = 0;
|
||||||
|
|
||||||
/* if there's no timeout and we get here on the last handle, we may
|
/* 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();
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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) {
|
if(!nohex) {
|
||||||
/* hex not disabled, show it */
|
/* hex not disabled, show it */
|
||||||
for(c = 0; c < width; c++)
|
for(c = 0; c < width; c++)
|
||||||
if(i+c < size)
|
if(i + c < size)
|
||||||
fprintf(stream, "%02x ", ptr[i+c]);
|
fprintf(stream, "%02x ", ptr[i + c]);
|
||||||
else
|
else
|
||||||
fputs(" ", stream);
|
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 */
|
/* check for 0D0A; if found, skip past and start a new line of output */
|
||||||
if(nohex &&
|
if(nohex &&
|
||||||
(i+c+1 < size) && (ptr[i+c] == 0x0D) && (ptr[i+c+1] == 0x0A)) {
|
(i + c + 1 < size) && (ptr[i + c] == 0x0D) &&
|
||||||
i += (c+2-width);
|
(ptr[i + c + 1] == 0x0A)) {
|
||||||
|
i += (c + 2 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fprintf(stream, "%c", ((ptr[i+c] >= 0x20) && (ptr[i+c] < 0x80)) ?
|
fprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80)) ?
|
||||||
ptr[i+c] : '.');
|
ptr[i + c] : '.');
|
||||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||||
if(nohex &&
|
if(nohex &&
|
||||||
(i+c+2 < size) && (ptr[i+c+1] == 0x0D) && (ptr[i+c+2] == 0x0A)) {
|
(i + c + 2 < size) && (ptr[i + c + 1] == 0x0D) &&
|
||||||
i += (c+3-width);
|
(ptr[i + c + 2] == 0x0A)) {
|
||||||
|
i += (c + 3 - width);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,8 @@ static char *printable(char *inbuf, size_t inlength)
|
|||||||
inlength = strlen(inbuf);
|
inlength = strlen(inbuf);
|
||||||
|
|
||||||
if(inlength) {
|
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;
|
outsize = inlength + outincr;
|
||||||
}
|
}
|
||||||
else
|
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
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* 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)
|
const char *main, const char *sub, FILE *stream)
|
||||||
{
|
{
|
||||||
# define MAX_TAG_LEN 79
|
# define MAX_TAG_LEN 79
|
||||||
char couter[MAX_TAG_LEN+1]; /* current outermost section */
|
char couter[MAX_TAG_LEN + 1]; /* current outermost section */
|
||||||
char cmain[MAX_TAG_LEN+1]; /* current main section */
|
char cmain[MAX_TAG_LEN + 1]; /* current main section */
|
||||||
char csub[MAX_TAG_LEN+1]; /* current sub section */
|
char csub[MAX_TAG_LEN + 1]; /* current sub section */
|
||||||
char ptag[MAX_TAG_LEN+1]; /* potential tag */
|
char ptag[MAX_TAG_LEN + 1]; /* potential tag */
|
||||||
char patt[MAX_TAG_LEN+1]; /* potential attributes */
|
char patt[MAX_TAG_LEN + 1]; /* potential attributes */
|
||||||
char *buffer = NULL;
|
char *buffer = NULL;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
char *end;
|
char *end;
|
||||||
|
@ -500,7 +500,7 @@ static int ProcessRequest(struct httprequest *req)
|
|||||||
SET_RTP_PKT_LEN(rtp_scratch, rtp_size);
|
SET_RTP_PKT_LEN(rtp_scratch, rtp_size);
|
||||||
|
|
||||||
/* Fill it with junk data */
|
/* 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);
|
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
|
/* if the host name starts with test, the port number used in the
|
||||||
CONNECT line will be used as test number! */
|
CONNECT line will be used as test number! */
|
||||||
char *portp = strchr(doc, ':');
|
char *portp = strchr(doc, ':');
|
||||||
if(portp && (*(portp+1) != '\0') && ISDIGIT(*(portp+1)))
|
if(portp && (*(portp + 1) != '\0') && ISDIGIT(*(portp + 1)))
|
||||||
req->testno = strtol(portp+1, NULL, 10);
|
req->testno = strtol(portp + 1, NULL, 10);
|
||||||
else
|
else
|
||||||
req->testno = DOCNUMBER_CONNECT;
|
req->testno = DOCNUMBER_CONNECT;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user