odin-http
odin-http copied to clipboard
A HTTP/1.1 client/server implementation for Odin.
This commit allow for serverless testing, this is a code snippet on how to use it: ``` import "core:testing" import http "." @(test) test_handler :: proc(t: ^testing.T) { http.td.state=.Testing req...
``` flush_completions :: proc(io: ^IO, wait_nr: u32, timeouts: ^uint, etime: ^bool) -> os.Errno { cqes: [256]io_uring.io_uring_cqe wait_remaining := wait_nr for { completed, err := io_uring.copy_cqes(&io.ring, cqes[:], wait_remaining) if err !=...
Tried to run it on termux proot-distro and got such kinds of errors: ``` /data/data/com.termux/files/home/.../odin-http/server.odin(141:2) runtime assertion: errno == os.ERROR_NONE ``` ``` /data/data/com.termux/files/home/.../odin-http/nbio/_io_uring/os.odin(94:2) runtime assertion: (params.features & IORING_FEAT_SINGLE_MMAP) != 0...
` defer free_all(context.temp_allocator) url := "https://cataas.com/cat" response, client_err := client.get(url) if client_err != nil { fmt.printfln("Error getting from endpoint: %v err") return } defer client.response_destroy(&response) ` Loses 97 bytes @...
``` .../libs/odin-http/server.odin:64:1: Error: @(init) procedures must be declared as "contextless" server_opts_init :: proc() { ^ .../libs/odin-http/status.odin:81:1: Error: @(init) procedures must be declared as "contextless" status_strings_init :: proc() { ^ ```...
Field `client` of type `net.Endpoint` on `http.Request` struct is never initalized in route handlers
When running on Windows 11 or latest Arch linux (probably also on other platforms), the value of `req.client` is systematically `nil/0` Here's a minimal example for reproduction: ```odin package main...
When running on Ubuntu 22.04.5 LTS, the following fails with Resolve_Error: ```go ... res, err := client.get("https://www.google.com/") if err != nil { fmt.printf("Request failed: %s\n", err) return } ... ```...
It would be helpful to add support for a user-defined callback to initialize custom thread-local variables. A use case for this feature would be to initialize database connection. Thank you...