Starting now, adding an easy handle to a multi stack that was already added

to a multi stack will cause CURLM_BAD_EASY_HANDLE to get returned.
This commit is contained in:
Daniel Stenberg 2006-10-12 14:30:47 +00:00
parent 2d38e51867
commit ab60a12465
4 changed files with 11 additions and 3 deletions

View file

@ -373,8 +373,10 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
if(!GOOD_EASY_HANDLE(easy_handle))
return CURLM_BAD_EASY_HANDLE;
/* TODO: add some kind of code that prevents a user from being able to
add the same handle more than once! */
/* Prevent users to add the same handle more than once! */
if(((struct SessionHandle *)easy_handle)->multi)
/* possibly we should create a new unique error code for this condition */
return CURLM_BAD_EASY_HANDLE;
/* Now, time to add an easy handle to the multi stack */
easy = (struct Curl_one_easy *)calloc(sizeof(struct Curl_one_easy), 1);