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

Can't work with nginx-quic branch #1887

Open
yongjianchn opened this issue Jun 10, 2021 · 1 comment
Open

Can't work with nginx-quic branch #1887

yongjianchn opened this issue Jun 10, 2021 · 1 comment

Comments

@yongjianchn
Copy link

Got these errors when I use nginx-quic branch (for http3):

lua entry thread aborted: runtime error: access_by_lua()...
API disabled in the current context
stack traceback
.../lib/resty/core/request.lua:287: in function 'get_method'
...

Reason I guess:
r->connection->fd is -1 for requests in quic stream, lua-nginx-module take the normal http3/quic requests as 'fake requests' or bad requests. So, lua-nginx-module can not work with http3/quic requests.

related codes:

ngx_http_lua_ffi_req_get_method(ngx_http_request_t *r)
{
    if (r->connection->fd == (ngx_socket_t) -1) {
        return NGX_HTTP_LUA_FFI_BAD_CONTEXT;
    }
    return r->method;
}
ngx_quic_create_stream(ngx_connection_t *c, uint64_t id)
{
    ...
    ngx_connection_t       *sc;
    ...
    sc = ngx_get_connection(-1, log);
    ...
}
@spacewander
Copy link
Member

Nginx also uses -1 to mark fake connection: https://github.com/nginx/nginx/blob/8b927107287094f018cc6f5addc543e79f88ec74/src/core/ngx_connection.c#L1363

Does it change this behavior in the quic branch?

Unfortunately, I don't have enough time to chase it, so CC @doujiang24

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

No branches or pull requests

2 participants