diff options
author | Daniel Stenberg <daniel@haxx.se> | 2006-10-12 14:30:47 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2006-10-12 14:30:47 +0000 |
commit | ab60a124654dc0326d97271ebd30bb0984f78d8b (patch) | |
tree | 1d86e7546f0e2d81695e3ac7d214152e24905469 /lib | |
parent | 2d38e518679038bb3818991f2f47adb1aa255897 (diff) |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/multi.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); |