Browse files

added a (passing) test for using \0 in the memcached value.

  • Loading branch information...
1 parent 5ba1225 commit 6081fe57b235feb5b047e734b16172171816c0db @agentzh agentzh committed Jan 31, 2013
Showing with 27 additions and 0 deletions.
  1. +1 −0 t/bugs.t
  2. +25 −0 t/storage.t
  3. +1 −0 util/build.sh
View
1 t/bugs.t
@@ -223,6 +223,7 @@ hello, world
--- SKIP
+
=== TEST 9: get
--- config
location /memc {
View
25 t/storage.t
@@ -713,3 +713,28 @@ NOT_STORED\r
--- response_body
--- SKIP
+
+
+=== TEST 21: set and get (binary data containing \0)
+--- config
+ location /main {
+ echo 'set foo blah';
+ echo_location '/memc?key=foo&cmd=set&val=blah%00blah';
+
+ echo 'get foo';
+ echo_location '/memc?key=foo&cmd=get';
+ }
+ location /memc {
+ set $memc_cmd $arg_cmd;
+ set_unescape_uri $memc_key $arg_key;
+ set_unescape_uri $memc_value $arg_val;
+ memc_pass 127.0.0.1:$TEST_NGINX_MEMCACHED_PORT;
+ }
+--- request
+ GET /main
+--- response_body eval
+"set foo blah
+STORED\r
+get foo
+blah\0blah"
+
View
1 util/build.sh
@@ -31,6 +31,7 @@ ngx-build $force $version \
--add-module=$root/../ndk-nginx-module \
--add-module=$root/../eval-nginx-module \
--add-module=$root/../echo-nginx-module \
+ --add-module=$root/../set-misc-nginx-module \
--add-module=$root/../lua-nginx-module \
--add-module=$home/work/nginx/ngx_http_upstream_keepalive-0.7 \
--with-select_module \

0 comments on commit 6081fe5

Please sign in to comment.