]> granicus.if.org Git - curl/commitdiff
CURLM_ADDED_ALREADY: new error code
authorDaniel Stenberg <daniel@haxx.se>
Tue, 20 Aug 2013 10:27:50 +0000 (12:27 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 20 Aug 2013 21:13:19 +0000 (23:13 +0200)
Doing curl_multi_add_handle() on an easy handle that is already added to
a multi handle now returns this error code. It previously returned
CURLM_BAD_EASY_HANDLE for this condition.

docs/libcurl/libcurl-errors.3
docs/libcurl/symbols-in-versions
include/curl/multi.h
lib/multi.c
lib/strerror.c

index 7b6823735e35f88f88c87db20b6ef4cb4bd7cdde..4e645756b6aa8ad017f210db8e4dbb49c4423ecc 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
 .\" *
 .\" * This software is licensed as described in the file COPYING, which
 .\" * you should have received as part of this distribution. The terms
@@ -273,6 +273,9 @@ The passed-in socket is not a valid one that libcurl already knows about.
 .IP "CURLM_UNKNOWN_OPTION (6)"
 curl_multi_setopt() with unsupported option
 (Added in 7.15.4)
+.IP "CURLM_ADDED_ALREADY (7)"
+An easy handle already added to a multi handle was attempted to get added a
+second time. (Added in 7.32.1)
 .SH "CURLSHcode"
 The "share" interface will return a CURLSHcode to indicate when an error has
 occurred.  Also consider \fIcurl_share_strerror(3)\fP.
index e61cbbee90df5a949ba8c8129e257828f48ae265..04caf711e57faffdf86a86573ae5c0ba3d2627bf 100644 (file)
@@ -283,6 +283,7 @@ CURLMOPT_TIMERDATA              7.16.0
 CURLMOPT_TIMERFUNCTION          7.16.0
 CURLMSG_DONE                    7.9.6
 CURLMSG_NONE                    7.9.6
+CURLM_ADDED_ALREADY             7.32.1
 CURLM_BAD_EASY_HANDLE           7.9.6
 CURLM_BAD_HANDLE                7.9.6
 CURLM_BAD_SOCKET                7.15.4
index a5eb3c643ea227f3632a2e1d2848557c8860650b..3c4acb0f6eafdedaa81bcd24af8f0b5353b5f304 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -64,6 +64,8 @@ typedef enum {
   CURLM_INTERNAL_ERROR,  /* this is a libcurl bug */
   CURLM_BAD_SOCKET,      /* the passed in socket argument did not match */
   CURLM_UNKNOWN_OPTION,  /* curl_multi_setopt() with unsupported option */
+  CURLM_ADDED_ALREADY,   /* an easy handle already added to a multi handle was
+                            attempted to get added - again */
   CURLM_LAST
 } CURLMcode;
 
index aa8eaf06bff9bdc1c8d0d1f2f887c49cb46a1dad..93be7700a0f0d340d06998dfd4500f1cf3d9fa3c 100644 (file)
@@ -357,8 +357,7 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
   /* Prevent users from adding same easy handle more than once and prevent
      adding to more than one multi stack */
   if(data->multi)
-    /* possibly we should create a new unique error code for this condition */
-    return CURLM_BAD_EASY_HANDLE;
+    return CURLM_ADDED_ALREADY;
 
   /* Allocate and initialize timeout list for easy handle */
   timeoutlist = Curl_llist_alloc(multi_freetimeout);
index a385f5572593bb7d9dae4f774be5abb842d427a3..9e8c83f726f3acbab219c6333f24cbc2ba8dd82e 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 2004 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2004 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -361,6 +361,9 @@ curl_multi_strerror(CURLMcode error)
   case CURLM_UNKNOWN_OPTION:
     return "Unknown option";
 
+  case CURLM_ADDED_ALREADY:
+    return "The easy handle is already added to a multi handle";
+
   case CURLM_LAST:
     break;
   }