mirror of
https://github.com/curl/curl.git
synced 2026-04-15 01:11:40 +03:00
return CURLM_CALL_MULTI_PERFORM in one more case, and check return code
from malloc()
This commit is contained in:
parent
2de0028349
commit
2db0744a7b
1 changed files with 7 additions and 0 deletions
|
|
@ -323,6 +323,10 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
|
|||
{
|
||||
struct Curl_message *msg = (struct Curl_message *)
|
||||
malloc(sizeof(struct Curl_message));
|
||||
|
||||
if(!msg)
|
||||
return CURLM_OUT_OF_MEMORY;
|
||||
|
||||
msg->extmsg.msg = CURLMSG_DONE;
|
||||
msg->extmsg.easy_handle = easy->easy_handle;
|
||||
msg->extmsg.data.result = easy->result;
|
||||
|
|
@ -339,7 +343,9 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
|
|||
multi->num_msgs++; /* increase message counter */
|
||||
|
||||
}
|
||||
result = CURLM_CALL_MULTI_PERFORM;
|
||||
break;
|
||||
|
||||
case CURLM_STATE_COMPLETED:
|
||||
/* this is a completed transfer, it is likely to still be connected */
|
||||
|
||||
|
|
@ -364,6 +370,7 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
|
|||
|
||||
easy = easy->next; /* operate on next handle */
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue