CURLOPT_STREAM_WEIGHT(3) curl_easy_setopt options CURLOPT_STREAM_WEIGHT(3)NAME
CURLOPT_STREAM_WEIGHT - set numerical stream weight
SYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_STREAM_WEIGHT, long weight);
DESCRIPTION
Set the long weight to a number between 1 and 256.
When using HTTP/2, this option sets the individual weight for this particular stream used by the easy handle. Setting and using weights
only makes sense and is only usable when doing multiple streams over the same connections, which thus implies that you use CURLMOPT_PIPE-
LINING(3).
This option can be set during transfer and will then cause the updated weight info get sent to the server the next time a HTTP/2 frame is
sent to the server.
See section 5.3 of RFC 7540 for protocol details: https://httpwg.github.io/specs/rfc7540.html#StreamPriority
Streams with the same parent should be allocated resources proportionally based on their weight. So if you have two streams going, stream A
with weight 16 and stream B with weight 32, stream B will get two thirds (32/48) of the available bandwidth (assuming the server can send
off the data equally for both streams).
DEFAULT
If nothing is set, the HTTP/2 protocol itself will use its own default which is 16.
PROTOCOLS
HTTP/2
EXAMPLE
TODO
AVAILABILITY
Added in 7.46.0
RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
SEE ALSO CURLOPT_STREAM_DEPENDS(3), CURLOPT_STREAM_DEPENDS_E(3), CURLOPT_PIPEWAIT(3), CURLMOPT_PIPELINING(3),
libcurl 7.54.0 February 03, 2016 CURLOPT_STREAM_WEIGHT(3)
Check Out this Related Man Page
CURLOPT_UPLOAD(3) curl_easy_setopt options CURLOPT_UPLOAD(3)NAME
CURLOPT_UPLOAD - enable data upload
SYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UPLOAD, long upload);
DESCRIPTION
The long parameter upload set to 1 tells the library to prepare for and perform an upload. The CURLOPT_READDATA(3) and CURLOPT_INFILE-
SIZE(3) or CURLOPT_INFILESIZE_LARGE(3) options are also interesting for uploads. If the protocol is HTTP, uploading means using the PUT
request unless you tell libcurl otherwise.
Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with CURLOPT_HTTPHEADER(3) as
usual.
If you use PUT to a HTTP 1.1 server, you can upload data without knowing the size before starting the transfer if you use chunked encoding.
You enable this by adding a header like "Transfer-Encoding: chunked" with CURLOPT_HTTPHEADER(3). With HTTP 1.0 or without chunked transfer,
you must specify the size.
DEFAULT
0, default is download
PROTOCOLS
Most
EXAMPLE
CURL *curl = curl_easy_init();
if(curl) {
/* we want to use our own read function */
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
/* enable uploading */
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* specify target */
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/to/newfile");
/* now specify which pointer to pass to our callback */
curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
/* Set the size of the file to upload */
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)fsize);
/* Now run off and do what you've been told! */
curl_easy_perform(curl);
}
AVAILABILITY
Always
RETURN VALUE
Returns CURLE_OK
SEE ALSO CURLOPT_PUT(3), CURLOPT_READFUNCTION(3), CURLOPT_INFILESIZE_LARGE(3),
libcurl 7.54.0 February 03, 2016 CURLOPT_UPLOAD(3)
I have Apache running on a Solaris server. Does anyone know how I go about using HTTP for a file transfer ( or I guess more properly termed in HTTP as a document transfer ) ? I have a requirement that restricts my file transfer options to HTTP only !
Is there any changes I need to make to the... (10 Replies)
I have file like that
name is M1
address is ......
tall is .....
weight is .....
name is M2
address is ......
tall is .....
weight is .....
and same type of data for many persons (M3, M4,...). I want to use sed or awk to get the weight and tall for every person , so the output file... (3 Replies)
Hi,
I need to mass delete the following string(s) from my files
weight=100,
However the '100' is variable e.g
Current:
----------------
moretext=bar, weight=100, moreinfo=blah
extrastuff=hi, weight=9999, extrainfo=foo
Desired:
------------------
moretext=bar, moreinfo=blah... (2 Replies)
Overview:
I'm looking for a way to get usage data for all mount points (UFS,VxFS & NFS) on a Solaris system. I'm starting with `df` but would like to find something that might be more light-weight.
Background:
Using SNMP is not an option in this case, instead I need to use basic built-in... (2 Replies)