Age | Commit message (Collapse) | Author | Files | Lines |
|
The types of some of the member of the luw_req structure increased to
64bits to allow for uploads larger than 4GiB.
Two new functions were added
luw_req_buf_copy()
Like luw_req_buf_append() but just copies the data over what's already
there.
luw_mem_splice_file()
This write(2)'s the request data directly from the shared memory to a
given file.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This adds a new luw_http_set_response_status() function that takes one
of the luw_http_status_t response status codes.
This function should be called before any calls to
luw_http_send_headers() or luw_http_send_response().
This function calls into Unit via a new function import,
nxt_wasm_set_resp_status().
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This function returns the total amount of content that the Wasm module
has received so far.
This will be used in the rusty API's uwr_get_http_content_str() function
which returns the body content as a string. Due to the body content not
being null-terminated we need to know how much data to use for the
string, for which we are currently using uwr_get_http_content_len(),
which could in some cases return too much if a request is being split
over multiple calls the module.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Technically the context pointer can be passed in const even though we
then un-const it passing it to the luw_foreach_http_hdr() macro.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This was used to specify the index of the response header being added,
starting at 0 and incrementing by one for each header.
Instead of having the programmer specify this, track it internally.
We add an extra check in luw_http_add_header() to make sure we aren't
trying to add more headers than we said with luw_http_init_headers(), if
we are, simply return.
This updates the API-C.md and the various examples and 'rusty' API
wrapper.
Suggested-by: Liam Crilly <liam@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
The rust build failed when trying to publish new crates, although for
some reason it didn't fail before that, due to the luw_srb_flags_t enums
generated by bindgen being 32 bit unsigned integers and the flags
argument to luw_set_req_buf() being an unsigned long (which is 64 bits
on my system) and thus producing a type mismatch error.
Rather than fight with rust just make the flags argument an unsigned
int, 32 bits is more than enough for this anyway.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
No reason why this needed to be a separate #define.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Requested-by: Liam Crilly <liam@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
libunit-wasm and example C and Rust WebAssembly modules for NGINX Unit.
Co-developed-by: Timo Stark <t.stark@nginx.com>
Co-developed-by: Liam Crilly <liam@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|