-
Notifications
You must be signed in to change notification settings - Fork 286
Add real async http client #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5e083f2 to
522e22e
Compare
0a8f03c to
d2d2e85
Compare
src/http/async/main.zig
Outdated
| @@ -0,0 +1,4 @@ | |||
| const std = @import("std"); | |||
|
|
|||
| const stack = @import("stack.zig"); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not useful here right?
src/run_tests.zig
Outdated
| std.testing.refAllDecls(msgTest); | ||
|
|
||
| const asyncTest = @import("async/test.zig"); | ||
| const asyncTest = @import("http/async/std/http.zig"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also add the unit tests of http/async/stack.zig here
src/http/async/io.zig
Outdated
| cbk: Cbk, | ||
| ctx: *Ctx, | ||
|
|
||
| const Self = @This(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really useful here as it's not a generic struct
|
The program panics in release build only... $ ./zig-out/bin/lightpanda http://127.0.0.1:1234/campfire-commerce/
info(browser): GET http://127.0.0.1:1234/campfire-commerce/ http.Status.ok
info(browser): fech script http://127.0.0.1:1234/campfire-commerce/script.js: http.Status.ok
info(xhr): http.Method.GET http://127.0.0.1:1234/campfire-commerce/json/reviews.json http.Status.ok
Segmentation fault at address 0x7fbe99205000
/home/pierre/wrk/browser/src/http/async/std/http/Client.zig:2454:26: 0x17559fe in onResponse (lightpanda)
if (stack.next == null) {
^
/home/pierre/wrk/browser/src/http/async/std/http/Client.zig:2460:13: 0x1726076 in onFill (lightpanda)
return @call(.auto, func, .{ self, res });
^
/home/pierre/wrk/browser/src/http/async/io.zig:130:17: 0x1761494 in wrapper (lightpanda)
self.cbk(self.ctx, {}) catch |e| self.ctx.setErr(e);
^
/usr/local/zig-0.13.0/lib/std/debug.zig:0:9: 0x152b2f1 in flush (lightpanda)
/home/pierre/wrk/browser/vendor/zig-js-runtime/vendor/tigerbeetle-io/io/linux.zig:48:23: 0x15261fd in wait (lightpanda)
try self.flush(0, &timeouts, &etime);
^
/home/pierre/wrk/browser/src/main.zig:317:22: 0x15290ba in main (lightpanda)
try page.wait();
^
../sysdeps/nptl/libc_start_call_main.h:58:16: 0x7fbe9933fd67 in __libc_start_call_main (../sysdeps/x86/libc-start.c)
../csu/libc-start.c:360:3: 0x7fbe9933fe24 in __libc_start_main_impl (../sysdeps/x86/libc-start.c)
???:?:?: 0x1512020 in ??? (???)
???:?:?: 0x0 in ??? (???)
Aborted |
|
Closed in favor of #302 |
No description provided.