diff options
author | Brad King <brad.king@kitware.com> | 2017-10-04 11:28:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-10-10 15:15:16 (GMT) |
commit | 9e3ef40edb6eae36e822c129bec5d4ee9de0dd57 (patch) | |
tree | c739e929f90b5e6c4e26d4f5fea7f17d3772aefb /Utilities/cmcurl/lib/pipeline.c | |
parent | 2fad0e20b6b2b4c3cfc177267cf9689658f50c23 (diff) | |
parent | de7c21d677db1ddaeece03c19e13e448f4031511 (diff) | |
download | CMake-9e3ef40edb6eae36e822c129bec5d4ee9de0dd57.zip CMake-9e3ef40edb6eae36e822c129bec5d4ee9de0dd57.tar.gz CMake-9e3ef40edb6eae36e822c129bec5d4ee9de0dd57.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2017-10-04 (3ea76790)
Diffstat (limited to 'Utilities/cmcurl/lib/pipeline.c')
-rw-r--r-- | Utilities/cmcurl/lib/pipeline.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/Utilities/cmcurl/lib/pipeline.c b/Utilities/cmcurl/lib/pipeline.c index b8d2037..4d41b04 100644 --- a/Utilities/cmcurl/lib/pipeline.c +++ b/Utilities/cmcurl/lib/pipeline.c @@ -230,28 +230,27 @@ CURLMcode Curl_pipeline_set_site_blacklist(char **sites, return CURLM_OK; } +struct blacklist_node { + struct curl_llist_element list; + char server_name[1]; +}; + bool Curl_pipeline_server_blacklisted(struct Curl_easy *handle, char *server_name) { if(handle->multi && server_name) { - struct curl_llist *blacklist = + struct curl_llist *list = Curl_multi_pipelining_server_bl(handle->multi); - if(blacklist) { - struct curl_llist_element *curr; - - curr = blacklist->head; - while(curr) { - char *bl_server_name; - - bl_server_name = curr->ptr; - if(strncasecompare(bl_server_name, server_name, - strlen(bl_server_name))) { - infof(handle, "Server %s is blacklisted\n", server_name); - return TRUE; - } - curr = curr->next; + struct curl_llist_element *e = list->head; + while(e) { + struct blacklist_node *bl = (struct blacklist_node *)e; + if(strncasecompare(bl->server_name, server_name, + strlen(bl->server_name))) { + infof(handle, "Server %s is blacklisted\n", server_name); + return TRUE; } + e = e->next; } DEBUGF(infof(handle, "Server %s is not blacklisted\n", server_name)); @@ -259,11 +258,6 @@ bool Curl_pipeline_server_blacklisted(struct Curl_easy *handle, return FALSE; } -struct blacklist_node { - struct curl_llist_element list; - char server_name[1]; -}; - CURLMcode Curl_pipeline_set_server_blacklist(char **servers, struct curl_llist *list) { @@ -286,8 +280,7 @@ CURLMcode Curl_pipeline_set_server_blacklist(char **servers, } strcpy(n->server_name, *servers); - Curl_llist_insert_next(list, list->tail, n->server_name, - &n->list); + Curl_llist_insert_next(list, list->tail, n, &n->list); servers++; } } |