Age | Commit message (Collapse) | Author | Files | Lines |
|
uwr_get_http_content_len() & uwr_get_http_total_content_sent() now
return a u64.
Two new functions were added
uwr_req_buf_copy()
Like uwr_req_buf_append() but just copies the data over what's already
there.
uwr_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>
|
|
The new uwr_http_set_response_status() function allows to set the HTTP
response status in Rust WebAssembly modules. It takes one of the
luw_http_status_t response status values.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Must of got out of whack when editing it from the C version.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This returns the total amount of content that the Wasm module has
received so far.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This adds the following convenience functions for adding HTTP response
headers, Content-Type & Content-length
uwr_http_add_header_content_type(ctx: *mut luw_ctx_t, ctype: &str);
uwr_http_add_header_content_len(ctx: *mut luw_ctx_t);
These are perhaps the two most common headers so it makes sense to
reduce the effort to adding them.
E.g before
uwr_http_add_header(&ctx, "Content-Type", "text/plain");
uwr_http_add_header(
ctx,
"Content-Length",
&format!("{}", uwr_get_response_data_size(ctx)),
);
after
uwr_http_add_header_content_type(ctx, "text/plain");
uwr_http_add_header_content_len(ctx);
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This function is like uwr_get_http_content() except that it returns a
Rust str.
This is more convenient if you want to operate on the body content
within Rust.
It's worth noting that uwr_get_http_content() returns a non null
terminated buffer which makes it tricky to work with in Rust.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Use uwr_get_response_data_size() instead of uwr_get_http_content_len()
for the Content-Length, this is more appropriate as this will give the
length of the response data rather than the request data.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This was done by 'cp API-C.md API-Rust.md' and then adjusted as
necessary.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|