Skip to content
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

Add real async http client #300

Closed
wants to merge 10 commits into from
Closed

Add real async http client #300

wants to merge 10 commits into from

Conversation

krichprollsch
Copy link
Member

No description provided.

@@ -0,0 +1,4 @@
const std = @import("std");

const stack = @import("stack.zig");
Copy link
Member

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?

@@ -298,7 +298,7 @@ test {
const msgTest = @import("msg.zig");
std.testing.refAllDecls(msgTest);

const asyncTest = @import("async/test.zig");
const asyncTest = @import("http/async/std/http.zig");
Copy link
Member

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

cbk: Cbk,
ctx: *Ctx,

const Self = @This();
Copy link
Member

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

@krichprollsch
Copy link
Member Author

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

@francisbouvier
Copy link
Member

Closed in favor of #302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants