Skip to content

Commit

Permalink
#84 - fixed. And test case added.
Browse files Browse the repository at this point in the history
  • Loading branch information
dedok committed Jun 22, 2017
1 parent 3e06537 commit 2ca3f6e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ngx_http_tnt_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
#ifndef NGX_HTTP_TNT_VERSION_H
#define NGX_HTTP_TNT_VERSION_H 1

#define NGX_HTTP_TNT_MODULE_VERSION_STRING "v2.4.0-beta"
#define NGX_HTTP_TNT_MODULE_VERSION_STRING "v2.4.2-beta"

#endif
8 changes: 6 additions & 2 deletions src/tp_transcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ say_error_(tp_transcode_t *t, int code, const char *e, size_t len)
}

#define say_error(ctx, c, e) \
dd("line:%d, code:%d, msg:%s", __LINE__, c, e); \
dd("line:%d, code:%d, msg:%s\n", __LINE__, c, e); \
say_error_((ctx)->tc, (c), (e), sizeof(e) - 1)

#define say_error_r(ctx, c, e) do { \
Expand Down Expand Up @@ -115,7 +115,11 @@ enum stage {

typedef struct {
char *ptr;
int16_t count;
/**
* The count should be more than uint16_t!
* https://github.com/tarantool/nginx_upstream_module/issues/84
*/
int32_t count;
uint16_t type;
} stack_item_t;

Expand Down
11 changes: 10 additions & 1 deletion test/ngx_confs/tnt_server_test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ http {
include mime.types;
default_type application/octet-stream;

client_body_buffer_size 10K;
client_body_buffer_size 10m;
client_header_buffer_size 1k;
client_max_body_size 64m;
large_client_header_buffers 2 1k;
Expand Down Expand Up @@ -309,5 +309,14 @@ http {
return 200 $tnt_res;
}

location /echo_big {
tnt_pass_http_request_buffer_size 1m;
tnt_method echo_big;
tnt_pass_http_request on parse_args;
tnt_http_rest_methods all;
tnt_http_methods all;
tnt_pass tnt;
}

}
}
4 changes: 4 additions & 0 deletions test/test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ function rest_api_get(a, b)
return echo_2(a, b)
end

function echo_big(...)
return ...
end

function ret_4096()
local out = {}
for i = 0, 801 do
Expand Down
7 changes: 7 additions & 0 deletions test/v24_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@
key = 'a' + str(i)
data[key] = 'b'
#post_form_ec500(preset_method_location, data, None, default_print_f)

data = {'params': [{'array': []}]}
for i in range(100000):
data['params'][0]['array'].append(i)
(code, ret) = post(BASE_URL + '/echo_big', data, None)
assert(code == 200), 'expected 200'
assert(ret[1] == data['params'][0])

0 comments on commit 2ca3f6e

Please sign in to comment.