curl_ws_meta: initial implementation

This commit is contained in:
Daniel Stenberg 2022-09-09 15:11:14 +02:00
parent 07cb887ed3
commit eebfa3279d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 37 additions and 8 deletions

View file

@ -50,9 +50,17 @@ This function requires an easy handle as input argument for libcurl to know
what transfer the question is about, but as there is no such pointer provided
to the callback by libcurl itself, applications that want to use
\fIcurl_ws_meta(3)\fP need to pass it on to the callback on its own.
.SH "struct fields"
.IP age
This field specify the age of this struct. It is always zero for now.
.IP recvflags
This is a bitmask with the exact same meaning as the \fBrecvflags\fP
documented for \fIcurl_ws_recv(3)\fP.
.SH EXAMPLE
.nf
/* we pass a pointer to this struct to the callback */
struct customdata {
CURL *easy;
void *ptr;
@ -70,6 +78,7 @@ static size_t writecb(unsigned char *buffer,
{
struct customdata custom;
custom.easy = easy;
custom.ptr = NULL;
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writecb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &custom);
}