Conversation
|
&ngx_stream_lua_skcoet_tcp_metatable_key skcoet -> socket |
Conflicts: src/ngx_stream_lua_socket_tcp.c src/ngx_stream_lua_socket_udp.h
|
@agentzh, t/099-c-api.t passes on my end but fails on the CI (unable to connect) |
|
@alonbg Seems like 099-c-api.t causes the nginx server process to crash. Better use valgrind to locate the memory issues on your side. |
| { | ||
| lua_pushcfunction(L, ngx_stream_lua_tcp_req_socket); | ||
| lua_setfield(L, -2, "socket"); | ||
| } |
There was a problem hiding this comment.
better keep this function in the same place (before ngx_stream_lua_socket_tcp) that will have a better diff :)
src/ngx_stream_lua_socket_tcp.c
Outdated
| ngx_peer_connection_t *pc; | ||
| ngx_stream_lua_srv_conf_t *lscf; | ||
| ngx_connection_t *c; | ||
| ngx_stream_session_t *s; |
|
|
||
| if (c->type != SOCK_STREAM) { | ||
| return luaL_error(L, "socket api does not match connection transport", | ||
| lua_gettop(L)); |
There was a problem hiding this comment.
better remove lua_gettop here?
|
|
||
| if (c->type != SOCK_DGRAM) { | ||
| return luaL_error(L, "socket api does not match connection transport", | ||
| lua_gettop(L)); |
| ctx->acquired_raw_req_socket = 1; | ||
| #endif | ||
|
|
||
| lua_createtable(L, 3 /* narr */, 1 /* nrec */); /* the object */ |
| c = s->connection; | ||
|
|
||
| ngx_log_debug1(NGX_LOG_DEBUG_STREAM, s->connection->log, 0, | ||
| ngx_log_debug1(NGX_LOG_DEBUG_STREAM, c->log, 0, |
There was a problem hiding this comment.
seems this change not so necessary ?
| --- timeout: 10 | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
style: three blank lines needed, so we should keep this line :)
| u->received = c->buffer->last - c->buffer->pos; | ||
| c->buffer->pos = | ||
| ngx_copy(ngx_stream_lua_socket_udp_buffer, c->buffer->pos, | ||
| u->received); |
There was a problem hiding this comment.
style: I think this will be better:
c->buffer->pos = ngx_copy(ngx_stream_lua_socket_udp_buffer,
c->buffer->pos, u->received);
| mysock handler aborted | ||
| --- no_error_log | ||
| [error] | ||
| --- wait: 1.1 |
|
@alonbg I think we'd better create a new directory like |
|
When would this PR be merged/released? badly needed:( |
616f118 to
cd24241
Compare
Original pull-request was closed as I branched this feature during some repo house keeping.