mirror of
https://github.com/curl/curl.git
synced 2026-07-24 13:37:18 +03:00
code: style updates
This commit is contained in:
parent
9d194a1143
commit
a71012c03e
85 changed files with 249 additions and 248 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -35,7 +35,7 @@ extern int errno, h_errno;
|
|||
#include <stabs.h>
|
||||
void __request(const char *msg);
|
||||
#else
|
||||
# define __request( msg ) Printf( msg "\n\a")
|
||||
# define __request(msg) Printf(msg "\n\a")
|
||||
#endif
|
||||
|
||||
void Curl_amiga_cleanup()
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ static CURLcode base64_encode(const char *table64,
|
|||
table64[obuf[0]],
|
||||
table64[obuf[1]],
|
||||
table64[obuf[2]],
|
||||
table64[obuf[3]] );
|
||||
table64[obuf[3]]);
|
||||
break;
|
||||
}
|
||||
output += 4;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -473,7 +473,7 @@
|
|||
# endif
|
||||
|
||||
# ifndef fileno /* sunos 4 have this as a macro! */
|
||||
int fileno( FILE *stream);
|
||||
int fileno(FILE *stream);
|
||||
# endif
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ static CURLcode win32_init(void)
|
|||
/* wVersionRequested in wVersion. wHighVersion contains the */
|
||||
/* highest supported version. */
|
||||
|
||||
if(LOBYTE( wsaData.wVersion ) != LOBYTE(wVersionRequested) ||
|
||||
HIBYTE( wsaData.wVersion ) != HIBYTE(wVersionRequested) ) {
|
||||
if(LOBYTE(wsaData.wVersion) != LOBYTE(wVersionRequested) ||
|
||||
HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested) ) {
|
||||
/* Tell the user that we couldn't find a useable */
|
||||
|
||||
/* winsock.dll. */
|
||||
|
|
@ -625,7 +625,7 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
|
|||
if(0 == pollrc) {
|
||||
/* timeout! */
|
||||
ev->ms = 0;
|
||||
/* fprintf(stderr, "call curl_multi_socket_action( TIMEOUT )\n"); */
|
||||
/* fprintf(stderr, "call curl_multi_socket_action(TIMEOUT)\n"); */
|
||||
mcode = curl_multi_socket_action(multi, CURL_SOCKET_TIMEOUT, 0,
|
||||
&ev->running_handles);
|
||||
}
|
||||
|
|
@ -635,7 +635,7 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
|
|||
if(fds[i].revents) {
|
||||
/* socket activity, tell libcurl */
|
||||
int act = poll2cselect(fds[i].revents); /* convert */
|
||||
infof(multi->easyp, "call curl_multi_socket_action( socket %d )\n",
|
||||
infof(multi->easyp, "call curl_multi_socket_action(socket %d)\n",
|
||||
fds[i].fd);
|
||||
mcode = curl_multi_socket_action(multi, fds[i].fd, act,
|
||||
&ev->running_handles);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -105,7 +105,7 @@ char *curl_easy_escape(CURL *handle, const char *string, int inlength)
|
|||
alloc *= 2;
|
||||
testing_ptr = realloc(ns, alloc);
|
||||
if(!testing_ptr) {
|
||||
free( ns );
|
||||
free(ns);
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ static CURLcode file_upload(struct connectdata *conn)
|
|||
|
||||
/*skip bytes before resume point*/
|
||||
if(data->state.resume_from) {
|
||||
if((curl_off_t)nread <= data->state.resume_from ) {
|
||||
if((curl_off_t)nread <= data->state.resume_from) {
|
||||
data->state.resume_from -= nread;
|
||||
nread = 0;
|
||||
buf2 = buf;
|
||||
|
|
|
|||
|
|
@ -632,7 +632,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
|||
else {
|
||||
if(((form->flags & HTTPPOST_FILENAME) ||
|
||||
(form->flags & HTTPPOST_BUFFER)) &&
|
||||
!form->contenttype ) {
|
||||
!form->contenttype) {
|
||||
char *f = form->flags & HTTPPOST_BUFFER?
|
||||
form->showfilename : form->value;
|
||||
|
||||
|
|
@ -1273,7 +1273,7 @@ CURLcode Curl_getformdata(struct SessionHandle *data,
|
|||
curList = file->contentheader;
|
||||
while(curList) {
|
||||
/* Process the additional headers specified for this form */
|
||||
result = AddFormDataf( &form, &size, "\r\n%s", curList->data );
|
||||
result = AddFormDataf(&form, &size, "\r\n%s", curList->data);
|
||||
if(result)
|
||||
break;
|
||||
curList = curList->next;
|
||||
|
|
@ -1386,7 +1386,7 @@ CURLcode Curl_getformdata(struct SessionHandle *data,
|
|||
* Curl_FormInit() inits the struct 'form' points to with the 'formdata'
|
||||
* and resets the 'sent' counter.
|
||||
*/
|
||||
int Curl_FormInit(struct Form *form, struct FormData *formdata )
|
||||
int Curl_FormInit(struct Form *form, struct FormData *formdata)
|
||||
{
|
||||
if(!formdata)
|
||||
return 1; /* error */
|
||||
|
|
@ -1499,9 +1499,9 @@ size_t Curl_FormReader(char *buffer,
|
|||
}
|
||||
do {
|
||||
|
||||
if((form->data->length - form->sent ) > wantedsize - gotsize) {
|
||||
if((form->data->length - form->sent) > wantedsize - gotsize) {
|
||||
|
||||
memcpy(buffer + gotsize , form->data->line + form->sent,
|
||||
memcpy(buffer + gotsize, form->data->line + form->sent,
|
||||
wantedsize - gotsize);
|
||||
|
||||
form->sent += wantedsize-gotsize;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -68,7 +68,7 @@ typedef struct FormInfo {
|
|||
struct FormInfo *more;
|
||||
} FormInfo;
|
||||
|
||||
int Curl_FormInit(struct Form *form, struct FormData *formdata );
|
||||
int Curl_FormInit(struct Form *form, struct FormData *formdata);
|
||||
|
||||
CURLcode Curl_getformdata(struct SessionHandle *data,
|
||||
struct FormData **,
|
||||
|
|
|
|||
24
lib/ftp.c
24
lib/ftp.c
|
|
@ -710,7 +710,7 @@ CURLcode Curl_GetFTPResponse(ssize_t *nreadp, /* return number of bytes read */
|
|||
/* check and reset timeout value every lap */
|
||||
timeout = Curl_pp_state_timeout(pp);
|
||||
|
||||
if(timeout <=0 ) {
|
||||
if(timeout <=0) {
|
||||
failf(data, "FTP response timeout");
|
||||
return CURLE_OPERATION_TIMEDOUT; /* already too little time */
|
||||
}
|
||||
|
|
@ -1036,7 +1036,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
|||
if(*string_ftpport == '[') {
|
||||
/* [ipv6]:port(-range) */
|
||||
ip_start = string_ftpport + 1;
|
||||
if((ip_end = strchr(string_ftpport, ']')) != NULL )
|
||||
if((ip_end = strchr(string_ftpport, ']')) != NULL)
|
||||
strncpy(addr, ip_start, ip_end - ip_start);
|
||||
}
|
||||
else
|
||||
|
|
@ -1057,7 +1057,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
|||
else
|
||||
#endif
|
||||
/* (ipv4|domain|interface):port(-range) */
|
||||
strncpy(addr, string_ftpport, ip_end - ip_start );
|
||||
strncpy(addr, string_ftpport, ip_end - ip_start);
|
||||
}
|
||||
else
|
||||
/* ipv4|interface */
|
||||
|
|
@ -1077,11 +1077,11 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
|||
|
||||
/* correct errors like:
|
||||
* :1234-1230
|
||||
* :-4711 , in this case port_min is (unsigned)-1,
|
||||
* :-4711, in this case port_min is (unsigned)-1,
|
||||
* therefore port_min > port_max for all cases
|
||||
* but port_max = (unsigned)-1
|
||||
*/
|
||||
if(port_min > port_max )
|
||||
if(port_min > port_max)
|
||||
port_min = port_max = 0;
|
||||
|
||||
|
||||
|
|
@ -1525,12 +1525,12 @@ static CURLcode ftp_state_list(struct connectdata *conn)
|
|||
}
|
||||
}
|
||||
|
||||
cmd = aprintf( "%s%s%s",
|
||||
data->set.str[STRING_CUSTOMREQUEST]?
|
||||
data->set.str[STRING_CUSTOMREQUEST]:
|
||||
(data->set.ftp_list_only?"NLST":"LIST"),
|
||||
lstArg? " ": "",
|
||||
lstArg? lstArg: "" );
|
||||
cmd = aprintf("%s%s%s",
|
||||
data->set.str[STRING_CUSTOMREQUEST]?
|
||||
data->set.str[STRING_CUSTOMREQUEST]:
|
||||
(data->set.ftp_list_only?"NLST":"LIST"),
|
||||
lstArg? " ": "",
|
||||
lstArg? lstArg: "");
|
||||
|
||||
if(!cmd) {
|
||||
free(lstArg);
|
||||
|
|
@ -1652,7 +1652,7 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
|
|||
/* 4. lower the infilesize counter */
|
||||
/* => transfer as usual */
|
||||
|
||||
if(data->state.resume_from < 0 ) {
|
||||
if(data->state.resume_from < 0) {
|
||||
/* Got no given size to start from, figure it out */
|
||||
PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file);
|
||||
state(conn, FTP_STOR_SIZE);
|
||||
|
|
|
|||
|
|
@ -778,7 +778,7 @@ CURLcode Curl_loadhostpairs(struct SessionHandle *data)
|
|||
char address[256];
|
||||
int port;
|
||||
|
||||
for(hostp = data->change.resolve; hostp; hostp = hostp->next ) {
|
||||
for(hostp = data->change.resolve; hostp; hostp = hostp->next) {
|
||||
if(!hostp->data)
|
||||
continue;
|
||||
if(hostp->data[0] == '-') {
|
||||
|
|
|
|||
|
|
@ -2148,7 +2148,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
|||
* file size before we continue this venture in the dark lands of HTTP.
|
||||
*********************************************************************/
|
||||
|
||||
if(data->state.resume_from < 0 ) {
|
||||
if(data->state.resume_from < 0) {
|
||||
/*
|
||||
* This is meant to get the size of the present remote-file by itself.
|
||||
* We don't support this now. Bail out!
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -37,6 +37,7 @@
|
|||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
/* !checksrc! disable SPACEBEFORECLOSE 1 */
|
||||
/*
|
||||
* Chunk format (simplified):
|
||||
*
|
||||
|
|
@ -80,7 +81,7 @@ static bool Curl_isxdigit(char digit)
|
|||
{
|
||||
return ( (digit >= 0x30 && digit <= 0x39) /* 0-9 */
|
||||
|| (digit >= 0x41 && digit <= 0x46) /* A-F */
|
||||
|| (digit >= 0x61 && digit <= 0x66) /* a-f */ ) ? TRUE : FALSE;
|
||||
|| (digit >= 0x61 && digit <= 0x66) /* a-f */) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
void Curl_httpchunk_init(struct connectdata *conn)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -228,7 +228,7 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
|
|||
goto quit;
|
||||
}
|
||||
|
||||
/* Get the URL scheme ( either ldap or ldaps ) */
|
||||
/* Get the URL scheme (either ldap or ldaps) */
|
||||
if(conn->given->flags & PROTOPT_SSL)
|
||||
ldap_ssl = 1;
|
||||
infof(data, "LDAP local: trying to establish %s connection\n",
|
||||
|
|
@ -717,7 +717,7 @@ static int str2scope (const char *p)
|
|||
return LDAP_SCOPE_BASE;
|
||||
if(strequal(p, "sub"))
|
||||
return LDAP_SCOPE_SUBTREE;
|
||||
if(strequal( p, "subtree"))
|
||||
if(strequal(p, "subtree"))
|
||||
return LDAP_SCOPE_SUBTREE;
|
||||
return (-1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -57,17 +57,17 @@ CURL_EXTERN void curl_memlog(const char *format, ...);
|
|||
|
||||
/* file descriptor manipulators */
|
||||
CURL_EXTERN curl_socket_t curl_socket(int domain, int type, int protocol,
|
||||
int line , const char *source);
|
||||
int line, const char *source);
|
||||
CURL_EXTERN void curl_mark_sclose(curl_socket_t sockfd,
|
||||
int line , const char *source);
|
||||
int line, const char *source);
|
||||
CURL_EXTERN int curl_sclose(curl_socket_t sockfd,
|
||||
int line , const char *source);
|
||||
int line, const char *source);
|
||||
CURL_EXTERN curl_socket_t curl_accept(curl_socket_t s, void *a, void *alen,
|
||||
int line, const char *source);
|
||||
#ifdef HAVE_SOCKETPAIR
|
||||
CURL_EXTERN int curl_socketpair(int domain, int type, int protocol,
|
||||
curl_socket_t socket_vector[2],
|
||||
int line , const char *source);
|
||||
int line, const char *source);
|
||||
#endif
|
||||
|
||||
/* FILE functions */
|
||||
|
|
|
|||
|
|
@ -1798,7 +1798,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||
result = Curl_speedcheck(data, now);
|
||||
|
||||
if(( (data->set.max_send_speed == 0) ||
|
||||
(data->progress.ulspeed < data->set.max_send_speed )) &&
|
||||
(data->progress.ulspeed < data->set.max_send_speed)) &&
|
||||
( (data->set.max_recv_speed == 0) ||
|
||||
(data->progress.dlspeed < data->set.max_recv_speed)))
|
||||
multistate(data, CURLM_STATE_PERFORM);
|
||||
|
|
@ -2478,7 +2478,7 @@ static CURLMcode add_next_timeout(struct timeval now,
|
|||
/* move over the timeout list for this specific handle and remove all
|
||||
timeouts that are now passed tense and store the next pending
|
||||
timeout in *tv */
|
||||
for(e = list->head; e; ) {
|
||||
for(e = list->head; e;) {
|
||||
struct curl_llist_element *n = e->next;
|
||||
long diff = curlx_tvdiff(*(struct timeval *)e->ptr, now);
|
||||
if(diff <= 0)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -88,7 +88,7 @@ CURLcode Curl_pp_statemach(struct pingpong *pp, bool block)
|
|||
struct SessionHandle *data=conn->data;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
if(timeout_ms <=0 ) {
|
||||
if(timeout_ms <=0) {
|
||||
failf(data, "server response timeout");
|
||||
return CURLE_OPERATION_TIMEDOUT; /* already too little time */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -71,14 +71,14 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
|
|||
/* this is a type this share will share */
|
||||
type = va_arg(param, int);
|
||||
share->specifier |= (1<<type);
|
||||
switch( type ) {
|
||||
switch(type) {
|
||||
case CURL_LOCK_DATA_DNS:
|
||||
break;
|
||||
|
||||
case CURL_LOCK_DATA_COOKIE:
|
||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
||||
if(!share->cookies) {
|
||||
share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE );
|
||||
share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE);
|
||||
if(!share->cookies)
|
||||
res = CURLSHE_NOMEM;
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
|
|||
/* this is a type this share will no longer share */
|
||||
type = va_arg(param, int);
|
||||
share->specifier &= ~(1<<type);
|
||||
switch( type ) {
|
||||
switch(type) {
|
||||
case CURL_LOCK_DATA_DNS:
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -173,8 +173,8 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
|
|||
unsigned short ip[4];
|
||||
Curl_printable_address(hp, buf, sizeof(buf));
|
||||
|
||||
if(4 == sscanf( buf, "%hu.%hu.%hu.%hu",
|
||||
&ip[0], &ip[1], &ip[2], &ip[3])) {
|
||||
if(4 == sscanf(buf, "%hu.%hu.%hu.%hu",
|
||||
&ip[0], &ip[1], &ip[2], &ip[3])) {
|
||||
/* Set DSTIP */
|
||||
socksreq[4] = (unsigned char)ip[0];
|
||||
socksreq[5] = (unsigned char)ip[1];
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1997 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1997 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -55,7 +55,7 @@ int Curl_splayremovebyaddr(struct Curl_tree *t,
|
|||
#define Curl_splaycomparekeys(i,j) ( ((i.tv_sec) < (j.tv_sec)) ? -1 : \
|
||||
( ((i.tv_sec) > (j.tv_sec)) ? 1 : \
|
||||
( ((i.tv_usec) < (j.tv_usec)) ? -1 : \
|
||||
( ((i.tv_usec) > (j.tv_usec)) ? 1 : 0 ))))
|
||||
( ((i.tv_usec) > (j.tv_usec)) ? 1 : 0))))
|
||||
|
||||
#ifdef DEBUGBUILD
|
||||
void Curl_splayprint(struct Curl_tree * t, int d, char output);
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ static CURLcode ssh_getworkingpath(struct connectdata *conn,
|
|||
if(!working_path)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
/* 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) {
|
||||
real_path = malloc(working_path_len+1);
|
||||
if(real_path == NULL) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
|
||||
#ifdef USE_WINSOCK
|
||||
typedef FARPROC WSOCK2_FUNC;
|
||||
static CURLcode check_wsock2 ( struct SessionHandle *data );
|
||||
static CURLcode check_wsock2 (struct SessionHandle *data);
|
||||
#endif
|
||||
|
||||
static
|
||||
|
|
@ -198,7 +198,7 @@ const struct Curl_handler Curl_handler_telnet = {
|
|||
|
||||
#ifdef USE_WINSOCK
|
||||
static CURLcode
|
||||
check_wsock2 ( struct SessionHandle *data )
|
||||
check_wsock2(struct SessionHandle *data)
|
||||
{
|
||||
int err;
|
||||
WORD wVersionRequested;
|
||||
|
|
|
|||
18
lib/tftp.c
18
lib/tftp.c
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -312,14 +312,14 @@ static const char *tftp_option_get(const char *buf, size_t len,
|
|||
{
|
||||
size_t loc;
|
||||
|
||||
loc = Curl_strnlen( buf, len );
|
||||
loc = Curl_strnlen(buf, len);
|
||||
loc++; /* NULL term */
|
||||
|
||||
if(loc >= len)
|
||||
return NULL;
|
||||
*option = buf;
|
||||
|
||||
loc += Curl_strnlen( buf+loc, len-loc );
|
||||
loc += Curl_strnlen(buf+loc, len-loc);
|
||||
loc++; /* NULL term */
|
||||
|
||||
if(loc > len)
|
||||
|
|
@ -352,7 +352,7 @@ static CURLcode tftp_parse_option_ack(tftp_state_data_t *state,
|
|||
if(checkprefix(option, TFTP_OPTION_BLKSIZE)) {
|
||||
long blksize;
|
||||
|
||||
blksize = strtol( value, NULL, 10 );
|
||||
blksize = strtol(value, NULL, 10);
|
||||
|
||||
if(!blksize) {
|
||||
failf(data, "invalid blocksize value in OACK packet");
|
||||
|
|
@ -384,7 +384,7 @@ static CURLcode tftp_parse_option_ack(tftp_state_data_t *state,
|
|||
else if(checkprefix(option, TFTP_OPTION_TSIZE)) {
|
||||
long tsize = 0;
|
||||
|
||||
tsize = strtol( value, NULL, 10 );
|
||||
tsize = strtol(value, NULL, 10);
|
||||
infof(data, "%s (%ld)\n", "tsize parsed from OACK", tsize);
|
||||
|
||||
/* tsize should be ignored on upload: Who cares about the size of the
|
||||
|
|
@ -405,7 +405,7 @@ static CURLcode tftp_parse_option_ack(tftp_state_data_t *state,
|
|||
static size_t tftp_option_add(tftp_state_data_t *state, size_t csize,
|
||||
char *buf, const char *option)
|
||||
{
|
||||
if(( strlen(option) + csize + 1 ) > (size_t)state->blksize)
|
||||
if(( strlen(option) + csize + 1) > (size_t)state->blksize)
|
||||
return 0;
|
||||
strcpy(buf, option);
|
||||
return strlen(option) + 1;
|
||||
|
|
@ -514,7 +514,7 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
|||
(char *)state->spacket.data+sbytes,
|
||||
TFTP_OPTION_BLKSIZE);
|
||||
sbytes += tftp_option_add(state, sbytes,
|
||||
(char *)state->spacket.data+sbytes, buf );
|
||||
(char *)state->spacket.data+sbytes, buf);
|
||||
|
||||
/* add timeout option */
|
||||
snprintf(buf, sizeof(buf), "%d", state->retry_time);
|
||||
|
|
@ -522,7 +522,7 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
|||
(char *)state->spacket.data+sbytes,
|
||||
TFTP_OPTION_INTERVAL);
|
||||
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
|
||||
|
|
@ -960,7 +960,7 @@ static CURLcode tftp_connect(struct connectdata *conn, bool *done)
|
|||
/* alloc pkt buffers based on specified blksize */
|
||||
if(conn->data->set.tftp_blksize) {
|
||||
blksize = (int)conn->data->set.tftp_blksize;
|
||||
if(blksize > TFTP_BLKSIZE_MAX || blksize < TFTP_BLKSIZE_MIN )
|
||||
if(blksize > TFTP_BLKSIZE_MAX || blksize < TFTP_BLKSIZE_MIN)
|
||||
return CURLE_TFTP_ILLEGAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -694,7 +694,7 @@ static CURLcode readwrite_data(struct SessionHandle *data,
|
|||
}
|
||||
|
||||
nread = (ssize_t) (k->maxdownload - k->bytecount);
|
||||
if(nread < 0 ) /* this should be unusual */
|
||||
if(nread < 0) /* this should be unusual */
|
||||
nread = 0;
|
||||
|
||||
k->keepon &= ~KEEP_RECV; /* we're done reading */
|
||||
|
|
@ -779,7 +779,7 @@ static CURLcode readwrite_data(struct SessionHandle *data,
|
|||
return result;
|
||||
}
|
||||
|
||||
} /* if(! header and data to read ) */
|
||||
} /* if(!header and data to read) */
|
||||
|
||||
if(conn->handler->readwrite &&
|
||||
(excess > 0 && !conn->bits.stream_was_rewound)) {
|
||||
|
|
@ -805,7 +805,7 @@ static CURLcode readwrite_data(struct SessionHandle *data,
|
|||
} while(data_pending(conn) && maxloops--);
|
||||
|
||||
if(((k->keepon & (KEEP_RECV|KEEP_SEND)) == KEEP_SEND) &&
|
||||
conn->bits.close ) {
|
||||
conn->bits.close) {
|
||||
/* When we've read the entire thing and the close bit is set, the server
|
||||
may now close the connection. If there's now any kind of sending going
|
||||
on from our side, we need to stop that immediately. */
|
||||
|
|
|
|||
|
|
@ -841,7 +841,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||
* Option that specifies how quickly an server response must be obtained
|
||||
* before it is considered failure. For pingpong protocols.
|
||||
*/
|
||||
data->set.server_response_timeout = va_arg( param , long ) * 1000;
|
||||
data->set.server_response_timeout = va_arg(param, long) * 1000;
|
||||
break;
|
||||
case CURLOPT_TFTP_NO_OPTIONS:
|
||||
/*
|
||||
|
|
@ -2148,7 +2148,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|||
*/
|
||||
data->set.buffer_size = va_arg(param, long);
|
||||
|
||||
if((data->set.buffer_size> (BUFSIZE -1 )) ||
|
||||
if((data->set.buffer_size> (BUFSIZE -1)) ||
|
||||
(data->set.buffer_size < 1))
|
||||
data->set.buffer_size = 0; /* huge internal default */
|
||||
|
||||
|
|
@ -5167,7 +5167,7 @@ static CURLcode override_login(struct SessionHandle *data,
|
|||
DOT_CHAR "netrc file; using defaults\n",
|
||||
conn->host.name);
|
||||
}
|
||||
else if(ret < 0 ) {
|
||||
else if(ret < 0) {
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ bool Curl_auth_digest_get_pair(const char *str, char *value, char *content,
|
|||
bool starts_with_quote = FALSE;
|
||||
bool escape = FALSE;
|
||||
|
||||
for(c = DIGEST_MAX_VALUE_LENGTH - 1; (*str && (*str != '=') && c--); )
|
||||
for(c = DIGEST_MAX_VALUE_LENGTH - 1; (*str && (*str != '=') && c--);)
|
||||
*value++ = *str++;
|
||||
*value = 0;
|
||||
|
||||
|
|
@ -689,7 +689,7 @@ CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
|
|||
|
||||
If the algorithm is "MD5-sess" then:
|
||||
|
||||
A1 = H( unq(username-value) ":" unq(realm-value) ":" passwd ) ":"
|
||||
A1 = H(unq(username-value) ":" unq(realm-value) ":" passwd) ":"
|
||||
unq(nonce-value) ":" unq(cnonce-value)
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2010, DirecTV, Contact: Eric Hu, <ehu@directv.com>.
|
||||
* Copyright (C) 2010 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 2010 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -518,7 +518,7 @@ static ssize_t axtls_send(struct connectdata *conn,
|
|||
|
||||
infof(conn->data, " axtls_send\n");
|
||||
|
||||
if(rc < 0 ) {
|
||||
if(rc < 0) {
|
||||
*err = map_error_to_curl(rc);
|
||||
rc = -1; /* generic error code for send failure */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1381,7 +1381,7 @@ static ssize_t gtls_send(struct connectdata *conn,
|
|||
{
|
||||
ssize_t rc = gnutls_record_send(conn->ssl[sockindex].session, mem, len);
|
||||
|
||||
if(rc < 0 ) {
|
||||
if(rc < 0) {
|
||||
*curlcode = (rc == GNUTLS_E_AGAIN)
|
||||
? CURLE_AGAIN
|
||||
: CURLE_SEND_ERROR;
|
||||
|
|
|
|||
|
|
@ -131,12 +131,12 @@ static void mbedtls_debug(void *context, int level, const char *line)
|
|||
const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_fr =
|
||||
{
|
||||
/* Hashes from SHA-1 and above */
|
||||
MBEDTLS_X509_ID_FLAG( MBEDTLS_MD_SHA1 ) |
|
||||
MBEDTLS_X509_ID_FLAG( MBEDTLS_MD_RIPEMD160 ) |
|
||||
MBEDTLS_X509_ID_FLAG( MBEDTLS_MD_SHA224 ) |
|
||||
MBEDTLS_X509_ID_FLAG( MBEDTLS_MD_SHA256 ) |
|
||||
MBEDTLS_X509_ID_FLAG( MBEDTLS_MD_SHA384 ) |
|
||||
MBEDTLS_X509_ID_FLAG( MBEDTLS_MD_SHA512 ),
|
||||
MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA1) |
|
||||
MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_RIPEMD160) |
|
||||
MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA224) |
|
||||
MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA256) |
|
||||
MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA384) |
|
||||
MBEDTLS_X509_ID_FLAG(MBEDTLS_MD_SHA512),
|
||||
0xFFFFFFF, /* Any PK alg */
|
||||
0xFFFFFFF, /* Any curve */
|
||||
1024, /* RSA min key len */
|
||||
|
|
@ -322,8 +322,8 @@ mbedtls_connect_step1(struct connectdata *conn,
|
|||
}
|
||||
|
||||
/* new profile with RSA min key len = 1024 ... */
|
||||
mbedtls_ssl_conf_cert_profile( &connssl->config,
|
||||
&mbedtls_x509_crt_profile_fr);
|
||||
mbedtls_ssl_conf_cert_profile(&connssl->config,
|
||||
&mbedtls_x509_crt_profile_fr);
|
||||
|
||||
switch(data->set.ssl.version) {
|
||||
case CURL_SSLVERSION_DEFAULT:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012 - 2015, Marc Hoersken, <info@marc-hoersken.de>
|
||||
* Copyright (C) 2012 - 2016, Marc Hoersken, <info@marc-hoersken.de>
|
||||
* Copyright (C) 2012, Mark Salisbury, <mark.salisbury@hp.com>
|
||||
* Copyright (C) 2012 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
|
|
@ -1326,7 +1326,7 @@ bool Curl_schannel_data_pending(const struct connectdata *conn, int sockindex)
|
|||
|
||||
if(connssl->use) /* SSL/TLS is in use */
|
||||
return (connssl->encdata_offset > 0 ||
|
||||
connssl->decdata_offset > 0 ) ? TRUE : FALSE;
|
||||
connssl->decdata_offset > 0) ? TRUE : FALSE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue