Skip to content

Commit

Permalink
Remove deprecated WS- and HTTP-related types and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Arshia001 committed May 14, 2024
1 parent ba6930c commit b0c8ecf
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 172 deletions.
2 changes: 0 additions & 2 deletions expected/wasm32-wasi-threads/defined-symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,6 @@ __wasi_futex_wait
__wasi_futex_wake
__wasi_futex_wake_all
__wasi_getcwd
__wasi_http_request
__wasi_http_status
__wasi_init_tp
__wasi_path_create_directory
__wasi_path_filestat_get
Expand Down
3 changes: 0 additions & 3 deletions expected/wasm32-wasi-threads/undefined-symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ __imported_wasix_32v1_futex_wait
__imported_wasix_32v1_futex_wake
__imported_wasix_32v1_futex_wake_all
__imported_wasix_32v1_getcwd
__imported_wasix_32v1_http_request
__imported_wasix_32v1_http_status
__imported_wasix_32v1_port_addr_add
__imported_wasix_32v1_port_addr_clear
__imported_wasix_32v1_port_addr_list
Expand Down Expand Up @@ -129,7 +127,6 @@ __imported_wasix_32v1_thread_sleep
__imported_wasix_32v1_thread_spawn_v2
__imported_wasix_32v1_tty_get
__imported_wasix_32v1_tty_set
__imported_wasix_32v1_ws_connect
__letf2
__lttf2
__netf2
Expand Down
3 changes: 0 additions & 3 deletions expected/wasm32-wasi/defined-symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,6 @@ __wasi_futex_wait
__wasi_futex_wake
__wasi_futex_wake_all
__wasi_getcwd
__wasi_http_request
__wasi_http_status
__wasi_init_tp
__wasi_path_create_directory
__wasi_path_filestat_get
Expand Down Expand Up @@ -482,7 +480,6 @@ __wasi_thread_spawn_v2
__wasi_thread_start_C
__wasi_tty_get
__wasi_tty_set
__wasi_ws_connect
__wasilibc_access
__wasilibc_cwd
__wasilibc_cwd_lock
Expand Down
3 changes: 0 additions & 3 deletions expected/wasm32-wasi/undefined-symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ __imported_wasix_32v1_futex_wait
__imported_wasix_32v1_futex_wake
__imported_wasix_32v1_futex_wake_all
__imported_wasix_32v1_getcwd
__imported_wasix_32v1_http_request
__imported_wasix_32v1_http_status
__imported_wasix_32v1_port_addr_add
__imported_wasix_32v1_port_addr_clear
__imported_wasix_32v1_port_addr_list
Expand Down Expand Up @@ -129,7 +127,6 @@ __imported_wasix_32v1_thread_sleep
__imported_wasix_32v1_thread_spawn_v2
__imported_wasix_32v1_tty_get
__imported_wasix_32v1_tty_set
__imported_wasix_32v1_ws_connect
__letf2
__lttf2
__main_argc_argv
Expand Down
3 changes: 0 additions & 3 deletions expected/wasm64-wasi/defined-symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,6 @@ __wasi_futex_wait
__wasi_futex_wake
__wasi_futex_wake_all
__wasi_getcwd
__wasi_http_request
__wasi_http_status
__wasi_init_tp
__wasi_path_create_directory
__wasi_path_filestat_get
Expand Down Expand Up @@ -482,7 +480,6 @@ __wasi_thread_spawn_v2
__wasi_thread_start_C
__wasi_tty_get
__wasi_tty_set
__wasi_ws_connect
__wasilibc_access
__wasilibc_cwd
__wasilibc_cwd_lock
Expand Down
3 changes: 0 additions & 3 deletions expected/wasm64-wasi/undefined-symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ __imported_wasix_64v1_futex_wait
__imported_wasix_64v1_futex_wake
__imported_wasix_64v1_futex_wake_all
__imported_wasix_64v1_getcwd
__imported_wasix_64v1_http_request
__imported_wasix_64v1_http_status
__imported_wasix_64v1_port_addr_add
__imported_wasix_64v1_port_addr_clear
__imported_wasix_64v1_port_addr_list
Expand Down Expand Up @@ -130,7 +128,6 @@ __imported_wasix_64v1_thread_sleep
__imported_wasix_64v1_thread_spawn_v2
__imported_wasix_64v1_tty_get
__imported_wasix_64v1_tty_set
__imported_wasix_64v1_ws_connect
__letf2
__lttf2
__main_argc_argv
Expand Down
108 changes: 0 additions & 108 deletions libc-bottom-half/headers/public/wasi/api_wasix.h
Original file line number Diff line number Diff line change
Expand Up @@ -3159,61 +3159,6 @@ _Static_assert(offsetof(__wasi_route_t, via_router) == 28, "witx calculated offs
_Static_assert(offsetof(__wasi_route_t, preferred_until) == 144, "witx calculated offset");
_Static_assert(offsetof(__wasi_route_t, expires_at) == 160, "witx calculated offset");

/**
* HTTP request handles used to send and receive data to the server
*/
typedef struct __wasi_http_handles_t {
/**
* File handle used to write the request data
*/
__wasi_fd_t request;

/**
* File handle used to receive the response data
*/
__wasi_fd_t response;

/**
* File handle used to read the response headers
* (entries are separated by line feeds)
*/
__wasi_fd_t headers;

} __wasi_http_handles_t;

_Static_assert(sizeof(__wasi_http_handles_t) == 12, "witx calculated size");
_Static_assert(_Alignof(__wasi_http_handles_t) == 4, "witx calculated align");
_Static_assert(offsetof(__wasi_http_handles_t, request) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_http_handles_t, response) == 4, "witx calculated offset");
_Static_assert(offsetof(__wasi_http_handles_t, headers) == 8, "witx calculated offset");

