]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
docs/libcurl: return value overhall
authorDaniel Stenberg <daniel@haxx.se>
Thu, 2 Jan 2025 14:43:12 +0000 (15:43 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 2 Jan 2025 15:58:05 +0000 (16:58 +0100)
Unified, extended, clarified the return values for numerous functions

Closes #15899

38 files changed:
docs/libcurl/curl_easy_getinfo.md
docs/libcurl/curl_easy_header.md
docs/libcurl/curl_easy_pause.md
docs/libcurl/curl_easy_perform.md
docs/libcurl/curl_easy_recv.md
docs/libcurl/curl_easy_send.md
docs/libcurl/curl_easy_setopt.md
docs/libcurl/curl_easy_upkeep.md
docs/libcurl/curl_global_init_mem.md
docs/libcurl/curl_mime_data.md
docs/libcurl/curl_mime_data_cb.md
docs/libcurl/curl_mime_encoder.md
docs/libcurl/curl_mime_filedata.md
docs/libcurl/curl_mime_filename.md
docs/libcurl/curl_mime_headers.md
docs/libcurl/curl_mime_name.md
docs/libcurl/curl_mime_subparts.md
docs/libcurl/curl_mime_type.md
docs/libcurl/curl_multi_add_handle.md
docs/libcurl/curl_multi_assign.md
docs/libcurl/curl_multi_cleanup.md
docs/libcurl/curl_multi_fdset.md
docs/libcurl/curl_multi_info_read.md
docs/libcurl/curl_multi_perform.md
docs/libcurl/curl_multi_poll.md
docs/libcurl/curl_multi_remove_handle.md
docs/libcurl/curl_multi_setopt.md
docs/libcurl/curl_multi_socket.md
docs/libcurl/curl_multi_socket_action.md
docs/libcurl/curl_multi_socket_all.md
docs/libcurl/curl_multi_timeout.md
docs/libcurl/curl_multi_wait.md
docs/libcurl/curl_multi_waitfds.md
docs/libcurl/curl_multi_wakeup.md
docs/libcurl/curl_url_dup.md
docs/libcurl/curl_url_get.md
docs/libcurl/curl_ws_recv.md
docs/libcurl/curl_ws_send.md

index 184b8d588a80b16c9fbf98c6390c14d605cbc5d4..dff0504477488bb2ef9a9e34d46950b877262ead 100644 (file)
@@ -437,5 +437,9 @@ int main(void)
 
 # RETURN VALUE
 
-If the operation was successful, CURLE_OK is returned. Otherwise an
-appropriate error code is returned.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 0c71250660a69aecee53b21ddd5cd44fd7504b0f..d4ac893810be87cef6ab6a10c6407c22db77fe33 100644 (file)
@@ -160,4 +160,6 @@ int main(void)
 
 # RETURN VALUE
 
-This function returns a CURLHcode indicating success or error.
+This function returns a CURLHcode indicating success or error. CURLHE_OK (0)
+means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index fa8159acd291936646cedeba4889421658a3e557..2f47c4ef3f7f18abaaa9c8c559a213fc93192b9a 100644 (file)
@@ -138,6 +138,9 @@ might end up having to cache 64 MB of data.
 
 # RETURN VALUE
 
-CURLE_OK (zero) means that the option was set properly, and a non-zero return
-code means something wrong occurred after the new state was set. See the
-libcurl-errors(3) man page for the full list with descriptions.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 4c4c5668e5688742882c94d9731fadfd51598cc8..3d19669a5313a6113bef3555d953ffdb84ff13e8 100644 (file)
@@ -80,7 +80,9 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK (0) means everything was OK, non-zero means an error occurred as
-*\<curl/curl.h\>* defines - see libcurl-errors(3). If CURLOPT_ERRORBUFFER(3)
-was set with curl_easy_setopt(3) there is an error message stored in the error
-buffer when non-zero is returned.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 94491b63c3db8a29b7e97cfc839a5387641ef104..2e3b595ec3614cd506f68576adda385543c6d390 100644 (file)
@@ -102,5 +102,5 @@ system facilities to wait until data can be read, and retry.
 
 Reading exactly 0 bytes indicates a closed connection.
 
-If there is no socket available to use from the previous transfer, this function
-returns **CURLE_UNSUPPORTED_PROTOCOL**.
+If there is no socket available to use from the previous transfer, this
+function returns **CURLE_UNSUPPORTED_PROTOCOL**.
index 04d295a4554806090b97214ef192d14b7eb7ff8d..97d63f6774ca5a104e02ff361ad8ade6edd404cd 100644 (file)
@@ -94,5 +94,5 @@ On failure, returns the appropriate error code.
 This function may return **CURLE_AGAIN**. In this case, use your operating
 system facilities to wait until the socket is writable, and retry.
 
-If there is no socket available to use from the previous transfer, this function
-returns **CURLE_UNSUPPORTED_PROTOCOL**.
+If there is no socket available to use from the previous transfer, this
+function returns **CURLE_UNSUPPORTED_PROTOCOL**.
index e0fe95cacf1dd90b2bec4b76f435e16deac6d0c1..b6e08912ee0043054c04b34cbfeca8a595872879 100644 (file)
@@ -1348,9 +1348,12 @@ int main(void)
 
 # RETURN VALUE
 
-*CURLE_OK* (zero) means that the option was set properly, non-zero means an
-error occurred as *\<curl/curl.h\>* defines. See the libcurl-errors(3) man
-page for the full list with descriptions.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
 
 Strings passed on to libcurl must be shorter than 8000000 bytes, otherwise
 curl_easy_setopt(3) returns **CURLE_BAD_FUNCTION_ARGUMENT** (added in 7.65.0).
index 1b2fef01a572b160aaef67e2ede535f7d467bf3a..bd3e819e0e68c9dce650fc5d6a23bf399e7f78de 100644 (file)
@@ -79,6 +79,9 @@ int main(void)
 
 # RETURN VALUE
 
-On success, returns **CURLE_OK**.
+This function returns a CURLcode indicating success or error.
 
-On failure, returns the appropriate error code.
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 4ac22fbeb8b645b9f442a2ff549f21ce4ade9d4e..91f104ee57080101b71af539efbc666bcbaf684f 100644 (file)
@@ -94,5 +94,9 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK (0) means everything was OK, non-zero means an error occurred as
-*\<curl/curl.h\>* defines - see libcurl-errors(3).
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 5db64a951d2f3637fc44e71cde9861c0c39925cc..9af7a91d8a8362868cd6893cba0c26a6bc14a153 100644 (file)
@@ -78,4 +78,9 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK or a CURL error code upon failure.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index f85e23e96186f9dbdc03b0dded7bc1e4cd4bf9af..9404eb20e52a7c014c57703fed6d7d37a1cbaed4 100644 (file)
@@ -170,4 +170,9 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK or a CURL error code upon failure.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 1479bd7ffbd34ede22af16b3f8e853d021326b7e..bb5990c7b887e6a7617d57f0ee26c12fc90b78cd 100644 (file)
@@ -102,4 +102,9 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK or a CURL error code upon failure.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 079330ed91129ff59136b488de8dac55d130c53b..30f380f405405fa60a8d8973cb24a3c773afe61d 100644 (file)
@@ -87,7 +87,13 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK or a CURL error code upon failure. CURLE_READ_ERROR is only an
-indication that the file is not yet readable: it can be safely ignored at
-this time, but the file must be made readable before the pertaining
-easy handle is performed.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
+
+CURLE_READ_ERROR is only an indication that the file is not yet readable: it
+can be safely ignored at this time, but the file must be made readable before
+the pertaining easy handle is performed.
index cfaeada8e8cb25ad8145ece43297ed7e96f523c9..d52ce739e07e5ca85e4cc3188ff39280b06967f2 100644 (file)
@@ -81,4 +81,9 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK or a CURL error code upon failure.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 9962661122853c893ad045daa5b43e7ae468028a..8c7770bd1e5c4baccc779c68905cc7637d4c14d9 100644 (file)
@@ -80,4 +80,9 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK or a CURL error code upon failure.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 862784431f46294a794328aa02a55fc65ce6aa99..4f198141b3b9eb543b90e5cfc0f2b7cb08008c77 100644 (file)
@@ -69,4 +69,9 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK or a CURL error code upon failure.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 8056a3350d8c42dc593b23e4e60a2078ae7e8820..3a8c18bd22bcd447dc668a1b03912d660e8b5397 100644 (file)
@@ -85,4 +85,9 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK or a CURL error code upon failure.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 76f3d710deb23192966ee4dc0fdf8c99b07a2bc5..1e36052e1c96f43f8582a28f3bdb46c1ca21a3a3 100644 (file)
@@ -88,4 +88,9 @@ int main(void)
 
 # RETURN VALUE
 
-CURLE_OK or a CURL error code upon failure.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
index 9082e9c485de706f2894d11ffa599c25e594f92e..ac29b89abdc470b177d043dedad792dac27d15bf 100644 (file)
@@ -88,4 +88,7 @@ int main(void)
 
 # RETURN VALUE
 
-CURLMcode type, general libcurl multi interface error code.
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index 50729100490dd731ebd7a2f602c938e60a998033..eb4fb966e5085a38c5e293338aa754134f9a9c07 100644 (file)
@@ -81,4 +81,7 @@ do not have to find the struct associated with this socket by ourselves.
 
 # RETURN VALUE
 
-The standard CURLMcode for multi interface error codes.
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index 21661ea8a1471b39571e0d8b65c29ca4b8cab88d..1d4a1f81ffd2b3e51bf2a7d776710681b493d9fb 100644 (file)
@@ -70,5 +70,7 @@ int main(void)
 
 # RETURN VALUE
 
-CURLMcode type, general libcurl multi interface error code. On success,
-CURLM_OK is returned.
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index e1b86941198992af66e794f5cee882f26bf75613..d43663dd90b56bb5b6719f6b6c91395b9bb59c32 100644 (file)
@@ -119,5 +119,7 @@ int main(void)
 
 # RETURN VALUE
 
-**CURLMcode** type, general libcurl multi interface error code. See
-libcurl-errors(3)
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index 3a8af88d046b1519062d2b030aa9fbd56649b05a..17f8842343daf2b4e60b7a165ad08a478b7c0659 100644 (file)
@@ -100,6 +100,6 @@ int main(void)
 
 # RETURN VALUE
 
-A pointer to a filled-in struct, or NULL if it failed or ran out of
-structs. It also writes the number of messages left in the queue (after this
-read) in the integer the second argument points to.
+A pointer to a filled-in struct, or NULL if it failed or ran out of structs.
+It also writes the number of messages left in the queue (after this read) in
+the integer the second argument points to.
index c30ad2116f3163559b35a9a4a060dfee1a7ba0df..9ca13c679347f2ae8338c251a607fd25ea155138 100644 (file)
@@ -95,12 +95,15 @@ int main(void)
 
 # RETURN VALUE
 
-CURLMcode type, general libcurl multi interface error code.
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
 
 This function returns errors regarding the whole multi stack. Problems on
 individual transfers may have occurred even when this function returns
-*CURLM_OK*. Use curl_multi_info_read(3) to figure out how individual
-transfers did.
+*CURLM_OK*. Use curl_multi_info_read(3) to figure out how individual transfers
+did.
 
 # TYPICAL USAGE
 
index c19661d0eafa071924f35e7d0aafdb439ac4976b..4cfc98520e68a361a19dfdb975e74977014b2fd6 100644 (file)
@@ -141,5 +141,7 @@ int main(void)
 
 # RETURN VALUE
 
-CURLMcode type, general libcurl multi interface error code. See
-libcurl-errors(3)
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index ac43a592eee189b292aec9beb1a4e7691fba6c57..b36a62d2358a29c3019dbd2733630a43d8120d7f 100644 (file)
@@ -73,4 +73,7 @@ int main(void)
 
 # RETURN VALUE
 
-CURLMcode type, general libcurl multi interface error code.
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index 3f326be7681db9eefd03bde2cbcc2fbeaae37a44..70e7528821171a7f1a3e06920214d8cedc801fbf 100644 (file)
@@ -124,6 +124,10 @@ int main(void)
 
 # RETURN VALUE
 
-The standard CURLMcode for multi interface error codes. Note that it returns a
-CURLM_UNKNOWN_OPTION if you try setting an option that this version of libcurl
-does not know of.
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
+
+Note that it returns a CURLM_UNKNOWN_OPTION if you try setting an option that
+this version of libcurl does not know of.
index 490af19c4f356d5e49a2e221e8878c84fbd5146d..1f20b51ab075e0bcd93bb0e05d9313f0b369c735 100644 (file)
@@ -79,7 +79,10 @@ curl_multi_socket(3) is deprecated, use curl_multi_socket_action(3) instead.
 
 # RETURN VALUE
 
-CURLMcode type, general libcurl multi interface error code.
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
 
 The return code is for the whole multi stack. Problems still might have
 occurred on individual transfers even when one of these functions return OK.
index 536bf3cb6e219c77086a616e3ab5bef19b87da74..0b5889a7debdc002ac8aa9f7afd132702d081349 100644 (file)
@@ -119,5 +119,7 @@ int main(void)
 
 # RETURN VALUE
 
-CURLMcode type, general libcurl multi interface error code. See
-libcurl-errors(3)
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index d7f832b51dfa3e26fe3fc2b29ef4966074771ea4..d0806ba5663f695acbe9ac6b6459e6254a428fe1 100644 (file)
@@ -59,7 +59,10 @@ int main(void)
 
 # RETURN VALUE
 
-CURLMcode type, general libcurl multi interface error code.
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
 
 The return code is for the whole multi stack. Problems still might have
 occurred on individual transfers even when one of these functions return OK.
index de59c39202060b5977939ffee312740647d3ab4d..05121237c125507f1bc4ce3a2f209bc2610d723a 100644 (file)
@@ -89,4 +89,7 @@ loop - until all transfers are complete.
 
 # RETURN VALUE
 
-The standard CURLMcode for multi interface error codes.
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index 7e9553d76aaff6db499d29931c6384bd205f3202..d73cf0e0be2eedbf3eb9f2709b07346b51daa60b 100644 (file)
@@ -120,5 +120,7 @@ int main(void)
 
 # RETURN VALUE
 
-CURLMcode type, general libcurl multi interface error code. See
-libcurl-errors(3)
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index e2ebd374124c11423baf0ff9c6ecfa4241d78410..e1a333e060abb7df34e1eda32e47d23088771ecd 100644 (file)
@@ -109,5 +109,7 @@ int main(void)
 
 # RETURN VALUE
 
-**CURLMcode** type, general libcurl multi interface error code. See
-libcurl-errors(3)
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index a920847a6cc6c525de475ecbcb47910e2ab7286c..6e6ca1a5c687ccd7d1585b2fadc46c950256353a 100644 (file)
@@ -91,4 +91,7 @@ int main(void)
 
 # RETURN VALUE
 
-CURLMcode type, general libcurl multi interface error code.
+This function returns a CURLMcode indicating success or error.
+
+CURLM_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3).
index 28a661a473ce82c0b11d485a1f65071aa6c19754..cfba5cc1b93e7d680961ec1acb39d662b388e247 100644 (file)
@@ -56,4 +56,4 @@ int main(void)
 
 # RETURN VALUE
 
-Returns a new handle or NULL if out of memory.
+Returns a pointer to a new `CURLU` handle or NULL if out of memory.
index e7aa6baa5e2336ad466476cf4d873d2ff7128612..e9e10513df681b739e9c98ad60b158a50bc664fc 100644 (file)
@@ -243,7 +243,6 @@ int main(void)
 # RETURN VALUE
 
 Returns a CURLUcode error value, which is CURLUE_OK (0) if everything went
-fine. See the libcurl-errors(3) man page for the full list with
-descriptions.
+fine. See the libcurl-errors(3) man page for the full list with descriptions.
 
 If this function returns an error, no URL part is returned.
index b2493bede1aa1568cddbcd4e353b341268e0069e..3c6a93f01f33a9a9d033f563aa3e341d33405f5c 100644 (file)
@@ -67,9 +67,14 @@ int main(void)
 
 # RETURN VALUE
 
-Returns **CURLE_OK** if everything is okay, and a non-zero number for
-errors. Returns **CURLE_GOT_NOTHING** if the associated connection is
-closed.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.
+
+Returns **CURLE_GOT_NOTHING** if the associated connection is closed.
 
 Instead of blocking, the function returns **CURLE_AGAIN**. The correct
 behavior is then to wait for the socket to signal readability before calling
index cb3b891ee146cb7f03b718122d35489543280a0c..886b66a77884d8f26b605a52964e2c5c4620ce81 100644 (file)
@@ -120,6 +120,9 @@ int main(void)
 
 # RETURN VALUE
 
-*CURLE_OK* (zero) means that the data was sent properly, non-zero means an
-error occurred as *\<curl/curl.h\>* defines. See the libcurl-errors(3) man
-page for the full list with descriptions.
+This function returns a CURLcode indicating success or error.
+
+CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
+libcurl-errors(3). If CURLOPT_ERRORBUFFER(3) was set with curl_easy_setopt(3)
+there can be an error message stored in the error buffer when non-zero is
+returned.