]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_ws_*.3: enhance
authorDaniel Stenberg <daniel@haxx.se>
Wed, 14 Jun 2023 13:50:13 +0000 (15:50 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 14 Jun 2023 22:05:31 +0000 (00:05 +0200)
- 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

docs/libcurl/curl_ws_meta.3
docs/libcurl/curl_ws_recv.3
docs/libcurl/curl_ws_send.3

index a0ff888ae0b392ef8cf520ef9d44c34d244450e4..891ee7bdf46c6a4f227df068ac5ea936e7d15471 100644 (file)
@@ -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), "
index 65e14768cdb3c0aaa20f0d83d0447fee470a786b..4fc683add85580d3bcb6e38cb911019b1686f181 100644 (file)
@@ -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), "
index 87fda8c47c560124d3e36a1a446d9fee8bee9014..3519d7914033083a362211eb5c68e71f1f3d70af 100644 (file)
@@ -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<curl/curl.h>\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), "