clang-tidy: sync argument names in prototype and definition
No binary (build failed)
—
(log yok)
| @@ -14,4 +14,5 @@ Checks: >- | |
| -clang-diagnostic-nullability-extension, | |
| bugprone-suspicious-realloc-usage, | |
| misc-const-correctness, | |
| - | portability-* |
| + | portability-*, |
| + | readability-named-parameter |
| @@ -329,12 +329,12 @@ CURLcode Curl_altsvc_ctrl(struct Curl_easy *data, const long ctrl) | |
| * Curl_altsvc_cleanup() frees an altsvc cache instance and all associated | |
| * resources. | |
| */ | |
| - | void Curl_altsvc_cleanup(struct altsvcinfo **altsvcp) |
| + | void Curl_altsvc_cleanup(struct altsvcinfo **asi) |
| { | |
| - | if(*altsvcp) { |
| + | if(*asi) { |
| struct Curl_llist_node *e; | |
| struct Curl_llist_node *n; | |
| - | struct altsvcinfo *altsvc = *altsvcp; |
| + | struct altsvcinfo *altsvc = *asi; |
| for(e = Curl_llist_head(&altsvc->list); e; e = n) { | |
| struct altsvc *as = Curl_node_elem(e); | |
| n = Curl_node_next(e); | |
| @@ -342,7 +342,7 @@ void Curl_altsvc_cleanup(struct altsvcinfo **altsvcp) | |
| } | |
| curlx_free(altsvc->filename); | |
| curlx_free(altsvc); | |
| - | *altsvcp = NULL; /* clear the pointer */ |
| + | *asi = NULL; /* clear the pointer */ |
| } | |
| } | |
| @@ -350,21 +350,21 @@ void Curl_altsvc_cleanup(struct altsvcinfo **altsvcp) | |
| * Curl_altsvc_save() writes the altsvc cache to a file. | |
| */ | |
| CURLcode Curl_altsvc_save(struct Curl_easy *data, | |
| - | struct altsvcinfo *altsvc, const char *file) |
| + | struct altsvcinfo *asi, const char *file) |
| { | |
| CURLcode result = CURLE_OK; | |
| FILE *out; | |
| char *tempstore = NULL; | |
| - | if(!altsvc) |
| + | if(!asi) |
| /* no cache activated */ | |
| return CURLE_OK; | |
| /* if not new name is given, use the one we stored from the load */ | |
| - | if(!file && altsvc->filename) |
| - | file = altsvc->filename; |
| + | if(!file && asi->filename) |
| + | file = asi->filename; |
| - | if((altsvc->flags & CURLALTSVC_READONLYFILE) || !file || !file[0]) |
| + | if((asi->flags & CURLALTSVC_READONLYFILE) || !file || !file[0]) |
| /* marked as read-only, no file or zero length filename */ | |
| return CURLE_OK; | |
| @@ -375,7 +375,7 @@ CURLcode Curl_altsvc_save(struct Curl_easy *data, | |
| fputs("# Your alt-svc cache. https://curl.se/docs/alt-svc.html\n" | |
| "# This file was generated by libcurl! Edit at your own risk.\n", | |
| out); | |
| - | for(e = Curl_llist_head(&altsvc->list); e; e = n) { |
| + | for(e = Curl_llist_head(&asi->list); e; e = n) { |
| struct altsvc *as = Curl_node_elem(e); | |
| n = Curl_node_next(e); | |
| result = altsvc_out(as, out); | |
| @@ -55,10 +55,10 @@ CURLcode Curl_altsvc_load(struct altsvcinfo *asi, const char *file); | |
| CURLcode Curl_altsvc_save(struct Curl_easy *data, | |
| struct altsvcinfo *asi, const char *file); | |
| CURLcode Curl_altsvc_ctrl(struct Curl_easy *data, const long ctrl); | |
| - | void Curl_altsvc_cleanup(struct altsvcinfo **altsvc); |
| + | void Curl_altsvc_cleanup(struct altsvcinfo **asi); |
| CURLcode Curl_altsvc_parse(struct Curl_easy *data, | |
| - | struct altsvcinfo *altsvc, const char *value, |
| - | enum alpnid srcalpn, const char *srchost, |
| + | struct altsvcinfo *asi, const char *value, |
| + | enum alpnid srcalpnid, const char *srchost, |
| unsigned short srcport); | |
| bool Curl_altsvc_lookup(struct altsvcinfo *asi, | |
| enum alpnid srcalpnid, const char *srchost, | |
| @@ -380,14 +380,14 @@ out: | |
| * CURLE_OPERATION_TIMEDOUT if a time-out occurred, or other errors. | |
| */ | |
| CURLcode Curl_async_await(struct Curl_easy *data, | |
| - | struct Curl_dns_entry **entry) |
| + | struct Curl_dns_entry **dns) |
| { | |
| struct async_ares_ctx *ares = &data->state.async.ares; | |
| CURLcode result = CURLE_OK; | |
| timediff_t timeout_ms; | |
| - | DEBUGASSERT(entry); |
| - | *entry = NULL; /* clear on entry */ |
| + | DEBUGASSERT(dns); |
| + | *dns = NULL; /* clear on entry */ |
| timeout_ms = Curl_timeleft_ms(data); | |
| if(timeout_ms < 0) { | |
| @@ -426,7 +426,7 @@ CURLcode Curl_async_await(struct Curl_easy *data, | |
| if(Curl_ares_perform(ares->channel, call_timeout_ms) < 0) | |
| return CURLE_UNRECOVERABLE_POLL; | |
| - | result = Curl_async_is_resolved(data, entry); |
| + | result = Curl_async_is_resolved(data, dns); |
| if(result || data->state.async.done) | |
| break; | |
| @@ -449,7 +449,7 @@ CURLcode Curl_async_await(struct Curl_easy *data, | |
| /* Operation complete, if the lookup was successful we now have the entry | |
| in the cache. */ | |
| data->state.async.done = TRUE; | |
| - | *entry = data->state.async.dns; |
| + | *dns = data->state.async.dns; |
| if(result) | |
| ares_cancel(ares->channel); | |
| @@ -101,8 +101,8 @@ void Curl_async_global_cleanup(void) | |
| #endif | |
| } | |
| - | static void async_thrdd_destroy(struct Curl_easy *); |
| - | static void async_thrdd_shutdown(struct Curl_easy *); |
| + | static void async_thrdd_destroy(struct Curl_easy *data); |
| + | static void async_thrdd_shutdown(struct Curl_easy *data); |
| CURLcode Curl_async_get_impl(struct Curl_easy *data, void **impl) | |
| { | |
| @@ -552,11 +552,11 @@ void Curl_async_thrdd_destroy(struct Curl_easy *data) | |
| * This is the version for resolves-in-a-thread. | |
| */ | |
| CURLcode Curl_async_await(struct Curl_easy *data, | |
| - | struct Curl_dns_entry **entry) |
| + | struct Curl_dns_entry **dns) |
| { | |
| struct async_thrdd_ctx *thrdd = &data->state.async.thrdd; | |
| if(thrdd->addr) | |
| - | return asyn_thrdd_await(data, thrdd->addr, entry); |
| + | return asyn_thrdd_await(data, thrdd->addr, dns); |
| return CURLE_FAILED_INIT; | |
| } | |
| @@ -70,7 +70,7 @@ void Curl_async_global_cleanup(void); | |
| * Get the resolver implementation instance (c-ares channel) or NULL | |
| * for passing to application callback. | |
| */ | |
| - | CURLcode Curl_async_get_impl(struct Curl_easy *easy, void **impl); |
| + | CURLcode Curl_async_get_impl(struct Curl_easy *data, void **impl); |
| /* Curl_async_pollset() | |
| * | |
| @@ -106,7 +106,7 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data, | |
| * CURLE_OPERATION_TIMEDOUT if a time-out occurred, or other errors. | |
| */ | |
| CURLcode Curl_async_await(struct Curl_easy *data, | |
| - | struct Curl_dns_entry **dnsentry); |
| + | struct Curl_dns_entry **dns); |
| /* | |
| * Curl_async_getaddrinfo() - when using this resolver | |
| @@ -27,7 +27,7 @@ | |
| #if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP) | |
| - | CURLcode Curl_cf_h1_proxy_insert_after(struct Curl_cfilter *cf, |
| + | CURLcode Curl_cf_h1_proxy_insert_after(struct Curl_cfilter *cf_at, |
| struct Curl_easy *data); | |
| extern struct Curl_cftype Curl_cft_h1_proxy; | |
| @@ -136,22 +136,22 @@ void Curl_conn_cf_discard_chain(struct Curl_cfilter **pcf, | |
| } | |
| void Curl_conn_cf_discard_all(struct Curl_easy *data, | |
| - | struct connectdata *conn, int index) |
| + | struct connectdata *conn, int sockindex) |
| { | |
| - | Curl_conn_cf_discard_chain(&conn->cfilter[index], data); |
| + | Curl_conn_cf_discard_chain(&conn->cfilter[sockindex], data); |
| } | |
| - | void Curl_conn_close(struct Curl_easy *data, int index) |
| + | void Curl_conn_close(struct Curl_easy *data, int sockindex) |
| { | |
| struct Curl_cfilter *cf; | |
| DEBUGASSERT(data->conn); | |
| /* it is valid to call that without filters being present */ | |
| - | cf = data->conn->cfilter[index]; |
| + | cf = data->conn->cfilter[sockindex]; |
| if(cf) { | |
| cf->cft->do_close(cf, data); | |
| } | |
| - | Curl_shutdown_clear(data, index); |
| + | Curl_shutdown_clear(data, sockindex); |
| } | |
| CURLcode Curl_conn_shutdown(struct Curl_easy *data, int sockindex, bool *done) | |
| @@ -209,14 +209,14 @@ CURLcode Curl_conn_shutdown(struct Curl_easy *data, int sockindex, bool *done) | |
| return result; | |
| } | |
| - | CURLcode Curl_cf_recv(struct Curl_easy *data, int num, char *buf, |
| + | CURLcode Curl_cf_recv(struct Curl_easy *data, int sockindex, char *buf, |
| size_t len, size_t *pnread) | |
| { | |
| struct Curl_cfilter *cf; | |
| DEBUGASSERT(data); | |
| DEBUGASSERT(data->conn); | |
| - | cf = data->conn->cfilter[num]; |
| + | cf = data->conn->cfilter[sockindex]; |
| while(cf && !cf->connected) | |
| cf = cf->next; | |
| if(cf) | |
| @@ -227,19 +227,19 @@ CURLcode Curl_cf_recv(struct Curl_easy *data, int num, char *buf, | |
| return CURLE_FAILED_INIT; | |
| } | |
| - | CURLcode Curl_cf_send(struct Curl_easy *data, int num, |
| - | const uint8_t *mem, size_t len, bool eos, |
| + | CURLcode Curl_cf_send(struct Curl_easy *data, int sockindex, |
| + | const uint8_t *buf, size_t len, bool eos, |
| size_t *pnwritten) | |
| { | |
| struct Curl_cfilter *cf; | |
| DEBUGASSERT(data); | |
| DEBUGASSERT(data->conn); | |
| - | cf = data->conn->cfilter[num]; |
| + | cf = data->conn->cfilter[sockindex]; |
| while(cf && !cf->connected) | |
| cf = cf->next; | |
| if(cf) { | |
| - | return cf->cft->do_send(cf, data, mem, len, eos, pnwritten); |
| + | return cf->cft->do_send(cf, data, buf, len, eos, pnwritten); |
| } | |
| failf(data, "send: no filter connected"); | |
| DEBUGASSERT(0); | |
| @@ -328,17 +328,17 @@ out: | |
| void Curl_conn_cf_add(struct Curl_easy *data, | |
| struct connectdata *conn, | |
| - | int index, |
| + | int sockindex, |
| struct Curl_cfilter *cf) | |
| { | |
| DEBUGASSERT(conn); | |
| DEBUGASSERT(!cf->conn); | |
| DEBUGASSERT(!cf->next); | |
| - | cf->next = conn->cfilter[index]; |
| + | cf->next = conn->cfilter[sockindex]; |
| cf->conn = conn; | |
| - | cf->sockindex = index; |
| - | conn->cfilter[index] = cf; |
| + | cf->sockindex = sockindex; |
| + | conn->cfilter[sockindex] = cf; |
| CURL_TRC_CF(data, cf, "added"); | |
| } | |
| @@ -1060,23 +1060,23 @@ int Curl_conn_sockindex(struct Curl_easy *data, curl_socket_t sockfd) | |
| } | |
| CURLcode Curl_conn_recv(struct Curl_easy *data, int sockindex, | |
| - | char *buf, size_t blen, size_t *pnread) |
| + | char *buf, size_t len, size_t *pnread) |
| { | |
| DEBUGASSERT(data); | |
| DEBUGASSERT(data->conn); | |
| if(!CONN_SOCK_IDX_VALID(sockindex)) | |
| return CURLE_BAD_FUNCTION_ARGUMENT; | |
| if(data && data->conn && data->conn->recv[sockindex]) | |
| - | return data->conn->recv[sockindex](data, sockindex, buf, blen, pnread); |
| + | return data->conn->recv[sockindex](data, sockindex, buf, len, pnread); |
| *pnread = 0; | |
| return CURLE_FAILED_INIT; | |
| } | |
| CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, | |
| - | const void *buf, size_t blen, bool eos, |
| + | const void *buf, size_t len, bool eos, |
| size_t *pnwritten) | |
| { | |
| - | size_t write_len = blen; |
| + | size_t write_len = len; |
| DEBUGASSERT(data); | |
| DEBUGASSERT(data->conn); | |
| @@ -1094,7 +1094,7 @@ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, | |
| } | |
| } | |
| #endif | |
| - | if(write_len != blen) |
| + | if(write_len != len) |
| eos = FALSE; | |
| if(data && data->conn && data->conn->send[sockindex]) | |
| return data->conn->send[sockindex](data, sockindex, buf, write_len, eos, | |
| @@ -312,8 +312,7 @@ void Curl_conn_cf_discard_chain(struct Curl_cfilter **pcf, | |
| * Remove and destroy all filters at chain `sockindex` on connection `conn`. | |
| */ | |
| void Curl_conn_cf_discard_all(struct Curl_easy *data, | |
| - | struct connectdata *conn, |
| - | int sockindex); |
| + | struct connectdata *conn, int sockindex); |
| CURLcode Curl_conn_cf_connect(struct Curl_cfilter *cf, | |
| struct Curl_easy *data, | |
| @@ -608,15 +607,14 @@ int Curl_conn_sockindex(struct Curl_easy *data, curl_socket_t sockfd); | |
| * Will return CURLE_AGAIN iff blocked on receiving. | |
| */ | |
| CURLcode Curl_conn_recv(struct Curl_easy *data, int sockindex, | |
| - | char *buf, size_t buffersize, |
| - | size_t *pnread); |
| + | char *buf, size_t len, size_t *pnread); |
| /* | |
| * Send data on the connection, using FIRSTSOCKET/SECONDARYSOCKET. | |
| * Will return CURLE_AGAIN iff blocked on sending. | |
| */ | |
| CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, | |
| - | const void *buf, size_t blen, bool eos, |
| + | const void *buf, size_t len, bool eos, |
| size_t *pnwritten); | |
| /** | |
| @@ -68,7 +68,7 @@ void Curl_cpool_init(struct cpool *cpool, | |
| size_t size); | |
| /* Destroy all connections and free all members */ | |
| - | void Curl_cpool_destroy(struct cpool *connc); |
| + | void Curl_cpool_destroy(struct cpool *cpool); |
| /* Init the transfer to be used within its connection pool. | |
| * Assigns `data->id`. */ | |
| @@ -32,7 +32,7 @@ struct ip_quadruple; | |
| struct Curl_str; | |
| enum alpnid Curl_alpn2alpnid(const unsigned char *name, size_t len); | |
| - | enum alpnid Curl_str2alpnid(const struct Curl_str *str); |
| + | enum alpnid Curl_str2alpnid(const struct Curl_str *cstr); |
| /* generic function that returns how much time there is left to run, according | |
| to the timeouts set */ | |
| @@ -76,7 +76,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, | |
| char *addr, uint16_t *port); | |
| /* | |
| - | * Curl_conncontrol() marks the end of a connection/stream. The 'closeit' |
| + | * Curl_conncontrol() marks the end of a connection/stream. The 'ctrl' |
| * argument specifies if it is the end of a connection or a stream. | |
| * | |
| * For stream-based protocols (such as HTTP/2), a stream close will not cause | |
| @@ -92,7 +92,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, | |
| #define CONNCTRL_STREAM 2 | |
| void Curl_conncontrol(struct connectdata *conn, | |
| - | int closeit |
| + | int ctrl |
| #if defined(DEBUGBUILD) && defined(CURLVERBOSE) | |
| , const char *reason | |
| #endif | |
| @@ -111,15 +111,18 @@ struct connectdata; | |
| bool Curl_secure_context(struct connectdata *conn, const char *host); | |
| CURLcode Curl_cookie_add(struct Curl_easy *data, | |
| - | struct CookieInfo *c, bool header, |
| - | bool noexpiry, const char *lineptr, |
| - | const char *domain, const char *path, |
| + | struct CookieInfo *ci, |
| + | bool httpheader, |
| + | bool noexpire, |
| + | const char *lineptr, |
| + | const char *domain, |
| + | const char *path, |
| bool secure) WARN_UNUSED_RESULT; | |
| CURLcode Curl_cookie_getlist(struct Curl_easy *data, struct connectdata *conn, | |
| bool *okay, const char *host, | |
| struct Curl_llist *list) WARN_UNUSED_RESULT; | |
| - | void Curl_cookie_clearall(struct CookieInfo *cookies); |
| - | void Curl_cookie_clearsess(struct CookieInfo *cookies); |
| + | void Curl_cookie_clearall(struct CookieInfo *ci); |
| + | void Curl_cookie_clearsess(struct CookieInfo *ci); |
| #if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES) | |
| #define Curl_cookie_list(x) NULL | |
| @@ -130,7 +133,7 @@ void Curl_cookie_clearsess(struct CookieInfo *cookies); | |
| #define Curl_flush_cookies(x, y) Curl_nop_stmt | |
| #else | |
| void Curl_flush_cookies(struct Curl_easy *data, bool cleanup); | |
| - | void Curl_cookie_cleanup(struct CookieInfo *c); |
| + | void Curl_cookie_cleanup(struct CookieInfo *ci); |
| struct CookieInfo *Curl_cookie_init(void); | |
| struct curl_slist *Curl_cookie_list(struct Curl_easy *data); | |
| CURLcode Curl_cookie_loadfiles(struct Curl_easy *data) WARN_UNUSED_RESULT; | |
| @@ -41,12 +41,12 @@ void Curl_cshutdn_run_once(struct Curl_easy *data, | |
| bool *done); | |
| /* Terminates the connection, e.g. closes and destroys it. | |
| - | * If `run_shutdown` is TRUE, the shutdown will be run once before |
| + | * If `do_shutdown` is TRUE, the shutdown will be run once before |
| * terminating it. | |
| * Takes ownership of `conn`. */ | |
| void Curl_cshutdn_terminate(struct Curl_easy *data, | |
| struct connectdata *conn, | |
| - | bool run_shutdown); |
| + | bool do_shutdown); |
| /* A `cshutdown` is always owned by a multi handle to maintain | |
| * the connections to be shut down. It registers timers and | |
| @@ -404,19 +404,19 @@ static CURLcode ip2addr(struct Curl_addrinfo **addrp, int af, | |
| * Given an IPv4 or IPv6 dotted string address, this converts it to a proper | |
| * allocated Curl_addrinfo struct and returns it. | |
| */ | |
| - | CURLcode Curl_str2addr(const char *address, int port, |
| + | CURLcode Curl_str2addr(const char *dotted, int port, |
| struct Curl_addrinfo **addrp) | |
| { | |
| struct in_addr in; | |
| - | if(curlx_inet_pton(AF_INET, address, &in) > 0) |
| + | if(curlx_inet_pton(AF_INET, dotted, &in) > 0) |
| /* This is a dotted IP address 123.123.123.123-style */ | |
| - | return ip2addr(addrp, AF_INET, &in, address, port); |
| + | return ip2addr(addrp, AF_INET, &in, dotted, port); |
| #ifdef USE_IPV6 | |
| { | |
| struct in6_addr in6; | |
| - | if(curlx_inet_pton(AF_INET6, address, &in6) > 0) |
| + | if(curlx_inet_pton(AF_INET6, dotted, &in6) > 0) |
| /* This is a dotted IPv6 address ::1-style */ | |
| - | return ip2addr(addrp, AF_INET6, &in6, address, port); |
| + | return ip2addr(addrp, AF_INET6, &in6, dotted, port); |
| } | |
| #endif | |
| return CURLE_BAD_FUNCTION_ARGUMENT; /* bad input format */ | |
| @@ -57,10 +57,10 @@ struct HMAC_context { | |
| struct HMAC_context *Curl_HMAC_init(const struct HMAC_params *hashparams, | |
| const unsigned char *key, | |
| unsigned int keylen); | |
| - | int Curl_HMAC_update(struct HMAC_context *context, |
| + | int Curl_HMAC_update(struct HMAC_context *ctxt, |
| const unsigned char *data, | |
| unsigned int len); | |
| - | int Curl_HMAC_final(struct HMAC_context *context, unsigned char *result); |
| + | int Curl_HMAC_final(struct HMAC_context *ctxt, unsigned char *output); |
| CURLcode Curl_hmacit(const struct HMAC_params *hashparams, | |
| const unsigned char *key, const size_t keylen, | |
| @@ -58,7 +58,7 @@ CURLcode Curl_md5it(unsigned char *output, const unsigned char *input, | |
| struct MD5_context *Curl_MD5_init(const struct MD5_params *md5params); | |
| CURLcode Curl_MD5_update(struct MD5_context *context, | |
| - | const unsigned char *data, |
| + | const unsigned char *input, |
| unsigned int len); | |
| CURLcode Curl_MD5_final(struct MD5_context *context, unsigned char *result); | |
| @@ -37,7 +37,7 @@ extern const struct HMAC_params Curl_HMAC_SHA256; | |
| #define CURL_SHA256_DIGEST_LENGTH 32 /* fixed size */ | |
| #endif | |
| - | CURLcode Curl_sha256it(unsigned char *outbuffer, const unsigned char *input, |
| + | CURLcode Curl_sha256it(unsigned char *output, const unsigned char *input, |
| const size_t len); | |
| #endif | |
| @@ -28,6 +28,6 @@ | |
| #ifdef _WIN32 | |
| wchar_t *curlx_wcsdup(const wchar_t *src); /* for curlx_tcsdup() */ | |
| #endif | |
| - | void *curlx_memdup(const void *src, size_t buffer_length); |
| + | void *curlx_memdup(const void *src, size_t length); |
| void *curlx_memdup0(const char *src, size_t length); | |
| #endif /* HEADER_CURLX_STRDUP_H */ | |
| @@ -98,7 +98,8 @@ int curlx_str_cmp(struct Curl_str *str, const char *check); | |
| int curlx_str_nudge(struct Curl_str *str, size_t num); | |
| - | int curlx_str_cspn(const char **linep, struct Curl_str *out, const char *cspn); |
| + | int curlx_str_cspn(const char **linep, struct Curl_str *out, |
| + | const char *reject); |
| void curlx_str_trimblanks(struct Curl_str *out); | |
| void curlx_str_passblanks(const char **linep); | |
| @@ -69,6 +69,6 @@ bool curlx_sotouz_fits(curl_off_t sonum, size_t *puznum); | |
| /* Convert a long to size_t, return FALSE if negative or too large | |
| * and set 0 */ | |
| - | bool curlx_sltouz(long sznum, size_t *puznum); |
| + | bool curlx_sltouz(long slnum, size_t *puznum); |
| #endif /* HEADER_CURL_WARNLESS_H */ | |
| @@ -114,7 +114,7 @@ CURLcode Curl_doh(struct Curl_easy *data, const char *hostname, | |
| int port, int ip_version); | |
| CURLcode Curl_doh_is_resolved(struct Curl_easy *data, | |
| - | struct Curl_dns_entry **dns); |
| + | struct Curl_dns_entry **dnsp); |
| #define DOH_MAX_ADDR 24 | |
| #define DOH_MAX_CNAME 4 | |
| @@ -168,8 +168,8 @@ static CURLcode ftp_nb_type(struct Curl_easy *data, | |
| struct ftp_conn *ftpc, | |
| struct FTP *ftp, | |
| bool ascii, ftpstate newstate); | |
| - | static CURLcode getftpresponse(struct Curl_easy *data, size_t *nread, |
| - | int *ftpcode); |
| + | static CURLcode getftpresponse(struct Curl_easy *data, size_t *nreadp, |
| + | int *ftpcodep); |
| static void freedirs(struct ftp_conn *ftpc) | |
| { | |
| @@ -629,7 +629,7 @@ static CURLcode ftp_readresp(struct Curl_easy *data, | |
| */ | |
| static CURLcode getftpresponse(struct Curl_easy *data, | |
| size_t *nreadp, /* return number of bytes | |
| - | read */ |
| + | read */ |
| int *ftpcodep) /* return the ftp-code */ | |
| { | |
| /* | |
| @@ -37,7 +37,7 @@ CURLcode Curl_ftp_parselist_geterror(struct ftp_parselist_data *pl_data); | |
| struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void); | |
| - | void Curl_ftp_parselist_data_free(struct ftp_parselist_data **pl_data); |
| + | void Curl_ftp_parselist_data_free(struct ftp_parselist_data **parserp); |
| /* list of wildcard process states */ | |
| typedef enum { | |
| @@ -99,11 +99,11 @@ fail: | |
| } | |
| int Curl_HMAC_update(struct HMAC_context *ctxt, | |
| - | const unsigned char *ptr, |
| + | const unsigned char *data, |
| unsigned int len) | |
| { | |
| /* Update first hash calculation. */ | |
| - | ctxt->hash->hupdate(ctxt->hashctxt1, ptr, len); |
| + | ctxt->hash->hupdate(ctxt->hashctxt1, data, len); |
| return 0; | |
| } | |
| @@ -143,7 +143,7 @@ int Curl_HMAC_final(struct HMAC_context *ctxt, unsigned char *output) | |
| */ | |
| CURLcode Curl_hmacit(const struct HMAC_params *hashparams, | |
| const unsigned char *key, const size_t keylen, | |
| - | const unsigned char *buf, const size_t buflen, |
| + | const unsigned char *data, const size_t datalen, |
| unsigned char *output) | |
| { | |
| struct HMAC_context *ctxt = | |
| @@ -153,7 +153,7 @@ CURLcode Curl_hmacit(const struct HMAC_params *hashparams, | |
| return CURLE_OUT_OF_MEMORY; | |
| /* Update the digest with the given challenge */ | |
| - | Curl_HMAC_update(ctxt, buf, curlx_uztoui(buflen)); |
| + | Curl_HMAC_update(ctxt, data, curlx_uztoui(datalen)); |
| /* Finalise the digest */ | |
| Curl_HMAC_final(ctxt, output); | |
| @@ -1015,20 +1015,20 @@ CURLcode Curl_resolv_blocking(struct Curl_easy *data, | |
| const char *hostname, | |
| int port, | |
| int ip_version, | |
| - | struct Curl_dns_entry **dnsentry) |
| + | struct Curl_dns_entry **entry) |
| { | |
| CURLcode result; | |
| DEBUGASSERT(hostname && *hostname); | |
| - | *dnsentry = NULL; |
| - | result = Curl_resolv(data, hostname, port, ip_version, FALSE, dnsentry); |
| + | *entry = NULL; |
| + | result = Curl_resolv(data, hostname, port, ip_version, FALSE, entry); |
| switch(result) { | |
| case CURLE_OK: | |
| - | DEBUGASSERT(*dnsentry); |
| + | DEBUGASSERT(*entry); |
| return CURLE_OK; | |
| case CURLE_AGAIN: | |
| - | DEBUGASSERT(!*dnsentry); |
| - | result = Curl_async_await(data, dnsentry); |
| - | if(result || !*dnsentry) { |
| + | DEBUGASSERT(!*entry); |
| + | result = Curl_async_await(data, entry); |
| + | if(result || !*entry) { |
| /* close the connection, since we cannot return failure here without | |
| cleaning up this connection properly. */ | |
| connclose(data->conn, "async resolve failed"); | |
| @@ -86,18 +86,18 @@ CURLcode Curl_resolv(struct Curl_easy *data, | |
| int port, | |
| int ip_version, | |
| bool allowDOH, | |
| - | struct Curl_dns_entry **dnsentry); |
| + | struct Curl_dns_entry **entry); |
| CURLcode Curl_resolv_blocking(struct Curl_easy *data, | |
| const char *hostname, | |
| int port, | |
| int ip_version, | |
| - | struct Curl_dns_entry **dnsentry); |
| + | struct Curl_dns_entry **entry); |
| CURLcode Curl_resolv_timeout(struct Curl_easy *data, | |
| const char *hostname, int port, | |
| int ip_version, | |
| - | struct Curl_dns_entry **dnsentry, |
| + | struct Curl_dns_entry **entry, |
| timediff_t timeoutms); | |
| #ifdef USE_IPV6 | |
| @@ -118,7 +118,7 @@ void Curl_resolv_unlink(struct Curl_easy *data, | |
| struct Curl_dns_entry **pdns); | |
| /* init a new dns cache */ | |
| - | void Curl_dnscache_init(struct Curl_dnscache *dns, size_t hashsize); |
| + | void Curl_dnscache_init(struct Curl_dnscache *dns, size_t size); |
| void Curl_dnscache_destroy(struct Curl_dnscache *dns); | |
| @@ -133,14 +133,14 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, int port); | |
| CURLcode Curl_once_resolved(struct Curl_easy *data, | |
| struct Curl_dns_entry *dns, | |
| - | bool *protocol_connect); |
| + | bool *protocol_done); |
| /* | |
| * Curl_printable_address() returns a printable version of the 1st address | |
| * given in the 'ip' argument. The result will be stored in the buf that is | |
| * bufsize bytes big. | |
| */ | |
| - | void Curl_printable_address(const struct Curl_addrinfo *ip, |
| + | void Curl_printable_address(const struct Curl_addrinfo *ai, |
| char *buf, size_t bufsize); | |
| /* | |
| @@ -49,7 +49,7 @@ struct hsts { | |
| struct hsts *Curl_hsts_init(void); | |
| void Curl_hsts_cleanup(struct hsts **hp); | |
| CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, | |
| - | const char *sts); |
| + | const char *header); |
| struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, | |
| size_t hlen, bool subdomain); | |
| CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, | |
| @@ -670,7 +670,7 @@ char *curl_pushheader_bynum(struct curl_pushheaders *h, size_t num) | |
| /* | |
| * push header access function. Only to be used from within the push callback | |
| */ | |
| - | char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header) |
| + | char *curl_pushheader_byname(struct curl_pushheaders *h, const char *name) |
| { | |
| struct h2_stream_ctx *stream; | |
| size_t len; | |
| @@ -681,17 +681,17 @@ char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header) | |
| the header, but header == ":" must be rejected. If we have ':' in | |
| the middle of header, it could be matched in middle of the value, | |
| this is because we do prefix match.*/ | |
| - | if(!h || !GOOD_EASY_HANDLE(h->data) || !header || !header[0] || |
| - | !strcmp(header, ":") || strchr(header + 1, ':')) |
| + | if(!h || !GOOD_EASY_HANDLE(h->data) || !name || !name[0] || |
| + | !strcmp(name, ":") || strchr(name + 1, ':')) |
| return NULL; | |
| stream = h->stream; | |
| if(!stream) | |
| return NULL; | |
| - | len = strlen(header); |
| + | len = strlen(name); |
| for(i = 0; i < stream->push_headers_used; i++) { | |
| - | if(!strncmp(header, stream->push_headers[i], len)) { |
| + | if(!strncmp(name, stream->push_headers[i], len)) { |
| /* sub-match, make sure that it is followed by a colon */ | |
| if(stream->push_headers[i][len] != ':') | |
| continue; | |
| @@ -3001,10 +3001,10 @@ char *curl_pushheader_bynum(struct curl_pushheaders *h, size_t num) | |
| return NULL; | |
| } | |
| - | char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header) |
| + | char *curl_pushheader_byname(struct curl_pushheaders *h, const char *name) |
| { | |
| (void)h; | |
| - | (void)header; |
| + | (void)name; |
| return NULL; | |
| } | |
| @@ -55,7 +55,7 @@ CURLcode Curl_http2_switch_at(struct Curl_cfilter *cf, struct Curl_easy *data); | |
| CURLcode Curl_http2_upgrade(struct Curl_easy *data, | |
| struct connectdata *conn, int sockindex, | |
| - | const char *ptr, size_t nread); |
| + | const char *mem, size_t nread); |
| void *Curl_nghttp2_malloc(size_t size, void *user_data); | |
| void Curl_nghttp2_free(void *ptr, void *user_data); | |
| @@ -30,7 +30,7 @@ CURLcode Curl_idnconvert_hostname(struct hostname *host); | |
| #define USE_IDN | |
| void Curl_free_idnconverted_hostname(struct hostname *host); | |
| CURLcode Curl_idn_decode(const char *input, char **output); | |
| - | CURLcode Curl_idn_encode(const char *input, char **output); |
| + | CURLcode Curl_idn_encode(const char *puny, char **output); |
| #else | |
| #define Curl_free_idnconverted_hostname(x) | |
| #define Curl_idn_decode(x) NULL | |
| @@ -52,9 +52,9 @@ struct Curl_llist_node { | |
| void Curl_llist_init(struct Curl_llist *, Curl_llist_dtor); | |
| void Curl_llist_insert_next(struct Curl_llist *, struct Curl_llist_node *, | |
| - | const void *, struct Curl_llist_node *node); |
| + | const void *, struct Curl_llist_node *ne); |
| void Curl_llist_append(struct Curl_llist *, const void *, | |
| - | struct Curl_llist_node *node); |
| + | struct Curl_llist_node *ne); |
| void Curl_node_remove(struct Curl_llist_node *); | |
| void Curl_llist_destroy(struct Curl_llist *, void *); | |
| @@ -74,7 +74,7 @@ void *Curl_node_elem(struct Curl_llist_node *n); | |
| /* Remove the node from the list and return the custom data | |
| * from a Curl_llist_node. Will NOT invoke a registered `dtor`. */ | |
| - | void *Curl_node_take_elem(struct Curl_llist_node *); |
| + | void *Curl_node_take_elem(struct Curl_llist_node *e); |
| /* Curl_node_next() returns the next element in a list from a given | |
| Curl_llist_node */ | |
| @@ -1270,18 +1270,18 @@ CURLcode curl_mime_filename(curl_mimepart *part, const char *filename) | |
| } | |
| /* Set mime part content from memory data. */ | |
| - | CURLcode curl_mime_data(curl_mimepart *part, const char *ptr, size_t datasize) |
| + | CURLcode curl_mime_data(curl_mimepart *part, const char *data, size_t datasize) |
| { | |
| if(!part) | |
| return CURLE_BAD_FUNCTION_ARGUMENT; | |
| cleanup_part_content(part); | |
| - | if(ptr) { |
| + | if(data) { |
| if(datasize == CURL_ZERO_TERMINATED) | |
| - | datasize = strlen(ptr); |
| + | datasize = strlen(data); |
| - | part->data = curlx_memdup0(ptr, datasize); |
| + | part->data = curlx_memdup0(data, datasize); |
| if(!part->data) | |
| return CURLE_OUT_OF_MEMORY; | |
| @@ -3607,11 +3607,11 @@ void Curl_expire(struct Curl_easy *data, timediff_t milli, expire_id id) | |
| * Removes the expire timer. Marks it as done. | |
| * | |
| */ | |
| - | void Curl_expire_done(struct Curl_easy *data, expire_id eid) |
| + | void Curl_expire_done(struct Curl_easy *data, expire_id id) |
| { | |
| /* remove the timer, if there */ | |
| - | multi_deltimeout(data, eid); |
| - | CURL_TRC_TIMER(data, eid, "cleared"); |
| + | multi_deltimeout(data, id); |
| + | CURL_TRC_TIMER(data, id, "cleared"); |
| } | |
| /* | |
| @@ -47,7 +47,7 @@ void Curl_multi_connchanged(struct Curl_multi *multi); | |
| /* Internal version of curl_multi_init() accepts size parameters for the | |
| socket, connection and dns hashes */ | |
| struct Curl_multi *Curl_multi_handle(uint32_t xfer_table_size, | |
| - | size_t hashsize, |
| + | size_t ev_hashsize, |
| size_t chashsize, | |
| size_t dnssize, | |
| size_t sesssize); | |
| @@ -464,14 +464,14 @@ NETRCcode Curl_parsenetrc(struct store_netrc *store, const char *host, | |
| return retcode; | |
| } | |
| - | void Curl_netrc_init(struct store_netrc *s) |
| + | void Curl_netrc_init(struct store_netrc *store) |
| { | |
| - | curlx_dyn_init(&s->filebuf, MAX_NETRC_FILE); |
| - | s->loaded = FALSE; |
| + | curlx_dyn_init(&store->filebuf, MAX_NETRC_FILE); |
| + | store->loaded = FALSE; |
| } | |
| - | void Curl_netrc_cleanup(struct store_netrc *s) |
| + | void Curl_netrc_cleanup(struct store_netrc *store) |
| { | |
| - | curlx_dyn_free(&s->filebuf); |
| - | s->loaded = FALSE; |
| + | curlx_dyn_free(&store->filebuf); |
| + | store->loaded = FALSE; |
| } | |
| #endif | |
| @@ -45,12 +45,12 @@ typedef enum { | |
| } NETRCcode; | |
| const char *Curl_netrc_strerror(NETRCcode ret); | |
| - | void Curl_netrc_init(struct store_netrc *s); |
| - | void Curl_netrc_cleanup(struct store_netrc *s); |
| + | void Curl_netrc_init(struct store_netrc *store); |
| + | void Curl_netrc_cleanup(struct store_netrc *store); |
| - | NETRCcode Curl_parsenetrc(struct store_netrc *s, const char *host, |
| + | NETRCcode Curl_parsenetrc(struct store_netrc *store, const char *host, |
| char **loginp, char **passwordp, | |
| - | const char *filename); |
| + | const char *netrcfile); |
| /* Assume: (*passwordp)[0]=0, host[0] != 0. | |
| * If (*loginp)[0] = 0, search for login and password within a machine | |
| * section in the netrc. | |
| @@ -558,11 +558,11 @@ static int parsedate(const char *date, time_t *output) | |
| } | |
| #endif | |
| - | time_t curl_getdate(const char *p, const time_t *now) |
| + | time_t curl_getdate(const char *p, const time_t *unused) |
| { | |
| time_t parsed = -1; | |
| int rc = parsedate(p, &parsed); | |
| - | (void)now; /* legacy argument from the past that we ignore */ |
| + | (void)unused; /* legacy argument from the past that we ignore */ |
| if(rc == PARSEDATE_OK) { | |
| if(parsed == (time_t)-1) | |
| @@ -30,6 +30,6 @@ extern const char * const Curl_month[12]; | |
| TIME_T_MAX in case the parsed time value was too big, instead of an | |
| error. */ | |
| - | int Curl_getdate_capped(const char *p, time_t *store); |
| + | int Curl_getdate_capped(const char *p, time_t *tp); |
| #endif /* HEADER_CURL_PARSEDATE_H */ | |
| @@ -178,7 +178,7 @@ void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data); | |
| * @param httpversion version used in request (09, 10, 11, etc.) | |
| * @return CURLE_OK (on blocking with *pnwritten == 0) or error. | |
| */ | |
| - | CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *buf, |
| + | CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *req, |
| unsigned char httpversion); | |
| /** | |
| @@ -71,7 +71,8 @@ struct pollfd { | |
| therefore defined here */ | |
| #define CURL_CSELECT_IN2 (CURL_CSELECT_ERR << 1) | |
| - | int Curl_socket_check(curl_socket_t readfd, curl_socket_t readfd2, |
| + | int Curl_socket_check(curl_socket_t readfd0, |
| + | curl_socket_t readfd1, |
| curl_socket_t writefd, | |
| timediff_t timeout_ms); | |
| #define SOCKET_READABLE(x, z) \ | |
| @@ -373,7 +373,7 @@ static CURLcode do_init_writer_stack(struct Curl_easy *data) | |
| The defines are in sendf.h of course. | |
| */ | |
| CURLcode Curl_client_write(struct Curl_easy *data, | |
| - | int type, const char *buf, size_t blen) |
| + | int type, const char *buf, size_t len) |
| { | |
| CURLcode result; | |
| @@ -394,9 +394,9 @@ CURLcode Curl_client_write(struct Curl_easy *data, | |
| DEBUGASSERT(data->req.writer_stack); | |
| } | |
| - | result = Curl_cwriter_write(data, data->req.writer_stack, type, buf, blen); |
| + | result = Curl_cwriter_write(data, data->req.writer_stack, type, buf, len); |
| CURL_TRC_WRITE(data, "client_write(type=%x, len=%zu) -> %d", | |
| - | type, blen, result); |
| + | type, len, result); |
| return result; | |
| } | |
| @@ -58,7 +58,7 @@ struct Curl_easy; | |
| * Write `len` bytes at `prt` to the client. `type` indicates what | |
| * kind of data is being written. | |
| */ | |
| - | CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *ptr, |
| + | CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf, |
| size_t len) WARN_UNUSED_RESULT; | |
| /** | |
| @@ -140,7 +140,7 @@ struct Curl_cwriter { | |
| */ | |
| CURLcode Curl_cwriter_create(struct Curl_cwriter **pwriter, | |
| struct Curl_easy *data, | |
| - | const struct Curl_cwtype *ce_handler, |
| + | const struct Curl_cwtype *cwt, |
| Curl_cwriter_phase phase); | |
| /** | |
| @@ -298,7 +298,7 @@ void Curl_creader_clear_eos(struct Curl_easy *data, | |
| */ | |
| CURLcode Curl_creader_create(struct Curl_creader **preader, | |
| struct Curl_easy *data, | |
| - | const struct Curl_crtype *cr_handler, |
| + | const struct Curl_crtype *crt, |
| Curl_creader_phase phase); | |
| /** | |
| @@ -34,7 +34,7 @@ CURLcode Curl_setopt_SSLVERSION(struct Curl_easy *data, CURLoption option, | |
| CURLcode Curl_setstropt(char **charp, const char *s) WARN_UNUSED_RESULT; | |
| CURLcode Curl_setblobopt(struct curl_blob **blobp, | |
| const struct curl_blob *blob) WARN_UNUSED_RESULT; | |
| - | CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list arg) |
| + | CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) |
| WARN_UNUSED_RESULT; | |
| #endif /* HEADER_CURL_SETOPT_H */ | |
| @@ -452,14 +452,14 @@ static void my_sha256_final(unsigned char *out, void *ctx) | |
| * Returns CURLE_OK on success. | |
| */ | |
| CURLcode Curl_sha256it(unsigned char *output, const unsigned char *input, | |
| - | const size_t length) |
| + | const size_t len) |
| { | |
| CURLcode result; | |
| my_sha256_ctx ctx; | |
| result = my_sha256_init(&ctx); | |
| if(!result) { | |
| - | my_sha256_update(&ctx, input, curlx_uztoui(length)); |
| + | my_sha256_update(&ctx, input, curlx_uztoui(len)); |
| my_sha256_final(output, &ctx); | |
| } | |
| return result; | |
| @@ -42,7 +42,7 @@ struct Curl_tree *Curl_splay(const struct curltime *pkey, | |
| struct Curl_tree *Curl_splayinsert(const struct curltime *pkey, | |
| struct Curl_tree *t, | |
| - | struct Curl_tree *newnode); |
| + | struct Curl_tree *node); |
| struct Curl_tree *Curl_splaygetbest(const struct curltime *pkey, | |
| struct Curl_tree *t, | |
| @@ -36,6 +36,6 @@ void Curl_strntoupper(char *dest, const char *src, size_t n); | |
| void Curl_strntolower(char *dest, const char *src, size_t n); | |
| bool Curl_safecmp(const char *a, const char *b); | |
| - | int Curl_timestrcmp(const char *first, const char *second); |
| + | int Curl_timestrcmp(const char *a, const char *b); |
| #endif /* HEADER_CURL_STRCASE_H */ | |
| @@ -73,23 +73,23 @@ static int ncasecompare(const char *first, const char *second, size_t max) | |
| */ | |
| /* --- public function --- */ | |
| - | int curl_strequal(const char *first, const char *second) |
| + | int curl_strequal(const char *s1, const char *s2) |
| { | |
| - | if(first && second) |
| + | if(s1 && s2) |
| /* both pointers point to something then compare them */ | |
| - | return casecompare(first, second); |
| + | return casecompare(s1, s2); |
| /* if both pointers are NULL then treat them as equal */ | |
| - | return NULL == first && NULL == second; |
| + | return NULL == s1 && NULL == s2; |
| } | |
| /* --- public function --- */ | |
| - | int curl_strnequal(const char *first, const char *second, size_t max) |
| + | int curl_strnequal(const char *s1, const char *s2, size_t n) |
| { | |
| - | if(first && second) |
| + | if(s1 && s2) |
| /* both pointers point to something then compare them */ | |
| - | return ncasecompare(first, second, max); |
| + | return ncasecompare(s1, s2, n); |
| /* if both pointers are NULL then treat them as equal if max is non-zero */ | |
| - | return NULL == first && NULL == second && max; |
| + | return NULL == s1 && NULL == s2 && n; |
| } | |
| @@ -47,7 +47,7 @@ void Curl_uint32_tbl_init(struct uint32_tbl *tbl, | |
| /* Resize the table to change capacity `nmax`. When `nmax` is reduced, | |
| * all present entries with key equal or larger to `nmax` are removed. */ | |
| - | CURLcode Curl_uint32_tbl_resize(struct uint32_tbl *tbl, uint32_t nmax); |
| + | CURLcode Curl_uint32_tbl_resize(struct uint32_tbl *tbl, uint32_t nrows); |
| /* Destroy the table, freeing all entries. */ | |
| void Curl_uint32_tbl_destroy(struct uint32_tbl *tbl); | |
| @@ -36,14 +36,16 @@ void Curl_init_userdefined(struct Curl_easy *data); | |
| void Curl_freeset(struct Curl_easy *data); | |
| CURLcode Curl_uc_to_curlcode(CURLUcode uc); | |
| CURLcode Curl_close(struct Curl_easy **datap); /* opposite of Curl_open() */ | |
| - | CURLcode Curl_connect(struct Curl_easy *, bool *async, bool *protocol_connect); |
| + | CURLcode Curl_connect(struct Curl_easy *data, |
| + | bool *asyncp, |
| + | bool *protocol_done); |
| CURLcode Curl_setup_conn(struct Curl_easy *data, | |
| struct Curl_dns_entry *dns, | |
| bool *protocol_done); | |
| void Curl_conn_free(struct Curl_easy *data, struct connectdata *conn); | |
| CURLcode Curl_parse_login_details(const char *login, const size_t len, | |
| - | char **userptr, char **passwdptr, |
| - | char **optionsptr); |
| + | char **userp, char **passwdp, |
| + | char **optionsp); |
| /* Attach/Clear/Get meta data for an easy handle. Needs to provide | |
| * a destructor, will be automatically called when the easy handle | |
| @@ -81,14 +81,14 @@ CURLcode Curl_auth_create_plain_message(const char *authzid, | |
| * | |
| * Parameters: | |
| * | |
| - | * valuep [in] - The username or user's password. |
| + | * value [in] - The username or user's password. |
| * out [out] - The result storage. | |
| * | |
| * Returns void. | |
| */ | |
| - | void Curl_auth_create_login_message(const char *valuep, struct bufref *out) |
| + | void Curl_auth_create_login_message(const char *value, struct bufref *out) |
| { | |
| - | Curl_bufref_set(out, valuep, strlen(valuep), NULL); |
| + | Curl_bufref_set(out, value, strlen(value), NULL); |
| } | |
| /* | |
| @@ -110,7 +110,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, | |
| const char *userp, | |
| const char *passwdp, | |
| const unsigned char *request, | |
| - | const unsigned char *uri, |
| + | const unsigned char *uripath, |
| struct digestdata *digest, | |
| char **outptr, size_t *outlen); | |
| @@ -150,7 +150,7 @@ CURLcode Curl_auth_gsasl_token(struct Curl_easy *data, | |
| struct bufref *out); | |
| /* This is used to clean up the gsasl specific data */ | |
| - | void Curl_auth_gsasl_cleanup(struct gsasldata *digest); |
| + | void Curl_auth_gsasl_cleanup(struct gsasldata *gsasl); |
| #endif | |
| #ifdef USE_NTLM | |
| @@ -199,13 +199,13 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, | |
| const char *userp, | |
| const char *passwdp, | |
| const char *service, | |
| - | const char *host, |
| + | const char *hostname, |
| struct ntlmdata *ntlm, | |
| struct bufref *out); | |
| /* This is used to decode a base64 encoded NTLM type-2 message */ | |
| CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data, | |
| - | const struct bufref *type2, |
| + | const struct bufref *type2ref, |
| struct ntlmdata *ntlm); | |
| /* This is used to generate a base64 encoded NTLM type-3 message */ | |
| @@ -285,19 +285,19 @@ fail: | |
| } | |
| CURLcode Curl_ssh_range(struct Curl_easy *data, | |
| - | const char *p, curl_off_t filesize, |
| + | const char *range, curl_off_t filesize, |
| curl_off_t *startp, curl_off_t *sizep) | |
| { | |
| curl_off_t from, to; | |
| int to_t; | |
| - | int from_t = curlx_str_number(&p, &from, CURL_OFF_T_MAX); |
| + | int from_t = curlx_str_number(&range, &from, CURL_OFF_T_MAX); |
| if(from_t == STRE_OVERFLOW) | |
| return CURLE_RANGE_ERROR; | |
| - | curlx_str_passblanks(&p); |
| - | (void)curlx_str_single(&p, '-'); |
| + | curlx_str_passblanks(&range); |
| + | (void)curlx_str_single(&range, '-'); |
| - | to_t = curlx_str_numblanks(&p, &to); |
| - | if((to_t == STRE_OVERFLOW) || (to_t && from_t) || *p) |
| + | to_t = curlx_str_numblanks(&range, &to); |
| + | if((to_t == STRE_OVERFLOW) || (to_t && from_t) || *range) |
| return CURLE_RANGE_ERROR; | |
| if(from_t) { | |
| @@ -28,7 +28,7 @@ | |
| #if defined(USE_OPENSSL) || defined(USE_SCHANNEL) | |
| /* returns TRUE if there is a match */ | |
| - | bool Curl_cert_hostcheck(const char *match_pattern, size_t matchlen, |
| + | bool Curl_cert_hostcheck(const char *match, size_t matchlen, |
| const char *hostname, size_t hostlen); | |
| #endif | |
| @@ -917,10 +917,9 @@ static bool is_pkcs11_uri(const char *string) | |
| #endif | |
| - | static CURLcode ossl_set_engine(struct Curl_easy *data, const char *engine); |
| + | static CURLcode ossl_set_engine(struct Curl_easy *data, const char *name); |
| #ifdef OPENSSL_HAS_PROVIDERS | |
| - | static CURLcode ossl_set_provider(struct Curl_easy *data, |
| - | const char *provider); |
| + | static CURLcode ossl_set_provider(struct Curl_easy *data, const char *iname); |
| #endif | |
| static int use_certificate_blob(SSL_CTX *ctx, const struct curl_blob *blob, | |
| @@ -106,7 +106,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, | |
| struct Curl_cfilter *cf, | |
| struct Curl_easy *data, | |
| struct ssl_peer *peer, | |
| - | const struct alpn_spec *alpns, |
| + | const struct alpn_spec *alpns_requested, |
| Curl_ossl_ctx_setup_cb *cb_setup, | |
| void *cb_user_data, | |
| Curl_ossl_new_session_cb *cb_new_session, | |
| @@ -138,7 +138,7 @@ CURLcode Curl_ossl_ctx_configure(struct Curl_cfilter *cf, | |
| CURLcode Curl_ossl_add_session(struct Curl_cfilter *cf, | |
| struct Curl_easy *data, | |
| const char *ssl_peer_key, | |
| - | SSL_SESSION *ssl_sessionid, |
| + | SSL_SESSION *session, |
| int ietf_tls_id, | |
| const char *alpn, | |
| unsigned char *quic_tp, | |
| @@ -679,12 +679,11 @@ CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data, | |
| /* get length bytes of randomness */ | |
| CURLcode Curl_ssl_random(struct Curl_easy *data, | |
| - | unsigned char *entropy, |
| - | size_t length) |
| + | unsigned char *buffer, size_t length) |
| { | |
| DEBUGASSERT(length == sizeof(int)); | |
| if(Curl_ssl->random) | |
| - | return Curl_ssl->random(data, entropy, length); |
| + | return Curl_ssl->random(data, buffer, length); |
| else | |
| return CURLE_NOT_BUILT_IN; | |
| } | |
| @@ -178,8 +178,8 @@ CURLcode Curl_ssl_push_certinfo(struct Curl_easy *data, int certnum, | |
| /* Functions to be used by SSL library adaptation functions */ | |
| /* get N random bytes into the buffer */ | |
| - | CURLcode Curl_ssl_random(struct Curl_easy *data, unsigned char *buffer, |
| - | size_t length); |
| + | CURLcode Curl_ssl_random(struct Curl_easy *data, |
| + | unsigned char *buffer, size_t length); |
| /* Check pinned public key. */ | |
| CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, | |
| const char *pinnedpubkey, | |
| @@ -914,7 +914,7 @@ CURLcode Curl_ssl_scache_add_obj(struct Curl_cfilter *cf, | |
| struct Curl_easy *data, | |
| const char *ssl_peer_key, | |
| void *sobj, | |
| - | Curl_ssl_scache_obj_dtor *sobj_free) |
| + | Curl_ssl_scache_obj_dtor *sobj_dtor_cb) |
| { | |
| struct Curl_ssl_scache *scache = cf_ssl_scache_get(data); | |
| struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); | |
| @@ -922,7 +922,7 @@ CURLcode Curl_ssl_scache_add_obj(struct Curl_cfilter *cf, | |
| CURLcode result; | |
| DEBUGASSERT(sobj); | |
| - | DEBUGASSERT(sobj_free); |
| + | DEBUGASSERT(sobj_dtor_cb); |
| if(!scache) { | |
| result = CURLE_BAD_FUNCTION_ARGUMENT; | |
| @@ -935,12 +935,12 @@ CURLcode Curl_ssl_scache_add_obj(struct Curl_cfilter *cf, | |
| goto out; | |
| } | |
| - | cf_ssl_scache_peer_set_obj(peer, sobj, sobj_free); |
| + | cf_ssl_scache_peer_set_obj(peer, sobj, sobj_dtor_cb); |
| sobj = NULL; /* peer took ownership */ | |
| out: | |
| - | if(sobj && sobj_free) |
| - | sobj_free(sobj); |
| + | if(sobj && sobj_dtor_cb) |
| + | sobj_dtor_cb(sobj); |
| return result; | |
| } | |
| @@ -622,7 +622,7 @@ static CURLcode ws_enc_send(struct Curl_easy *data, | |
| size_t buflen, | |
| curl_off_t fragsize, | |
| unsigned int flags, | |
| - | size_t *sent); |
| + | size_t *pnsent); |
| static CURLcode ws_enc_add_pending(struct Curl_easy *data, | |
| struct websocket *ws); | |
| @@ -34,7 +34,8 @@ extern const struct Curl_scheme Curl_scheme_wss; | |
| #define CURL_META_PROTO_WS_CONN "meta:proto:ws:conn" | |
| CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req); | |
| - | CURLcode Curl_ws_accept(struct Curl_easy *data, const char *mem, size_t len); |
| + | CURLcode Curl_ws_accept(struct Curl_easy *data, |
| + | const char *mem, size_t nread); |
| #else | |
| #define Curl_ws_request(x, y) CURLE_OK | |
| @@ -39,7 +39,7 @@ extern int easysrc_mime_count; /* Number of curl_mime variables */ | |
| extern int easysrc_slist_count; /* Number of curl_slist variables */ | |
| extern CURLcode easysrc_init(void); | |
| - | extern CURLcode easysrc_add(struct slist_wc **plist, const char *bupf); |
| + | extern CURLcode easysrc_add(struct slist_wc **plist, const char *line); |
| extern CURLcode easysrc_addf(struct slist_wc **plist, | |
| const char *fmt, ...) CURL_PRINTF(2, 3); | |
| extern CURLcode easysrc_perform(void); | |
| @@ -162,7 +162,7 @@ static bool ttyecho(bool enable, int fd) | |
| } | |
| char *getpass_r(const char *prompt, /* prompt to display */ | |
| - | char *password, /* buffer to store password in */ |
| + | char *buffer, /* buffer to store password in */ |
| size_t buflen) /* size of buffer to store password in */ | |
| { | |
| ssize_t nread; | |
| @@ -174,11 +174,11 @@ char *getpass_r(const char *prompt, /* prompt to display */ | |
| disabled = ttyecho(FALSE, fd); /* disable terminal echo */ | |
| fputs(prompt, tool_stderr); | |
| - | nread = read(fd, password, buflen); |
| + | nread = read(fd, buffer, buflen); |
| if(nread > 0) | |
| - | password[--nread] = '\0'; /* null-terminate where enter is stored */ |
| + | buffer[--nread] = '\0'; /* null-terminate where enter is stored */ |
| else | |
| - | password[0] = '\0'; /* got nothing */ |
| + | buffer[0] = '\0'; /* got nothing */ |
| if(disabled) { | |
| /* if echo actually was disabled, add a newline */ | |
| @@ -189,7 +189,7 @@ char *getpass_r(const char *prompt, /* prompt to display */ | |
| if(STDIN_FILENO != fd) | |
| curlx_close(fd); | |
| - | return password; /* return pointer to buffer */ |
| + | return buffer; /* return pointer to buffer */ |
| } | |
| #endif /* DONE */ | |
| @@ -44,7 +44,7 @@ ParameterError str2unum(long *val, const char *str); | |
| ParameterError oct2nummax(long *val, const char *str, long max); | |
| ParameterError str2unummax(long *val, const char *str, long max); | |
| ParameterError secs2ms(long *val, const char *str); | |
| - | ParameterError proto2num(const char * const *val, char **obuf, |
| + | ParameterError proto2num(const char * const *val, char **ostr, |
| const char *str); | |
| ParameterError check_protocol(const char *str); | |
| ParameterError str2offset(curl_off_t *val, const char *str); | |
| @@ -82,7 +82,7 @@ int cgetopt(int argc, const char * const argv[], const char *optstring); | |
| extern int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc, | |
| struct timeval *tv); | |
| - | extern char *hexdump(const unsigned char *buffer, size_t len); |
| + | extern char *hexdump(const unsigned char *buf, size_t len); |
| #ifndef CURL_DISABLE_WEBSOCKETS | |
| CURLcode ws_send_ping(CURL *curl, const char *send_payload); | |