From: Daniel Stenberg Date: Thu, 2 Jan 2025 14:43:12 +0000 (+0100) Subject: docs/libcurl: return value overhall X-Git-Tag: curl-8_12_0~210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4501b7e28dbcccd122df1e9ae451208c1f51b398;p=thirdparty%2Fcurl.git docs/libcurl: return value overhall Unified, extended, clarified the return values for numerous functions Closes #15899 --- diff --git a/docs/libcurl/curl_easy_getinfo.md b/docs/libcurl/curl_easy_getinfo.md index 184b8d588a..dff0504477 100644 --- a/docs/libcurl/curl_easy_getinfo.md +++ b/docs/libcurl/curl_easy_getinfo.md @@ -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. diff --git a/docs/libcurl/curl_easy_header.md b/docs/libcurl/curl_easy_header.md index 0c71250660..d4ac893810 100644 --- a/docs/libcurl/curl_easy_header.md +++ b/docs/libcurl/curl_easy_header.md @@ -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). diff --git a/docs/libcurl/curl_easy_pause.md b/docs/libcurl/curl_easy_pause.md index fa8159acd2..2f47c4ef3f 100644 --- a/docs/libcurl/curl_easy_pause.md +++ b/docs/libcurl/curl_easy_pause.md @@ -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. diff --git a/docs/libcurl/curl_easy_perform.md b/docs/libcurl/curl_easy_perform.md index 4c4c5668e5..3d19669a53 100644 --- a/docs/libcurl/curl_easy_perform.md +++ b/docs/libcurl/curl_easy_perform.md @@ -80,7 +80,9 @@ int main(void) # RETURN VALUE -CURLE_OK (0) means everything was OK, non-zero means an error occurred as -*\* 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. diff --git a/docs/libcurl/curl_easy_recv.md b/docs/libcurl/curl_easy_recv.md index 94491b63c3..2e3b595ec3 100644 --- a/docs/libcurl/curl_easy_recv.md +++ b/docs/libcurl/curl_easy_recv.md @@ -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**. diff --git a/docs/libcurl/curl_easy_send.md b/docs/libcurl/curl_easy_send.md index 04d295a455..97d63f6774 100644 --- a/docs/libcurl/curl_easy_send.md +++ b/docs/libcurl/curl_easy_send.md @@ -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**. diff --git a/docs/libcurl/curl_easy_setopt.md b/docs/libcurl/curl_easy_setopt.md index e0fe95cacf..b6e08912ee 100644 --- a/docs/libcurl/curl_easy_setopt.md +++ b/docs/libcurl/curl_easy_setopt.md @@ -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 *\* 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). diff --git a/docs/libcurl/curl_easy_upkeep.md b/docs/libcurl/curl_easy_upkeep.md index 1b2fef01a5..bd3e819e0e 100644 --- a/docs/libcurl/curl_easy_upkeep.md +++ b/docs/libcurl/curl_easy_upkeep.md @@ -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. diff --git a/docs/libcurl/curl_global_init_mem.md b/docs/libcurl/curl_global_init_mem.md index 4ac22fbeb8..91f104ee57 100644 --- a/docs/libcurl/curl_global_init_mem.md +++ b/docs/libcurl/curl_global_init_mem.md @@ -94,5 +94,9 @@ int main(void) # RETURN VALUE -CURLE_OK (0) means everything was OK, non-zero means an error occurred as -*\* 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. diff --git a/docs/libcurl/curl_mime_data.md b/docs/libcurl/curl_mime_data.md index 5db64a951d..9af7a91d8a 100644 --- a/docs/libcurl/curl_mime_data.md +++ b/docs/libcurl/curl_mime_data.md @@ -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. diff --git a/docs/libcurl/curl_mime_data_cb.md b/docs/libcurl/curl_mime_data_cb.md index f85e23e961..9404eb20e5 100644 --- a/docs/libcurl/curl_mime_data_cb.md +++ b/docs/libcurl/curl_mime_data_cb.md @@ -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. diff --git a/docs/libcurl/curl_mime_encoder.md b/docs/libcurl/curl_mime_encoder.md index 1479bd7ffb..bb5990c7b8 100644 --- a/docs/libcurl/curl_mime_encoder.md +++ b/docs/libcurl/curl_mime_encoder.md @@ -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. diff --git a/docs/libcurl/curl_mime_filedata.md b/docs/libcurl/curl_mime_filedata.md index 079330ed91..30f380f405 100644 --- a/docs/libcurl/curl_mime_filedata.md +++ b/docs/libcurl/curl_mime_filedata.md @@ -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. diff --git a/docs/libcurl/curl_mime_filename.md b/docs/libcurl/curl_mime_filename.md index cfaeada8e8..d52ce739e0 100644 --- a/docs/libcurl/curl_mime_filename.md +++ b/docs/libcurl/curl_mime_filename.md @@ -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. diff --git a/docs/libcurl/curl_mime_headers.md b/docs/libcurl/curl_mime_headers.md index 9962661122..8c7770bd1e 100644 --- a/docs/libcurl/curl_mime_headers.md +++ b/docs/libcurl/curl_mime_headers.md @@ -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. diff --git a/docs/libcurl/curl_mime_name.md b/docs/libcurl/curl_mime_name.md index 862784431f..4f198141b3 100644 --- a/docs/libcurl/curl_mime_name.md +++ b/docs/libcurl/curl_mime_name.md @@ -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. diff --git a/docs/libcurl/curl_mime_subparts.md b/docs/libcurl/curl_mime_subparts.md index 8056a3350d..3a8c18bd22 100644 --- a/docs/libcurl/curl_mime_subparts.md +++ b/docs/libcurl/curl_mime_subparts.md @@ -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. diff --git a/docs/libcurl/curl_mime_type.md b/docs/libcurl/curl_mime_type.md index 76f3d710de..1e36052e1c 100644 --- a/docs/libcurl/curl_mime_type.md +++ b/docs/libcurl/curl_mime_type.md @@ -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. diff --git a/docs/libcurl/curl_multi_add_handle.md b/docs/libcurl/curl_multi_add_handle.md index 9082e9c485..ac29b89abd 100644 --- a/docs/libcurl/curl_multi_add_handle.md +++ b/docs/libcurl/curl_multi_add_handle.md @@ -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). diff --git a/docs/libcurl/curl_multi_assign.md b/docs/libcurl/curl_multi_assign.md index 5072910049..eb4fb966e5 100644 --- a/docs/libcurl/curl_multi_assign.md +++ b/docs/libcurl/curl_multi_assign.md @@ -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). diff --git a/docs/libcurl/curl_multi_cleanup.md b/docs/libcurl/curl_multi_cleanup.md index 21661ea8a1..1d4a1f81ff 100644 --- a/docs/libcurl/curl_multi_cleanup.md +++ b/docs/libcurl/curl_multi_cleanup.md @@ -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). diff --git a/docs/libcurl/curl_multi_fdset.md b/docs/libcurl/curl_multi_fdset.md index e1b8694119..d43663dd90 100644 --- a/docs/libcurl/curl_multi_fdset.md +++ b/docs/libcurl/curl_multi_fdset.md @@ -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). diff --git a/docs/libcurl/curl_multi_info_read.md b/docs/libcurl/curl_multi_info_read.md index 3a8af88d04..17f8842343 100644 --- a/docs/libcurl/curl_multi_info_read.md +++ b/docs/libcurl/curl_multi_info_read.md @@ -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. diff --git a/docs/libcurl/curl_multi_perform.md b/docs/libcurl/curl_multi_perform.md index c30ad2116f..9ca13c6793 100644 --- a/docs/libcurl/curl_multi_perform.md +++ b/docs/libcurl/curl_multi_perform.md @@ -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 diff --git a/docs/libcurl/curl_multi_poll.md b/docs/libcurl/curl_multi_poll.md index c19661d0ea..4cfc98520e 100644 --- a/docs/libcurl/curl_multi_poll.md +++ b/docs/libcurl/curl_multi_poll.md @@ -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). diff --git a/docs/libcurl/curl_multi_remove_handle.md b/docs/libcurl/curl_multi_remove_handle.md index ac43a592ee..b36a62d235 100644 --- a/docs/libcurl/curl_multi_remove_handle.md +++ b/docs/libcurl/curl_multi_remove_handle.md @@ -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). diff --git a/docs/libcurl/curl_multi_setopt.md b/docs/libcurl/curl_multi_setopt.md index 3f326be768..70e7528821 100644 --- a/docs/libcurl/curl_multi_setopt.md +++ b/docs/libcurl/curl_multi_setopt.md @@ -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. diff --git a/docs/libcurl/curl_multi_socket.md b/docs/libcurl/curl_multi_socket.md index 490af19c4f..1f20b51ab0 100644 --- a/docs/libcurl/curl_multi_socket.md +++ b/docs/libcurl/curl_multi_socket.md @@ -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. diff --git a/docs/libcurl/curl_multi_socket_action.md b/docs/libcurl/curl_multi_socket_action.md index 536bf3cb6e..0b5889a7de 100644 --- a/docs/libcurl/curl_multi_socket_action.md +++ b/docs/libcurl/curl_multi_socket_action.md @@ -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). diff --git a/docs/libcurl/curl_multi_socket_all.md b/docs/libcurl/curl_multi_socket_all.md index d7f832b51d..d0806ba566 100644 --- a/docs/libcurl/curl_multi_socket_all.md +++ b/docs/libcurl/curl_multi_socket_all.md @@ -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. diff --git a/docs/libcurl/curl_multi_timeout.md b/docs/libcurl/curl_multi_timeout.md index de59c39202..05121237c1 100644 --- a/docs/libcurl/curl_multi_timeout.md +++ b/docs/libcurl/curl_multi_timeout.md @@ -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). diff --git a/docs/libcurl/curl_multi_wait.md b/docs/libcurl/curl_multi_wait.md index 7e9553d76a..d73cf0e0be 100644 --- a/docs/libcurl/curl_multi_wait.md +++ b/docs/libcurl/curl_multi_wait.md @@ -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). diff --git a/docs/libcurl/curl_multi_waitfds.md b/docs/libcurl/curl_multi_waitfds.md index e2ebd37412..e1a333e060 100644 --- a/docs/libcurl/curl_multi_waitfds.md +++ b/docs/libcurl/curl_multi_waitfds.md @@ -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). diff --git a/docs/libcurl/curl_multi_wakeup.md b/docs/libcurl/curl_multi_wakeup.md index a920847a6c..6e6ca1a5c6 100644 --- a/docs/libcurl/curl_multi_wakeup.md +++ b/docs/libcurl/curl_multi_wakeup.md @@ -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). diff --git a/docs/libcurl/curl_url_dup.md b/docs/libcurl/curl_url_dup.md index 28a661a473..cfba5cc1b9 100644 --- a/docs/libcurl/curl_url_dup.md +++ b/docs/libcurl/curl_url_dup.md @@ -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. diff --git a/docs/libcurl/curl_url_get.md b/docs/libcurl/curl_url_get.md index e7aa6baa5e..e9e10513df 100644 --- a/docs/libcurl/curl_url_get.md +++ b/docs/libcurl/curl_url_get.md @@ -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. diff --git a/docs/libcurl/curl_ws_recv.md b/docs/libcurl/curl_ws_recv.md index b2493bede1..3c6a93f01f 100644 --- a/docs/libcurl/curl_ws_recv.md +++ b/docs/libcurl/curl_ws_recv.md @@ -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 diff --git a/docs/libcurl/curl_ws_send.md b/docs/libcurl/curl_ws_send.md index cb3b891ee1..886b66a778 100644 --- a/docs/libcurl/curl_ws_send.md +++ b/docs/libcurl/curl_ws_send.md @@ -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 *\* 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.