From ab60a124654dc0326d97271ebd30bb0984f78d8b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 12 Oct 2006 14:30:47 +0000 Subject: 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. --- lib/multi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/multi.c b/lib/multi.c index aaa80b228..7272f471a 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -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); -- cgit v1.2.3