diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dict.c | 6 | ||||
-rw-r--r-- | lib/easy.c | 5 | ||||
-rw-r--r-- | lib/escape.c | 2 | ||||
-rw-r--r-- | lib/hostip.c | 4 | ||||
-rw-r--r-- | lib/http.c | 8 | ||||
-rw-r--r-- | lib/http.h | 4 | ||||
-rw-r--r-- | lib/multi.c | 2 | ||||
-rw-r--r-- | lib/multiif.h | 2 | ||||
-rw-r--r-- | lib/url.c | 51 | ||||
-rw-r--r-- | lib/urldata.h | 4 |
10 files changed, 46 insertions, 42 deletions
diff --git a/lib/dict.c b/lib/dict.c index c1da557e2..43bc72ebf 100644 --- a/lib/dict.c +++ b/lib/dict.c @@ -82,13 +82,13 @@ /* The last #include file should be: */ #include "memdebug.h" -static char *unescape_word(struct SessionHandle *data, char *inp) +static char *unescape_word(struct SessionHandle *data, const char *inp) { char *newp; char *dictp; char *ptr; int len; - unsigned char byte; + char byte; int olen=0; newp = curl_easy_unescape(data, inp, 0, &len); @@ -100,7 +100,7 @@ static char *unescape_word(struct SessionHandle *data, char *inp) /* According to RFC2229 section 2.2, these letters need to be escaped with \[letter] */ for(ptr = newp; - (byte = (unsigned char)*ptr) != 0; + (byte = *ptr) != 0; ptr++) { if ((byte <= 32) || (byte == 127) || (byte == '\'') || (byte == '\"') || (byte == '\\')) { diff --git a/lib/easy.c b/lib/easy.c index 54915fb88..d008bb0f6 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -886,7 +886,8 @@ CURLcode Curl_convert_from_utf8(struct SessionHandle *data, } else { #ifdef HAVE_ICONV /* do the translation ourselves */ - char *input_ptr, *output_ptr; + const char *input_ptr; + char *output_ptr; size_t in_bytes, out_bytes, rc; int error; @@ -907,7 +908,7 @@ CURLcode Curl_convert_from_utf8(struct SessionHandle *data, /* call iconv */ input_ptr = output_ptr = buffer; in_bytes = out_bytes = length; - rc = iconv(data->utf8_cd, (const char**)&input_ptr, &in_bytes, + rc = iconv(data->utf8_cd, &input_ptr, &in_bytes, &output_ptr, &out_bytes); if ((rc == ICONV_ERROR) || (in_bytes != 0)) { error = ERRNO; diff --git a/lib/escape.c b/lib/escape.c index 06ac04d71..fd08451de 100644 --- a/lib/escape.c +++ b/lib/escape.c @@ -59,7 +59,7 @@ char *curl_easy_escape(CURL *handle, const char *string, int inlength) size_t alloc = (inlength?(size_t)inlength:strlen(string))+1; char *ns; char *testing_ptr = NULL; - unsigned char in; + char in; size_t newlen = alloc; int strindex=0; size_t length; diff --git a/lib/hostip.c b/lib/hostip.c index 189d0683d..02f4da06f 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -200,7 +200,7 @@ create_hostcache_id(const char *server, int port) } struct hostcache_prune_data { - int cache_timeout; + long cache_timeout; time_t now; }; @@ -232,7 +232,7 @@ hostcache_timestamp_remove(void *datap, void *hc) * Prune the DNS cache. This assumes that a lock has already been taken. */ static void -hostcache_prune(struct curl_hash *hostcache, int cache_timeout, time_t now) +hostcache_prune(struct curl_hash *hostcache, long cache_timeout, time_t now) { struct hostcache_prune_data user; diff --git a/lib/http.c b/lib/http.c index e72ed43e1..715031658 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1055,7 +1055,7 @@ CURLcode add_buffer(send_buffer *in, const void *inptr, size_t size) * Pass headers WITH the colon. */ bool -Curl_compareheader(char *headerline, /* line to check */ +Curl_compareheader(const char *headerline, /* line to check */ const char *header, /* header keyword _with_ colon */ const char *content) /* content string to find */ { @@ -1067,8 +1067,8 @@ Curl_compareheader(char *headerline, /* line to check */ size_t hlen = strlen(header); size_t clen; size_t len; - char *start; - char *end; + const char *start; + const char *end; if(!strnequal(headerline, header, hlen)) return FALSE; /* doesn't start with header */ @@ -1119,7 +1119,7 @@ Curl_compareheader(char *headerline, /* line to check */ CURLcode Curl_proxyCONNECT(struct connectdata *conn, int sockindex, char *hostname, - int remote_port) + unsigned short remote_port) { int subversion=0; struct SessionHandle *data=conn->data; diff --git a/lib/http.h b/lib/http.h index 0f4b58f72..cd75f0802 100644 --- a/lib/http.h +++ b/lib/http.h @@ -24,14 +24,14 @@ * $Id$ ***************************************************************************/ #ifndef CURL_DISABLE_HTTP -bool Curl_compareheader(char *headerline, /* line to check */ +bool Curl_compareheader(const char *headerline, /* line to check */ const char *header, /* header keyword _with_ colon */ const char *content); /* content string to find */ /* ftp can use this as well */ CURLcode Curl_proxyCONNECT(struct connectdata *conn, int tunnelsocket, - char *hostname, int remote_port); + char *hostname, unsigned short remote_port); /* protocol-specific functions set up to be called by the main engine */ CURLcode Curl_http(struct connectdata *conn, bool *done); diff --git a/lib/multi.c b/lib/multi.c index 0bdfd6170..42294eeb6 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -690,7 +690,7 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle, return CURLM_BAD_EASY_HANDLE; /* twasn't found */ } -bool Curl_multi_canPipeline(struct Curl_multi* multi) +bool Curl_multi_canPipeline(const struct Curl_multi* multi) { return multi->pipelining_enabled; } diff --git a/lib/multiif.h b/lib/multiif.h index 2a8b06c27..35bfbcc5f 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -30,7 +30,7 @@ void Curl_expire(struct SessionHandle *data, long milli); void Curl_multi_rmeasy(void *multi, CURL *data); -bool Curl_multi_canPipeline(struct Curl_multi* multi); +bool Curl_multi_canPipeline(const struct Curl_multi* multi); void Curl_multi_handlePipeBreak(struct SessionHandle *data); /* the write bits start at bit 16 for the *getsock() bitmap */ @@ -158,8 +158,8 @@ static bool ConnectionExists(struct SessionHandle *data, struct connectdata **usethis); static long ConnectionStore(struct SessionHandle *data, struct connectdata *conn); -static bool IsPipeliningPossible(struct SessionHandle *handle); -static bool IsPipeliningEnabled(struct SessionHandle *handle); +static bool IsPipeliningPossible(const struct SessionHandle *handle); +static bool IsPipeliningEnabled(const struct SessionHandle *handle); static void conn_free(struct connectdata *conn); static void signalPipeClose(struct curl_llist *pipe); @@ -292,7 +292,7 @@ CURLcode Curl_close(struct SessionHandle *data) if(data->state.connc && data->state.connc->type == CONNCACHE_MULTI) { struct conncache *c = data->state.connc; - int i; + long i; struct curl_llist *pipe; struct curl_llist_element *curr; struct connectdata *connptr; @@ -536,7 +536,7 @@ CURLcode Curl_ch_connc(struct SessionHandle *data, void Curl_rm_connc(struct conncache *c) { if(c->connects) { - int i; + long i; for(i = 0; i < c->num; ++i) conn_free(c->connects[i]); @@ -2010,7 +2010,7 @@ static bool SocketIsDead(curl_socket_t sock) return ret_val; } -static bool IsPipeliningPossible(struct SessionHandle *handle) +static bool IsPipeliningPossible(const struct SessionHandle *handle) { if (handle->multi && Curl_multi_canPipeline(handle->multi) && (handle->set.httpreq == HTTPREQ_GET || @@ -2021,7 +2021,7 @@ static bool IsPipeliningPossible(struct SessionHandle *handle) return FALSE; } -static bool IsPipeliningEnabled(struct SessionHandle *handle) +static bool IsPipeliningEnabled(const struct SessionHandle *handle) { if (handle->multi && Curl_multi_canPipeline(handle->multi)) return TRUE; @@ -2430,24 +2430,27 @@ static CURLcode ConnectPlease(struct SessionHandle *data, conn->dns_entry = hostaddr; conn->ip_addr = addr; - Curl_store_ip_addr(conn); + result = Curl_store_ip_addr(conn); - switch(data->set.proxytype) { - case CURLPROXY_SOCKS5: - result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, conn->host.name, - conn->remote_port, FIRSTSOCKET, conn); - break; - case CURLPROXY_HTTP: - /* do nothing here. handled later. */ - break; - case CURLPROXY_SOCKS4: - result = Curl_SOCKS4(conn->proxyuser, conn->host.name, conn->remote_port, - FIRSTSOCKET, conn); - break; - default: - failf(data, "unknown proxytype option given"); - result = CURLE_COULDNT_CONNECT; - break; + if(CURLE_OK == result) { + + switch(data->set.proxytype) { + case CURLPROXY_SOCKS5: + result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, conn->host.name, + conn->remote_port, FIRSTSOCKET, conn); + break; + case CURLPROXY_HTTP: + /* do nothing here. handled later. */ + break; + case CURLPROXY_SOCKS4: + result = Curl_SOCKS4(conn->proxyuser, conn->host.name, conn->remote_port, + FIRSTSOCKET, conn); + break; + default: + failf(data, "unknown proxytype option given"); + result = CURLE_COULDNT_CONNECT; + break; + } } } if(result) @@ -2867,7 +2870,7 @@ static CURLcode setup_range(struct SessionHandle *data) req->resume_from = data->set.set_resume_from; if (req->resume_from || data->set.str[STRING_SET_RANGE]) { - if (req->rangestringalloc == TRUE) + if (req->rangestringalloc) free(req->range); if(req->resume_from) diff --git a/lib/urldata.h b/lib/urldata.h index 5975406fa..e760e0c39 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -132,7 +132,7 @@ of need. */ #define HEADERSIZE 256 -#define CURLEASY_MAGIC_NUMBER 0xc0dedbad +#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU /* Just a convenience macro to get the larger value out of two given. We prefix with CURL to prevent name collisions. */ @@ -1354,7 +1354,7 @@ struct UserDefined { curl_proxytype proxytype; /* what kind of proxy that is in use */ - int dns_cache_timeout; /* DNS cache timeout */ + long dns_cache_timeout; /* DNS cache timeout */ long buffer_size; /* size of receive buffer to use */ void *private_data; /* Private data */ |