replace array with an actual struct now that we have them
This commit is contained in:
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user