From: Daniel Stenberg Date: Wed, 14 Jun 2023 13:50:13 +0000 (+0200) Subject: curl_ws_*.3: enhance X-Git-Tag: curl-8_2_0~92 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7bee2ef6ca6304a003f5fdf9567b6c66eeda276f;p=thirdparty%2Fcurl.git curl_ws_*.3: enhance - all: SEE ALSO the libcurl-ws man page - send: add example and return value information - meta: mention that the returned data is read-only Closes #11318 --- diff --git a/docs/libcurl/curl_ws_meta.3 b/docs/libcurl/curl_ws_meta.3 index a0ff888ae0..891ee7bdf4 100644 --- a/docs/libcurl/curl_ws_meta.3 +++ b/docs/libcurl/curl_ws_meta.3 @@ -109,11 +109,10 @@ static size_t writecb(unsigned char *buffer, .SH AVAILABILITY Added in 7.86.0. .SH RETURN VALUE -This function returns a pointer to a \fIcurl_ws_frame\fP struct with +This function returns a pointer to a \fIcurl_ws_frame\fP struct with read-only information that is valid for this specific callback invocation. If it cannot return this information, or if the function is called in the wrong context, it returns NULL. .SH "SEE ALSO" -.BR curl_easy_setopt "(3), " -.BR curl_easy_getinfo "(3), " -.BR curl_ws_send "(3), " curl_ws_recv "(3), " +.BR curl_easy_setopt "(3), " curl_easy_getinfo "(3), " +.BR curl_ws_send "(3), " curl_ws_recv "(3), " libcurl-ws "(3), " diff --git a/docs/libcurl/curl_ws_recv.3 b/docs/libcurl/curl_ws_recv.3 index 65e14768cd..4fc683add8 100644 --- a/docs/libcurl/curl_ws_recv.3 +++ b/docs/libcurl/curl_ws_recv.3 @@ -66,4 +66,4 @@ this function again. .SH "SEE ALSO" .BR curl_easy_setopt "(3), " curl_easy_perform "(3), " .BR curl_easy_getinfo "(3), " -.BR curl_ws_send "(3) " +.BR curl_ws_send "(3), " libcurl-ws "(3), " diff --git a/docs/libcurl/curl_ws_send.3 b/docs/libcurl/curl_ws_send.3 index 87fda8c47c..3519d79140 100644 --- a/docs/libcurl/curl_ws_send.3 +++ b/docs/libcurl/curl_ws_send.3 @@ -80,13 +80,22 @@ expected fragment size in the first call and it needs to be zero in subsequent calls. .SH EXAMPLE .nf - +int ping(CURL *curl, const char *send_payload) +{ + size_t sent; + CURLcode result = + curl_ws_send(curl, send_payload, strlen(send_payload), &sent, 0, + CURLWS_PING); + return (int)result; +} .fi .SH AVAILABILITY Added in 7.86.0. .SH RETURN VALUE - +\fICURLE_OK\fP (zero) means that the data was sent properly, non-zero means an +error occurred as \fI\fP defines. See the \fIlibcurl-errors(3)\fP +man page for the full list with descriptions. .SH "SEE ALSO" .BR curl_easy_setopt "(3), " curl_easy_perform "(3), " .BR curl_easy_getinfo "(3), " -.BR curl_ws_recv "(3) " +.BR curl_ws_recv "(3), " libcurl-ws "(3), "