|
1 | 1 | diff --git src/ngx_stream_lua_socket_tcp.c src/ngx_stream_lua_socket_tcp.c |
2 | | -index 7fcfb45..8fc96cf 100644 |
| 2 | +index 7fcfb45..3178588 100644 |
3 | 3 | --- src/ngx_stream_lua_socket_tcp.c |
4 | 4 | +++ src/ngx_stream_lua_socket_tcp.c |
5 | 5 | @@ -234,6 +234,41 @@ enum { |
@@ -44,7 +44,7 @@ index 7fcfb45..8fc96cf 100644 |
44 | 44 |
|
45 | 45 | static char ngx_stream_lua_raw_req_socket_metatable_key; |
46 | 46 | static char ngx_stream_lua_tcp_socket_metatable_key; |
47 | | -@@ -6005,6 +6040,576 @@ static ngx_int_t ngx_stream_lua_socket_insert_buffer( |
| 47 | +@@ -6005,6 +6040,582 @@ static ngx_int_t ngx_stream_lua_socket_insert_buffer( |
48 | 48 | } |
49 | 49 |
|
50 | 50 |
|
@@ -506,10 +506,16 @@ index 7fcfb45..8fc96cf 100644 |
506 | 506 | + return NGX_DONE; |
507 | 507 | + } |
508 | 508 | + |
509 | | -+ /* TODO: avoid copying (it requires to modify the way cosocket sends data) */ |
510 | | -+ for (in_cl = src->bufs_in; in_cl; in_cl = in_cl->next) { |
511 | | -+ b = in_cl->buf; |
512 | | -+ cl->buf->last = ngx_copy(cl->buf->last, b->pos, b->last - b->pos); |
| 509 | ++ if (!src->bufs_in->next) { |
| 510 | ++ cl->buf->pos = src->bufs_in->buf->pos; |
| 511 | ++ cl->buf->last = src->bufs_in->buf->last; |
| 512 | ++ |
| 513 | ++ } else { |
| 514 | ++ /* TODO: avoid copying (it requires to modify the way cosocket sends data) */ |
| 515 | ++ for (in_cl = src->bufs_in; in_cl; in_cl = in_cl->next) { |
| 516 | ++ b = in_cl->buf; |
| 517 | ++ cl->buf->last = ngx_copy(cl->buf->last, b->pos, b->last - b->pos); |
| 518 | ++ } |
513 | 519 | + } |
514 | 520 | + |
515 | 521 | + ngx_stream_lua_ffi_socket_reset_buf(ctx, src); |
|
0 commit comments