replace array with an actual struct now that we have them

This commit is contained in:
2026-03-11 20:44:55 +01:00
parent d78a77b075
commit 3fcd82cc04
22 changed files with 220 additions and 224 deletions

View File

@@ -1,14 +1,14 @@
func main[argc: i64, argv: ptr] : i64
if argc < 2
dbg.panic("url missing")
panic("url missing")
let url: str = mem.read64(argv + 8)
if str.len(url) <= 7
dbg.panic("missing url scheme")
panic("missing url scheme")
if !str.equal(str.substr(url, 0, 7), "http://")
dbg.panic("invalid url scheme")
panic("invalid url scheme")
let url_len: i64 = str.len(url)
let host_start = 7
@@ -25,7 +25,7 @@ func main[argc: i64, argv: ptr] : i64
let s: i64 = net.connect(host, 80)
if s < 0
dbg.panic("failed to connect")
panic("failed to connect")
// very leaky
let req: str = "GET "