Skip to content

Commit

Permalink
curl_ws_*.3: enhance
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
bagder committed Jun 14, 2023
1 parent f15ded7 commit 7bee2ef
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
7 changes: 3 additions & 4 deletions docs/libcurl/curl_ws_meta.3
Original file line number Diff line number Diff line change
Expand Up @@ -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), "
2 changes: 1 addition & 1 deletion docs/libcurl/curl_ws_recv.3
Original file line number Diff line number Diff line change
Expand Up @@ -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), "
15 changes: 12 additions & 3 deletions docs/libcurl/curl_ws_send.3
Original file line number Diff line number Diff line change
Expand Up @@ -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), "

0 comments on commit 7bee2ef

Please sign in to comment.