<feed xmlns='http://www.w3.org/2005/Atom'>
<title>unit-wasm.git/src/c/include/unit, branch v0.2.0</title>
<subtitle>Development libraries (C &amp; Rust) for writing WebAssembly modules for NGINX Unit</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit-wasm.git/'/>
<entry>
<title>unit-wasm 0.2.0</title>
<updated>2023-08-30T13:56:03+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2023-08-30T13:56:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit-wasm.git/commit/?id=d81bc9290edc8d1eb59ced024499359ccd4da77a'/>
<id>d81bc9290edc8d1eb59ced024499359ccd4da77a</id>
<content type='text'>
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libunit-wasm: Add a luw_get_http_total_content_sent() function</title>
<updated>2023-08-29T22:12:56+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2023-08-29T21:22:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit-wasm.git/commit/?id=59cb1e8000e1b18e317cb1c19185eb3a1b5d4e9f'/>
<id>59cb1e8000e1b18e317cb1c19185eb3a1b5d4e9f</id>
<content type='text'>
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 &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libunit-wasm: Pass ctx into luw_http_hdr_get_value() as const</title>
<updated>2023-08-28T19:44:23+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2023-08-28T11:37:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit-wasm.git/commit/?id=8dce3b870b923db810d232e408c530f938f75d80'/>
<id>8dce3b870b923db810d232e408c530f938f75d80</id>
<content type='text'>
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 &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libunit-wasm: Remove the idx argument from luw_http_add_header()</title>
<updated>2023-08-28T15:20:26+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2023-08-28T15:11:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit-wasm.git/commit/?id=da5d9dc03b14b4d0f1ce0ce3ff093f387e148706'/>
<id>da5d9dc03b14b4d0f1ce0ce3ff093f387e148706</id>
<content type='text'>
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 &lt;liam@nginx.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;liam@nginx.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libunit-wasm: Fix rust build</title>
<updated>2023-08-26T02:36:31+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2023-08-26T02:29:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit-wasm.git/commit/?id=d995a9ab6910b237bfbdfd25dcb28376735ad4bf'/>
<id>d995a9ab6910b237bfbdfd25dcb28376735ad4bf</id>
<content type='text'>
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 &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libunit-wasm: Include strings.h in the right file</title>
<updated>2023-08-26T01:29:26+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2023-08-26T01:25:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit-wasm.git/commit/?id=c78e268845e980e9e7ed1583c0581615d52580d5'/>
<id>c78e268845e980e9e7ed1583c0581615d52580d5</id>
<content type='text'>
When I added the luw_http_hdr_get_value() function I needed to include
strings.h, unfortunately I added it to unit-wasm.h instead of
libunit-wasm.c

This had the undesirable effect of requiring the wasi-sysroot when
building the rust stuff for generating the libunit-wasm rust bindings.

By including strings.h in the right file we get rid of that requirement
which a subsequent commit will take care of.

Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When I added the luw_http_hdr_get_value() function I needed to include
strings.h, unfortunately I added it to unit-wasm.h instead of
libunit-wasm.c

This had the undesirable effect of requiring the wasi-sysroot when
building the rust stuff for generating the libunit-wasm rust bindings.

By including strings.h in the right file we get rid of that requirement
which a subsequent commit will take care of.

Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libunit-wasm: Remove left over prototype from unit-wasm.h</title>
<updated>2023-08-24T10:42:23+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2023-08-24T10:40:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit-wasm.git/commit/?id=d1e442b3752afa0b036b2480ee4f4bc8517aa85a'/>
<id>d1e442b3752afa0b036b2480ee4f4bc8517aa85a</id>
<content type='text'>
There was a luw_destroy_ctx() function at one point and its prototype
was still in the header file...

Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There was a luw_destroy_ctx() function at one point and its prototype
was still in the header file...

Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libunit-wasm: Put LUW_SRB_FLAGS_ALL in the enum</title>
<updated>2023-08-24T00:08:40+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2023-08-24T00:08:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit-wasm.git/commit/?id=093f7d0810b608a398d850b1f3a7661c1a129d25'/>
<id>093f7d0810b608a398d850b1f3a7661c1a129d25</id>
<content type='text'>
No reason why this needed to be a separate #define.

Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No reason why this needed to be a separate #define.

Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Initial commit</title>
<updated>2023-08-21T22:24:12+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2023-08-02T16:03:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit-wasm.git/commit/?id=d6ed6a219b31a58526721f96195c80061d41ce54'/>
<id>d6ed6a219b31a58526721f96195c80061d41ce54</id>
<content type='text'>
libunit-wasm and example C and Rust WebAssembly modules for NGINX Unit.

Co-developed-by: Timo Stark &lt;t.stark@nginx.com&gt;
Co-developed-by: Liam Crilly &lt;liam@nginx.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
libunit-wasm and example C and Rust WebAssembly modules for NGINX Unit.

Co-developed-by: Timo Stark &lt;t.stark@nginx.com&gt;
Co-developed-by: Liam Crilly &lt;liam@nginx.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
