Skip to content

Commit 834a563

Browse files
authored
Merge pull request #96 from WebAssembly/pch/rc-2024-01-16
Update release candidate version to 0.2.0-rc-2024-01-16
2 parents 7a0889a + fc950fb commit 834a563

File tree

13 files changed

+96
-99
lines changed

13 files changed

+96
-99
lines changed

proxy.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ outgoing HTTP requests.</p>
1010
<li>interface <a href="#wasi:io_error_0.2.0_rc_2023_11_10"><code>wasi:io/error@0.2.0-rc-2023-11-10</code></a></li>
1111
<li>interface <a href="#wasi:io_poll_0.2.0_rc_2023_11_10"><code>wasi:io/poll@0.2.0-rc-2023-11-10</code></a></li>
1212
<li>interface <a href="#wasi:io_streams_0.2.0_rc_2023_11_10"><code>wasi:io/streams@0.2.0-rc-2023-11-10</code></a></li>
13-
<li>interface <a href="#wasi:cli_stdout_0.2.0_rc_2023_12_05"><code>wasi:cli/stdout@0.2.0-rc-2023-12-05</code></a></li>
14-
<li>interface <a href="#wasi:cli_stderr_0.2.0_rc_2023_12_05"><code>wasi:cli/stderr@0.2.0-rc-2023-12-05</code></a></li>
15-
<li>interface <a href="#wasi:cli_stdin_0.2.0_rc_2023_12_05"><code>wasi:cli/stdin@0.2.0-rc-2023-12-05</code></a></li>
13+
<li>interface <a href="#wasi:cli_stdout_0.2.0_rc_2024_01_16"><code>wasi:cli/stdout@0.2.0-rc-2024-01-16</code></a></li>
14+
<li>interface <a href="#wasi:cli_stderr_0.2.0_rc_2024_01_16"><code>wasi:cli/stderr@0.2.0-rc-2024-01-16</code></a></li>
15+
<li>interface <a href="#wasi:cli_stdin_0.2.0_rc_2024_01_16"><code>wasi:cli/stdin@0.2.0-rc-2024-01-16</code></a></li>
1616
<li>interface <a href="#wasi:clocks_monotonic_clock_0.2.0_rc_2023_11_10"><code>wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-10</code></a></li>
17-
<li>interface <a href="#wasi:http_types_0.2.0_rc_2023_12_05"><code>wasi:http/types@0.2.0-rc-2023-12-05</code></a></li>
18-
<li>interface <a href="#wasi:http_outgoing_handler_0.2.0_rc_2023_12_05"><code>wasi:http/outgoing-handler@0.2.0-rc-2023-12-05</code></a></li>
17+
<li>interface <a href="#wasi:http_types_0.2.0_rc_2024_01_16"><code>wasi:http/types@0.2.0-rc-2024-01-16</code></a></li>
18+
<li>interface <a href="#wasi:http_outgoing_handler_0.2.0_rc_2024_01_16"><code>wasi:http/outgoing-handler@0.2.0-rc-2024-01-16</code></a></li>
1919
<li>interface <a href="#wasi:clocks_wall_clock_0.2.0_rc_2023_11_10"><code>wasi:clocks/wall-clock@0.2.0-rc-2023-11-10</code></a></li>
2020
</ul>
2121
</li>
2222
<li>Exports:
2323
<ul>
24-
<li>interface <a href="#wasi:http_incoming_handler_0.2.0_rc_2023_12_05"><code>wasi:http/incoming-handler@0.2.0-rc-2023-12-05</code></a></li>
24+
<li>interface <a href="#wasi:http_incoming_handler_0.2.0_rc_2024_01_16"><code>wasi:http/incoming-handler@0.2.0-rc-2024-01-16</code></a></li>
2525
</ul>
2626
</li>
2727
</ul>
@@ -191,6 +191,10 @@ polled for using <code>wasi:io/poll</code>.</h2>
191191
<h3>Functions</h3>
192192
<h4><a name="method_input_stream.read"><code>[method]input-stream.read: func</code></a></h4>
193193
<p>Perform a non-blocking read from the stream.</p>
194+
<p>When the source of a <code>read</code> is binary data, the bytes from the source
195+
are returned verbatim. When the source of a <code>read</code> is known to the
196+
implementation to be text, bytes containing the UTF-8 encoding of the
197+
text are returned.</p>
194198
<p>This function returns a list of bytes containing the read data,
195199
when successful. The returned list will contain up to <code>len</code> bytes;
196200
it may return fewer than requested, but not more. The list is
@@ -286,6 +290,11 @@ error.</p>
286290
</ul>
287291
<h4><a name="method_output_stream.write"><code>[method]output-stream.write: func</code></a></h4>
288292
<p>Perform a write. This function never blocks.</p>
293+
<p>When the destination of a <code>write</code> is binary data, the bytes from
294+
<code>contents</code> are written verbatim. When the destination of a <code>write</code> is
295+
known to the implementation to be text, the bytes of <code>contents</code> are
296+
transcoded from UTF-8 into the encoding of the destination and then
297+
written.</p>
289298
<p>Precondition: check-write gave permit of Ok(n) and contents has a
290299
length of less than or equal to n. Otherwise, this function will trap.</p>
291300
<p>returns Err(closed) without writing if the stream has closed since
@@ -459,7 +468,7 @@ is ready for reading, before performing the <code>splice</code>.</p>
459468
<ul>
460469
<li><a name="method_output_stream.blocking_splice.0"></a> result&lt;<code>u64</code>, <a href="#stream_error"><a href="#stream_error"><code>stream-error</code></a></a>&gt;</li>
461470
</ul>
462-
<h2><a name="wasi:cli_stdout_0.2.0_rc_2023_12_05">Import interface wasi:cli/stdout@0.2.0-rc-2023-12-05</a></h2>
471+
<h2><a name="wasi:cli_stdout_0.2.0_rc_2024_01_16">Import interface wasi:cli/stdout@0.2.0-rc-2024-01-16</a></h2>
463472
<hr />
464473
<h3>Types</h3>
465474
<h4><a name="output_stream"><code>type output-stream</code></a></h4>
@@ -472,7 +481,7 @@ is ready for reading, before performing the <code>splice</code>.</p>
472481
<ul>
473482
<li><a name="get_stdout.0"></a> own&lt;<a href="#output_stream"><a href="#output_stream"><code>output-stream</code></a></a>&gt;</li>
474483
</ul>
475-
<h2><a name="wasi:cli_stderr_0.2.0_rc_2023_12_05">Import interface wasi:cli/stderr@0.2.0-rc-2023-12-05</a></h2>
484+
<h2><a name="wasi:cli_stderr_0.2.0_rc_2024_01_16">Import interface wasi:cli/stderr@0.2.0-rc-2024-01-16</a></h2>
476485
<hr />
477486
<h3>Types</h3>
478487
<h4><a name="output_stream"><code>type output-stream</code></a></h4>
@@ -485,7 +494,7 @@ is ready for reading, before performing the <code>splice</code>.</p>
485494
<ul>
486495
<li><a name="get_stderr.0"></a> own&lt;<a href="#output_stream"><a href="#output_stream"><code>output-stream</code></a></a>&gt;</li>
487496
</ul>
488-
<h2><a name="wasi:cli_stdin_0.2.0_rc_2023_12_05">Import interface wasi:cli/stdin@0.2.0-rc-2023-12-05</a></h2>
497+
<h2><a name="wasi:cli_stdin_0.2.0_rc_2024_01_16">Import interface wasi:cli/stdin@0.2.0-rc-2024-01-16</a></h2>
489498
<hr />
490499
<h3>Types</h3>
491500
<h4><a name="input_stream"><code>type input-stream</code></a></h4>
@@ -559,7 +568,7 @@ occured.</p>
559568
<ul>
560569
<li><a name="subscribe_duration.0"></a> own&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
561570
</ul>
562-
<h2><a name="wasi:http_types_0.2.0_rc_2023_12_05">Import interface wasi:http/types@0.2.0-rc-2023-12-05</a></h2>
571+
<h2><a name="wasi:http_types_0.2.0_rc_2024_01_16">Import interface wasi:http/types@0.2.0-rc-2024-01-16</a></h2>
563572
<p>This interface defines all of the types and methods for implementing
564573
HTTP Requests and Responses, both incoming and outgoing, as well as
565574
their headers, trailers, and bodies.</p>
@@ -1445,7 +1454,7 @@ but those will be reported by the <a href="#incoming_body"><code>incoming-body</
14451454
<ul>
14461455
<li><a name="method_future_incoming_response.get.0"></a> option&lt;result&lt;result&lt;own&lt;<a href="#incoming_response"><a href="#incoming_response"><code>incoming-response</code></a></a>&gt;, <a href="#error_code"><a href="#error_code"><code>error-code</code></a></a>&gt;&gt;&gt;</li>
14471456
</ul>
1448-
<h2><a name="wasi:http_outgoing_handler_0.2.0_rc_2023_12_05">Import interface wasi:http/outgoing-handler@0.2.0-rc-2023-12-05</a></h2>
1457+
<h2><a name="wasi:http_outgoing_handler_0.2.0_rc_2024_01_16">Import interface wasi:http/outgoing-handler@0.2.0-rc-2024-01-16</a></h2>
14491458
<p>This interface defines a handler of outgoing HTTP Requests. It should be
14501459
imported by components which wish to make HTTP Requests.</p>
14511460
<hr />
@@ -1523,7 +1532,7 @@ also known as <a href="https://en.wikipedia.org/wiki/Unix_time">Unix Time</a>.</
15231532
<ul>
15241533
<li><a name="resolution.0"></a> <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li>
15251534
</ul>
1526-
<h2><a name="wasi:http_incoming_handler_0.2.0_rc_2023_12_05">Export interface wasi:http/incoming-handler@0.2.0-rc-2023-12-05</a></h2>
1535+
<h2><a name="wasi:http_incoming_handler_0.2.0_rc_2024_01_16">Export interface wasi:http/incoming-handler@0.2.0-rc-2024-01-16</a></h2>
15271536
<hr />
15281537
<h3>Types</h3>
15291538
<h4><a name="incoming_request"><code>type incoming-request</code></a></h4>

wit/deps.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[cli]
22
url = "https://github.com/WebAssembly/wasi-cli/archive/main.tar.gz"
3-
sha256 = "6894203a2ac50a68f6b91f2174826c2987cc0efc94ad1f8f14f8460e262fc103"
4-
sha512 = "349776db1b1455e176ca61a1a8ec653f77b888d291e948feded3b6b46350c65973e9e75cc0bf8649256654001af2408eacc585c31454008c86ff53b301da5c32"
3+
sha256 = "754f9d1de112e106cc7131b79b1efd29340f9d6191699f224835fd41521ba386"
4+
sha512 = "908a67492c05f752b0152646e5acdccdde89d8b303db254bf462d2e6714c420d80ebebc46ab75b8953c060a06ea06d99d55b523f6aa09e2f4f16d5e63649f0ea"
55

66
[clocks]
77
url = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz"
@@ -15,8 +15,8 @@ sha512 = "2c242489801a75466986fe014d730fb3aa7b5c6e56a230c8735e6672711b58bcbe92ba
1515

1616
[io]
1717
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
18-
sha256 = "b622db2755978a49d18d35d84d75f66b2b1ed23d7bf413e5c9e152e190cc7d4b"
19-
sha512 = "d19c9004e75bf3ebe3e34cff498c3d7fee04cd57a7fba7ed12a0c5ad842ba5715c009de77a152c57da0500f6ca0986b6791b6f022829bdd5a024f7bc114c2ff6"
18+
sha256 = "7a3c644dfd434f77fdf3f3d3b3caaca9538a0ade785167a3cce0321609f9d4e1"
19+
sha512 = "2888f12b91359d630b4270f60e3c78855d9b305274ebf8a5decaef8698a74cc85c426823dc708b393f461b85ad991711d7400c2b2a24795001db5aee3ae19c70"
2020

2121
[random]
2222
url = "https://github.com/WebAssembly/wasi-random/archive/main.tar.gz"
@@ -25,5 +25,5 @@ sha512 = "cc4fa3d178559a89d9d6a376e3359b892158d1e73317c5db1f797ebc6b0b57abf24227
2525

2626
[sockets]
2727
url = "https://github.com/WebAssembly/wasi-sockets/archive/main.tar.gz"
28-
sha256 = "b5c2e9cc87cefbaef06bbe9978f9bc336da9feee2d51747bc28e10164fc46c39"
29-
sha512 = "3aea6fe0c768b27d5c5cb3adab5e60dc936198f8b677c2cf6c4d57a0460db87eb779e0b577f1240fb2a6bf3ade49919fbffe39b0137bce3242343e6091cc7510"
28+
sha256 = "40863017f355ac90c57630cc00b94518804e8e2c5694a7870b7a54dbdcda0e08"
29+
sha512 = "2d6a919247430e869bf85a06a6a1d198f04368951e76c1fec7961b2b07af381c58c8e8b9079c91925dfbf80976971213329be57d59a90bae6e4e6460b073dc88"

wit/deps/cli/command.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:cli@0.2.0-rc-2023-12-05;
1+
package wasi:cli@0.2.0-rc-2024-01-16;
22

33
world command {
44
include imports;

wit/deps/cli/imports.wit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package wasi:cli@0.2.0-rc-2023-12-05;
1+
package wasi:cli@0.2.0-rc-2024-01-16;
22

33
world imports {
44
include wasi:clocks/imports@0.2.0-rc-2023-11-10;
55
include wasi:filesystem/imports@0.2.0-rc-2023-11-10;
6-
include wasi:sockets/imports@0.2.0-rc-2023-11-10;
6+
include wasi:sockets/imports@0.2.0-rc-2024-01-16;
77
include wasi:random/imports@0.2.0-rc-2023-11-10;
88
include wasi:io/imports@0.2.0-rc-2023-11-10;
99

wit/deps/cli/terminal.wit

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1+
/// Terminal input.
2+
///
3+
/// In the future, this may include functions for disabling echoing,
4+
/// disabling input buffering so that keyboard events are sent through
5+
/// immediately, querying supported features, and so on.
16
interface terminal-input {
27
/// The input side of a terminal.
38
resource terminal-input;
4-
5-
// In the future, this may include functions for disabling echoing,
6-
// disabling input buffering so that keyboard events are sent through
7-
// immediately, querying supported features, and so on.
89
}
910

11+
/// Terminal output.
12+
///
13+
/// In the future, this may include functions for querying the terminal
14+
/// size, being notified of terminal size changes, querying supported
15+
/// features, and so on.
1016
interface terminal-output {
1117
/// The output side of a terminal.
1218
resource terminal-output;
13-
14-
// In the future, this may include functions for querying the terminal
15-
// size, being notified of terminal size changes, querying supported
16-
// features, and so on.
1719
}
1820

1921
/// An interface providing an optional `terminal-input` for stdin as a

wit/deps/io/streams.wit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ interface streams {
3232
resource input-stream {
3333
/// Perform a non-blocking read from the stream.
3434
///
35+
/// When the source of a `read` is binary data, the bytes from the source
36+
/// are returned verbatim. When the source of a `read` is known to the
37+
/// implementation to be text, bytes containing the UTF-8 encoding of the
38+
/// text are returned.
39+
///
3540
/// This function returns a list of bytes containing the read data,
3641
/// when successful. The returned list will contain up to `len` bytes;
3742
/// it may return fewer than requested, but not more. The list is
@@ -111,6 +116,12 @@ interface streams {
111116

112117
/// Perform a write. This function never blocks.
113118
///
119+
/// When the destination of a `write` is binary data, the bytes from
120+
/// `contents` are written verbatim. When the destination of a `write` is
121+
/// known to the implementation to be text, the bytes of `contents` are
122+
/// transcoded from UTF-8 into the encoding of the destination and then
123+
/// written.
124+
///
114125
/// Precondition: check-write gave permit of Ok(n) and contents has a
115126
/// length of less than or equal to n. Otherwise, this function will trap.
116127
///

wit/deps/sockets/network.wit

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ interface network {
1818
///
1919
/// See each individual API for what the POSIX equivalents are. They sometimes differ per API.
2020
enum error-code {
21-
// ### GENERAL ERRORS ###
22-
2321
/// Unknown error
2422
unknown,
2523

@@ -64,9 +62,6 @@ interface network {
6462
would-block,
6563

6664

67-
68-
// ### TCP & UDP SOCKET ERRORS ###
69-
7065
/// The operation is not valid in the socket's current state.
7166
invalid-state,
7267

@@ -83,24 +78,21 @@ interface network {
8378
remote-unreachable,
8479

8580

86-
// ### TCP SOCKET ERRORS ###
87-
88-
/// The connection was forcefully rejected
81+
/// The TCP connection was forcefully rejected
8982
connection-refused,
9083

91-
/// The connection was reset.
84+
/// The TCP connection was reset.
9285
connection-reset,
9386

94-
/// A connection was aborted.
87+
/// A TCP connection was aborted.
9588
connection-aborted,
9689

9790

98-
// ### UDP SOCKET ERRORS ###
91+
/// The size of a datagram sent to a UDP socket exceeded the maximum
92+
/// supported size.
9993
datagram-too-large,
10094

10195

102-
// ### NAME LOOKUP ERRORS ###
103-
10496
/// Name does not exist or has no suitable associated IP addresses.
10597
name-unresolvable,
10698

@@ -128,15 +120,21 @@ interface network {
128120
}
129121

130122
record ipv4-socket-address {
131-
port: u16, // sin_port
132-
address: ipv4-address, // sin_addr
123+
/// sin_port
124+
port: u16,
125+
/// sin_addr
126+
address: ipv4-address,
133127
}
134128

135129
record ipv6-socket-address {
136-
port: u16, // sin6_port
137-
flow-info: u32, // sin6_flowinfo
138-
address: ipv6-address, // sin6_addr
139-
scope-id: u32, // sin6_scope_id
130+
/// sin6_port
131+
port: u16,
132+
/// sin6_flowinfo
133+
flow-info: u32,
134+
/// sin6_addr
135+
address: ipv6-address,
136+
/// sin6_scope_id
137+
scope-id: u32,
140138
}
141139

142140
variant ip-socket-address {

wit/deps/sockets/tcp-create-socket.wit

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ interface tcp-create-socket {
66
/// Create a new TCP socket.
77
///
88
/// Similar to `socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP)` in POSIX.
9+
/// On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.
910
///
1011
/// This function does not require a network capability handle. This is considered to be safe because
11-
/// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`listen`/`connect`
12+
/// at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`connect`
1213
/// is called, the socket is effectively an in-memory configuration object, unable to communicate with the outside world.
1314
///
1415
/// All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations.

0 commit comments

Comments
 (0)