/**
* HTTP response status
*/
typedef struct __wasi_http_status_t {
__wasi_bool_t ok;

__wasi_bool_t redirected;

/**
* Size of the response
*/
__wasi_filesize_t size;

/**
* HTTP status code for this response
*/
uint16_t status;

} __wasi_http_status_t;

_Static_assert(sizeof(__wasi_http_status_t) == 24, "witx calculated size");
_Static_assert(_Alignof(__wasi_http_status_t) == 8, "witx calculated align");
_Static_assert(offsetof(__wasi_http_status_t, ok) == 0, "witx calculated offset");
_Static_assert(offsetof(__wasi_http_status_t, redirected) == 1, "witx calculated offset");
_Static_assert(offsetof(__wasi_http_status_t, size) == 8, "witx calculated offset");
_Static_assert(offsetof(__wasi_http_status_t, status) == 16, "witx calculated offset");

/**
* join flags.
*/
Expand Down Expand Up @@ -3977,59 +3922,6 @@ __wasi_errno_t __wasi_proc_signal(
*/
__wasi_signal_t signal
) __attribute__((__warn_unused_result__));
/**
* Connects to a websocket at a particular network URL
* @return
* Returns a socket handle which is used to send and receive data
*/
__wasi_errno_t __wasi_ws_connect(
/**
* URL of the web socket destination to connect to
*/
const char *url,
__wasi_fd_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Makes a HTTP request to a remote web resource and
* returns a socket handles that are used to send and receive data
* @return
* The body of the response can be streamed from the returned
* file handle
*/
__wasi_errno_t __wasi_http_request(
/**
* URL of the HTTP resource to connect to
*/
const char *url,
/**
* HTTP method to be invoked
*/
const char *method,
/**
* HTTP headers to attach to the request
* (headers seperated by lines)
*/
const char *headers,
/**
* Should the request body be compressed
*/
__wasi_bool_t gzip,
__wasi_http_handles_t *retptr0
) __attribute__((__warn_unused_result__));
/**
* Retrieves the status of a HTTP request
*/
__wasi_errno_t __wasi_http_status(
/**
* Handle of the HTTP request
*/
__wasi_fd_t fd,
/**
* Pointer to a buffer that will be filled with the current
* status of this HTTP request
*/
__wasi_http_status_t * status
) __attribute__((__warn_unused_result__));
/**
* Securely connects to a particular remote network
*/
Expand Down
46 changes: 0 additions & 46 deletions libc-bottom-half/sources/__wasixlibc_real.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,52 +396,6 @@ __wasi_errno_t __wasi_proc_signal(
return (uint16_t) ret;
}

int32_t __imported_wasix_32v1_ws_connect(int32_t arg0, int32_t arg1, int32_t arg2) __attribute__((
__import_module__("wasix_32v1"),
__import_name__("ws_connect")
));

__wasi_errno_t __wasi_ws_connect(
const char *url,
__wasi_fd_t *retptr0
){
size_t url_len = strlen(url);
int32_t ret = __imported_wasix_32v1_ws_connect((intptr_t) url, (intptr_t) url_len, (intptr_t) retptr0);
return (uint16_t) ret;
}

int32_t __imported_wasix_32v1_http_request(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, int32_t arg6, int32_t arg7) __attribute__((
__import_module__("wasix_32v1"),
__import_name__("http_request")
));

__wasi_errno_t __wasi_http_request(
const char *url,
const char *method,
const char *headers,
__wasi_bool_t gzip,
__wasi_http_handles_t *retptr0
){
size_t url_len = strlen(url);
size_t method_len = strlen(method);
size_t headers_len = strlen(headers);
int32_t ret = __imported_wasix_32v1_http_request((intptr_t) url, (intptr_t) url_len, (intptr_t) method, (intptr_t) method_len, (intptr_t) headers, (intptr_t) headers_len, (int32_t) gzip, (intptr_t) retptr0);
return (uint16_t) ret;
}

int32_t __imported_wasix_32v1_http_status(int32_t arg0, int32_t arg1) __attribute__((
__import_module__("wasix_32v1"),
__import_name__("http_status")
));

__wasi_errno_t __wasi_http_status(
__wasi_fd_t fd,
__wasi_http_status_t * status
){
int32_t ret = __imported_wasix_32v1_http_status((int32_t) fd, (int32_t) status);
return (uint16_t) ret;
}

int32_t __imported_wasix_32v1_port_bridge(int32_t arg0, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4) __attribute__((
__import_module__("wasix_32v1"),
__import_name__("port_bridge")
Expand Down
2 changes: 1 addition & 1 deletion tools/wasix-headers/WASI

0 comments on commit b0c8ecf

Please sign in to comment.