@@ -185,7 +185,7 @@ int rcl_init_internals(void)
185185#define w_curl_multi_setopt (mh , opt , value ) \
186186 do { \
187187 mrc = curl_multi_setopt(mh, opt, value); \
188- if (mrc != CURLE_OK ) { \
188+ if (mrc != CURLM_OK ) { \
189189 LM_ERR("curl_multi_setopt(%d): (%s)\n", opt, curl_multi_strerror(mrc)); \
190190 goto cleanup; \
191191 } \
@@ -194,7 +194,7 @@ int rcl_init_internals(void)
194194#define w_curl_share_setopt (cs , opt , value ) \
195195 do { \
196196 src = curl_share_setopt(cs, opt, value); \
197- if (src != CURLE_OK ) { \
197+ if (src != CURLSHE_OK ) { \
198198 LM_ERR("curl_share_setopt: %s\n", curl_share_strerror(src)); \
199199 goto cleanup; \
200200 } \
@@ -1606,8 +1606,7 @@ int connect_only(preconnect_urls *precon_urls, int total_cons) {
16061606 CURLMcode mrc ;
16071607 CURL * handle ;
16081608 CURLM * multi_handle ;
1609- OSS_CURLM * multi_list ;
1610- CURL * * list ;
1609+ OSS_CURLM * multi_list = NULL ;
16111610 struct CURLMsg * m ;
16121611 preconnect_urls * start , * next ;
16131612 char * url ;
@@ -1617,12 +1616,14 @@ int connect_only(preconnect_urls *precon_urls, int total_cons) {
16171616 curl_share = get_curl_share ();
16181617
16191618 if (!curl_share ) {
1620- goto cleanup ;
1619+ exit_code = -1 ;
1620+ goto done ;
16211621 }
16221622
16231623 multi_list = get_multi ();
16241624 if (!multi_list ) {
1625- goto cleanup ;
1625+ exit_code = -1 ;
1626+ goto done ;
16261627 }
16271628
16281629 multi_handle = multi_list -> multi_handle ;
@@ -1711,6 +1712,7 @@ int connect_only(preconnect_urls *precon_urls, int total_cons) {
17111712
17121713 put_multi (multi_list );
17131714
1715+ done :
17141716 return exit_code ;
17151717}
17161718
@@ -1724,7 +1726,7 @@ int start_async_http_req_v2(struct sip_msg *msg, enum rest_client_method method,
17241726 CURLMcode mrc ;
17251727 OSS_CURLM * multi_list ;
17261728 CURLM * multi_handle ;
1727- long busy_wait , timeout , connect_timeout , retry_time ;
1729+ long busy_wait ;
17281730
17291731 handle = curl_easy_init ();
17301732
@@ -1801,7 +1803,6 @@ int start_async_http_req_v2(struct sip_msg *msg, enum rest_client_method method,
18011803
18021804 connect_timeout = (async_parm -> timeout_s * 1000 ) > connection_timeout_ms ?
18031805 (async_parm -> timeout_s * 1000 ) : connection_timeout_ms ;
1804- timeout = connect_timeout ;
18051806 busy_wait = connect_poll_interval ;
18061807
18071808 w_curl_multi_setopt (multi_handle , CURLMOPT_TIMERFUNCTION , timer_cb );
0 commit comments