Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 18 commits
  • 18 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 06, 2014
@agentzh agentzh suppressed a valgrind false positive in libdl. bcd404d
Commits on Jul 04, 2014
@agentzh agentzh removed the luajit suppression rules because we no longer need it. al…
…so removed the hard-coded luajit path in rpath in the developer build script.
e2862e6
@agentzh agentzh doc: updated github links to reflect recent move over to openresty/. 891e14f
@agentzh agentzh bugfix: we did not log error messages for invalid values of $memc_fla…
…gs, $memc_exptime, and $memc_value, leading to hard-to-debug 400 errors. thanks Yann Coleu for the report.
7b60035
@agentzh agentzh added copyright notices to source files. c3d62b7
Commits on Jul 08, 2014
@agentzh agentzh doc: bumped version to 0.15 and updated other parts to reflect recent…
… changes.
1518da4
Commits on Jul 15, 2014
@agentzh agentzh tests: skipped a test for conditional GETs.
There has been a new limitation in nginx 1.7.3+ that prevents nginx
upstream C modules from using ngx_http_not_modified_module. Alas.

See
http://mailman.nginx.org/pipermail/nginx-devel/2014-July/005607.html
for more details.
4ff1453
Commits on Apr 02, 2015
@agentzh agentzh fixed compatibility issues with nginx 1.7.11+ configured with --with-…
…threads.
a684317
Commits on Jun 11, 2015
@agentzh agentzh bugfix: fixed clang warnings on "unused variables" in the Ragel gener…
…ated source.
2445cf8
Commits on Jun 22, 2015
@agentzh agentzh minor changes in README.markdown. a0c04f0
@agentzh agentzh minor coding style fixes. d6efa00
@agentzh agentzh doc: bumped version to 0.16. 4f6f78f
Commits on Jul 04, 2015
@agentzh agentzh removed the --with-rtsig_module option from the developer build script. 49b13f2
Commits on Jul 06, 2015
@agentzh agentzh valgrind.suppress: ignored a false positive in glibc on Amazon Linux …
…i386.
858e1ad
Commits on Oct 28, 2015
@agentzh agentzh README.markdown is now THE document source. 0b424db
Commits on Nov 01, 2015
@agentzh agentzh bugfix: fixed errors and warnings with C compilers without variadic m…
…acro support.
958c067
Commits on Nov 23, 2015
@agentzh agentzh added a .gitattributes file to correct GitHub's language tag. 2c6c1ec
Commits on Jan 25, 2016
@agentzh agentzh doc: various updates. de0b990
View
1 .gitattributes
@@ -0,0 +1 @@
+*.t linguist-language=Text
View
379 README.markdown
@@ -1,8 +1,3 @@
-<!---
-Don't edit this file manually! Instead you should generate it by using:
- wiki2markdown.pl doc/HttpMemcModule.wiki
--->
-
Name
====
@@ -61,112 +56,112 @@ Table of Contents
Version
=======
-This document describes ngx_memc [v0.14](http://github.com/agentzh/memc-nginx-module/tags) released on 14 December 2013.
+This document describes ngx_memc [v0.16](http://github.com/openresty/memc-nginx-module/tags) released on 22 June 2015.
Synopsis
========
```nginx
-# GET /foo?key=dog
-#
-# POST /foo?key=cat
-# Cat's value...
-#
-# PUT /foo?key=bird
-# Bird's value...
-#
-# DELETE /foo?key=Tiger
-location /foo {
- set $memc_key $arg_key;
-
- # $memc_cmd defaults to get for GET,
- # add for POST, set for PUT, and
- # delete for the DELETE request method.
-
- memc_pass 127.0.0.1:11211;
-}
+ # GET /foo?key=dog
+ #
+ # POST /foo?key=cat
+ # Cat's value...
+ #
+ # PUT /foo?key=bird
+ # Bird's value...
+ #
+ # DELETE /foo?key=Tiger
+ location /foo {
+ set $memc_key $arg_key;
+
+ # $memc_cmd defaults to get for GET,
+ # add for POST, set for PUT, and
+ # delete for the DELETE request method.
+
+ memc_pass 127.0.0.1:11211;
+ }
```
```nginx
-# GET /bar?cmd=get&key=cat
-#
-# POST /bar?cmd=set&key=dog
-# My value for the "dog" key...
-#
-# DELETE /bar?cmd=delete&key=dog
-# GET /bar?cmd=delete&key=dog
-location /bar {
- set $memc_cmd $arg_cmd;
- set $memc_key $arg_key;
- set $memc_flags $arg_flags; # defaults to 0
- set $memc_exptime $arg_exptime; # defaults to 0
-
- memc_pass 127.0.0.1:11211;
-}
+ # GET /bar?cmd=get&key=cat
+ #
+ # POST /bar?cmd=set&key=dog
+ # My value for the "dog" key...
+ #
+ # DELETE /bar?cmd=delete&key=dog
+ # GET /bar?cmd=delete&key=dog
+ location /bar {
+ set $memc_cmd $arg_cmd;
+ set $memc_key $arg_key;
+ set $memc_flags $arg_flags; # defaults to 0
+ set $memc_exptime $arg_exptime; # defaults to 0
+
+ memc_pass 127.0.0.1:11211;
+ }
```
```nginx
-# GET /bar?cmd=get&key=cat
-# GET /bar?cmd=set&key=dog&val=animal&flags=1234&exptime=2
-# GET /bar?cmd=delete&key=dog
-# GET /bar?cmd=flush_all
-location /bar {
- set $memc_cmd $arg_cmd;
- set $memc_key $arg_key;
- set $memc_value $arg_val;
- set $memc_flags $arg_flags; # defaults to 0
- set $memc_exptime $arg_exptime; # defaults to 0
-
- memc_cmds_allowed get set add delete flush_all;
-
- memc_pass 127.0.0.1:11211;
-}
+ # GET /bar?cmd=get&key=cat
+ # GET /bar?cmd=set&key=dog&val=animal&flags=1234&exptime=2
+ # GET /bar?cmd=delete&key=dog
+ # GET /bar?cmd=flush_all
+ location /bar {
+ set $memc_cmd $arg_cmd;
+ set $memc_key $arg_key;
+ set $memc_value $arg_val;
+ set $memc_flags $arg_flags; # defaults to 0
+ set $memc_exptime $arg_exptime; # defaults to 0
+
+ memc_cmds_allowed get set add delete flush_all;
+
+ memc_pass 127.0.0.1:11211;
+ }
```
```nginx
- http {
- ...
- upstream backend {
- server 127.0.0.1:11984;
- server 127.0.0.1:11985;
- }
- server {
- location /stats {
- set $memc_cmd stats;
- memc_pass backend;
- }
- ...
- }
- }
- ...
+ http {
+ ...
+ upstream backend {
+ server 127.0.0.1:11984;
+ server 127.0.0.1:11985;
+ }
+ server {
+ location /stats {
+ set $memc_cmd stats;
+ memc_pass backend;
+ }
+ ...
+ }
+ }
+ ...
```
```nginx
-# read the memcached flags into the Last-Modified header
-# to respond 304 to conditional GET
-location /memc {
- set $memc_key $arg_key;
+ # read the memcached flags into the Last-Modified header
+ # to respond 304 to conditional GET
+ location /memc {
+ set $memc_key $arg_key;
- memc_pass 127.0.0.1:11984;
+ memc_pass 127.0.0.1:11984;
- memc_flags_to_last_modified on;
-}
+ memc_flags_to_last_modified on;
+ }
```
```nginx
-location /memc {
- set $memc_key foo;
- set $memc_cmd get;
+ location /memc {
+ set $memc_key foo;
+ set $memc_cmd get;
- # access the unix domain socket listend by memcached
- memc_pass unix:/tmp/memcached.sock;
-}
+ # access the unix domain socket listend by memcached
+ memc_pass unix:/tmp/memcached.sock;
+ }
```
Description
@@ -178,9 +173,9 @@ It allows you to define a custom [REST](http://en.wikipedia.org/wiki/REST) inter
This module is not supposed to be merged into the Nginx core because I've used [Ragel](http://www.complang.org/ragel/) to generate the memcached response parsers (in C) for joy :)
-If you are going to use this module to cache location responses out of the box, try [srcache-nginx-module](http://github.com/agentzh/srcache-nginx-module) with this module to achieve that.
+If you are going to use this module to cache location responses out of the box, try [srcache-nginx-module](http://github.com/openresty/srcache-nginx-module) with this module to achieve that.
-When used in conjunction with [lua-nginx-module](http://github.com/chaoslawful/lua-nginx-module), it is recommended to use the [lua-resty-memcached](http://github.com/agentzh/lua-resty-memcached) library instead of this module though, because the former is much more flexible and memory-efficient.
+When used in conjunction with [lua-nginx-module](http://github.com/openresty/lua-nginx-module), it is recommended to use the [lua-resty-memcached](http://github.com/openresty/lua-resty-memcached) library instead of this module though, because the former is much more flexible and memory-efficient.
[Back to TOC](#table-of-contents)
@@ -193,24 +188,24 @@ Here's a sample configuration:
```nginx
- http {
- upstream backend {
- server 127.0.0.1:11211;
-
- # a pool with at most 1024 connections
- # and do not distinguish the servers:
- keepalive 1024;
- }
-
- server {
- ...
- location /memc {
- set $memc_cmd get;
- set $memc_key $arg_key;
- memc_pass backend;
- }
- }
- }
+ http {
+ upstream backend {
+ server 127.0.0.1:11211;
+
+ # a pool with at most 1024 connections
+ # and do not distinguish the servers:
+ keepalive 1024;
+ }
+
+ server {
+ ...
+ location /memc {
+ set $memc_cmd get;
+ set $memc_key $arg_key;
+ memc_pass backend;
+ }
+ }
+ }
```
[Back to TOC](#table-of-contents)
@@ -243,14 +238,14 @@ Retrieves the value using a key.
```nginx
- location /foo {
- set $memc_cmd 'get';
- set $memc_key 'my_key';
-
- memc_pass 127.0.0.1:11211;
-
- add_header X-Memc-Flags $memc_flags;
- }
+ location /foo {
+ set $memc_cmd 'get';
+ set $memc_key 'my_key';
+
+ memc_pass 127.0.0.1:11211;
+
+ add_header X-Memc-Flags $memc_flags;
+ }
```
Returns `200 OK` with the value put into the response body if the key is found, or `404 Not Found` otherwise. The `flags` number will be set into the `$memc_flags` variable so it's often desired to put that info into the response headers by means of the standard [add_header directive](http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header).
@@ -266,31 +261,31 @@ To use the request body as the memcached value, just avoid setting the `$memc_va
```nginx
- # POST /foo
- # my value...
- location /foo {
- set $memc_cmd 'set';
- set $memc_key 'my_key';
- set $memc_flags 12345;
- set $memc_exptime 24;
-
- memc_pass 127.0.0.1:11211;
- }
+ # POST /foo
+ # my value...
+ location /foo {
+ set $memc_cmd 'set';
+ set $memc_key 'my_key';
+ set $memc_flags 12345;
+ set $memc_exptime 24;
+
+ memc_pass 127.0.0.1:11211;
+ }
```
Or let the `$memc_value` hold the value:
```nginx
- location /foo {
- set $memc_cmd 'set';
- set $memc_key 'my_key';
- set $memc_flags 12345;
- set $memc_exptime 24;
- set $memc_value 'my_value';
+ location /foo {
+ set $memc_cmd 'set';
+ set $memc_key 'my_key';
+ set $memc_flags 12345;
+ set $memc_exptime 24;
+ set $memc_value 'my_value';
- memc_pass 127.0.0.1:11211;
- }
+ memc_pass 127.0.0.1:11211;
+ }
```
Returns `201 Created` if the upstream memcached server replies `STORED`, `200` for `NOT_STORED`, `404` for `NOT_FOUND`, `502` for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`.
@@ -336,12 +331,12 @@ Deletes the memcached entry using a key.
```nginx
- location /foo
- set $memc_cmd delete;
- set $memc_key my_key;
-
- memc_pass 127.0.0.1:11211;
- }
+ location /foo
+ set $memc_cmd delete;
+ set $memc_key my_key;
+
+ memc_pass 127.0.0.1:11211;
+ }
```
Returns `200 OK` if deleted successfully, `404 Not Found` for `NOT_FOUND`, or `502` for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`.
@@ -366,11 +361,11 @@ Increments the existing value of `$memc_key` by the amount specified by `$memc_v
```nginx
- location /foo {
- set $memc_key my_key;
- set $memc_value 2;
- memc_pass 127.0.0.1:11211;
- }
+ location /foo {
+ set $memc_key my_key;
+ set $memc_value 2;
+ memc_pass 127.0.0.1:11211;
+ }
```
In the preceding example, every time we access `/foo` will cause the value of `my_key` increments by `2`.
@@ -395,10 +390,10 @@ Mark all the keys on the memcached server as expired:
```nginx
- location /foo {
- set $memc_cmd flush_all;
- memc_pass 127.0.0.1:11211;
- }
+ location /foo {
+ set $memc_cmd flush_all;
+ memc_pass 127.0.0.1:11211;
+ }
```
[Back to TOC](#table-of-contents)
@@ -417,10 +412,10 @@ Causes the memcached server to output general-purpose statistics and settings
```nginx
- location /foo {
- set $memc_cmd stats;
- memc_pass 127.0.0.1:11211;
- }
+ location /foo {
+ set $memc_cmd stats;
+ memc_pass 127.0.0.1:11211;
+ }
```
Returns `200 OK` if the request succeeds, or 502 for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`.
@@ -436,10 +431,10 @@ Queries the memcached server's version number:
```nginx
- location /foo {
- set $memc_cmd version;
- memc_pass 127.0.0.1:11211;
- }
+ location /foo {
+ set $memc_cmd version;
+ memc_pass 127.0.0.1:11211;
+ }
```
Returns `200 OK` if the request succeeds, or 502 for `ERROR`, `CLIENT_ERROR`, or `SERVER_ERROR`.
@@ -491,15 +486,15 @@ An example is
```nginx
- location /foo {
- set $memc_cmd $arg_cmd;
- set $memc_key $arg_key;
- set $memc_value $arg_val;
-
- memc_pass 127.0.0.1:11211;
-
- memc_cmds_allowed get;
- }
+ location /foo {
+ set $memc_cmd $arg_cmd;
+ set $memc_key $arg_key;
+ set $memc_value $arg_val;
+
+ memc_pass 127.0.0.1:11211;
+
+ memc_cmds_allowed get;
+ }
```
[Back to TOC](#table-of-contents)
@@ -542,7 +537,7 @@ memc_send_timeout
The timeout for sending TCP requests to the memcached server, in seconds by default.
-It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes).
+It is wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes).
This time must be less than 597 hours.
@@ -598,28 +593,28 @@ This directive was first added in the `v0.14` release.
Installation
============
-You're recommended to install this module (as well as the Nginx core and many other goodies) via the [ngx_openresty bundle](http://openresty.org). See the [installation steps](http://openresty.org/#Installation) for `ngx_openresty`.
+You're recommended to install this module (as well as the Nginx core and many other goodies) via the [OpenResty bundle](http://openresty.org). See the [installation steps](http://openresty.org/#Installation) for `OpenResty`.
Alternatively, you can compile this module into the standard Nginx source distribution by hand:
Grab the nginx source code from [nginx.org](http://nginx.org/), for example,
-the version 1.4.4 (see [nginx compatibility](#compatibility)), and then build the source with this module:
+the version 1.9.7 (see [nginx compatibility](#compatibility)), and then build the source with this module:
```bash
-wget 'http://nginx.org/download/nginx-1.4.4.tar.gz'
-tar -xzvf nginx-1.4.4.tar.gz
-cd nginx-1.4.4/
+ wget 'http://nginx.org/download/nginx-1.9.7.tar.gz'
+ tar -xzvf nginx-1.9.7.tar.gz
+ cd nginx-1.9.7/
+
+ # Here we assume you would install you nginx under /opt/nginx/.
+ ./configure --prefix=/opt/nginx \
+ --add-module=/path/to/memc-nginx-module
-# Here we assume you would install you nginx under /opt/nginx/.
-./configure --prefix=/opt/nginx \
- --add-module=/path/to/memc-nginx-module
-
-make -j2
-make install
+ make -j2
+ make install
```
-Download the latest version of the release tarball of this module from [memc-nginx-module file list](http://github.com/agentzh/memc-nginx-module/tags).
+Download the latest version of the release tarball of this module from [memc-nginx-module file list](http://github.com/openresty/memc-nginx-module/tags).
[Back to TOC](#table-of-contents)
@@ -627,11 +622,11 @@ For Developers
--------------
The memached response parsers were generated by [Ragel](http://www.complang.org/ragel/). If you want to
-regenerate the parser's C file, i.e., [src/ngx_http_memc_response.c](http://github.com/agentzh/memc-nginx-module/blob/master/src/ngx_http_memc_response.c), use the following command from the root of the memc module's source tree:
+regenerate the parser's C file, i.e., [src/ngx_http_memc_response.c](http://github.com/openresty/memc-nginx-module/blob/master/src/ngx_http_memc_response.c), use the following command from the root of the memc module's source tree:
```bash
-$ ragel -G2 src/ngx_http_memc_response.rl
+ $ ragel -G2 src/ngx_http_memc_response.rl
```
[Back to TOC](#table-of-contents)
@@ -641,7 +636,11 @@ Compatibility
The following versions of Nginx should work with this module:
-* **1.5.x** (last tested: 1.5.4)
+* **1.9.x** (last tested: 1.9.7)
+* **1.8.x**
+* **1.7.x** (last tested: 1.7.10)
+* **1.6.x**
+* **1.5.x** (last tested: 1.5.12)
* **1.4.x** (last tested: 1.4.4)
* **1.2.x** (last tested: 1.2.9)
* **1.1.x** (last tested: 1.1.5)
@@ -650,7 +649,7 @@ The following versions of Nginx should work with this module:
* **0.8.x** (last tested: 0.8.54)
* **0.7.x >= 0.7.46** (last tested: 0.7.68)
-It's worth mentioning that some 0.7.x versions older than 0.7.46 might also work, but I can't easily test them because the test suite makes extensive use of the [echo module](http://github.com/agentzh/echo-nginx-module)'s [echo_location directive](http://github.com/agentzh/echo-nginx-module#echo_location), which requires at least nginx 0.7.46 :)
+It's worth mentioning that some 0.7.x versions older than 0.7.46 might also work, but I can't easily test them because the test suite makes extensive use of the [echo module](http://github.com/openresty/echo-nginx-module)'s [echo_location directive](http://github.com/openresty/echo-nginx-module#echo_location), which requires at least nginx 0.7.46 :)
Earlier versions of Nginx like 0.6.x and 0.5.x will *not* work.
@@ -682,7 +681,7 @@ Report Bugs
Although a lot of effort has been put into testing and code tuning, there must be some serious bugs lurking somewhere in this module. So whenever you are bitten by any quirks, please don't hesitate to
-1. create a ticket on the [issue tracking interface](http://github.com/agentzh/memc-nginx-module/issues) provided by GitHub,
+1. create a ticket on the [issue tracking interface](http://github.com/openresty/memc-nginx-module/issues) provided by GitHub,
1. or send a bug report or even patches to the [nginx mailing list](http://mailman.nginx.org/mailman/listinfo/nginx).
[Back to TOC](#table-of-contents)
@@ -690,14 +689,14 @@ Although a lot of effort has been put into testing and code tuning, there must b
Source Repository
=================
-Available on github at [agentzh/memc-nginx-module](http://github.com/agentzh/memc-nginx-module).
+Available on github at [openresty/memc-nginx-module](http://github.com/openresty/memc-nginx-module).
[Back to TOC](#table-of-contents)
Changes
=======
-The changes of every release of this module can be obtained from the ngx_openresty bundle's change logs:
+The changes of every release of this module can be obtained from the OpenResty bundle's change logs:
<http://openresty.org/#Changes>
@@ -706,25 +705,25 @@ The changes of every release of this module can be obtained from the ngx_openres
Test Suite
==========
-This module comes with a Perl-driven test suite. The [test cases](http://github.com/agentzh/memc-nginx-module/tree/master/t/) are
-[declarative](http://github.com/agentzh/memc-nginx-module/blob/master/t/storage.t) too. Thanks to the [Test::Base](http://search.cpan.org/perldoc?Test::Base) module in the Perl world.
+This module comes with a Perl-driven test suite. The [test cases](http://github.com/openresty/memc-nginx-module/tree/master/t/) are
+[declarative](http://github.com/openresty/memc-nginx-module/blob/master/t/storage.t) too. Thanks to the [Test::Base](http://search.cpan.org/perldoc?Test::Base) module in the Perl world.
To run it on your side:
```bash
-$ PATH=/path/to/your/nginx-with-memc-module:$PATH prove -r t
+ $ PATH=/path/to/your/nginx-with-memc-module:$PATH prove -r t
```
You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary.
-Either [LWP::UserAgent](http://search.cpan.org/perldoc?LWP::UserAgent) or [IO::Socket](http://search.cpan.org/perldoc?IO::Socket) is used by the [test scaffold](http://github.com/agentzh/memc-nginx-module/blob/master/test/lib/Test/Nginx/LWP.pm).
+Either [LWP::UserAgent](http://search.cpan.org/perldoc?LWP::UserAgent) or [IO::Socket](http://search.cpan.org/perldoc?IO::Socket) is used by the [test scaffold](http://github.com/openresty/memc-nginx-module/blob/master/test/lib/Test/Nginx/LWP.pm).
Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility.
You should also keep a memcached server listening on the `11211` port at localhost before running the test suite.
-Some parts of the test suite requires modules [rewrite](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html) and [echo](http://github.com/agentzh/echo-nginx-module) to be enabled as well when building Nginx.
+Some parts of the test suite requires modules [rewrite](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html) and [echo](http://github.com/openresty/echo-nginx-module) to be enabled as well when building Nginx.
[Back to TOC](#table-of-contents)
@@ -757,7 +756,7 @@ Copyright & License
The code base is borrowed directly from the standard [memcached module](http://nginx.org/en/docs/http/ngx_http_memcached_module.html) in the Nginx core. This part of code is copyrighted by Igor Sysoev and Nginx Inc.
-Copyright (c) 2009-2013, Yichun "agentzh" Zhang (章亦春) <agentzh@gmail.com>, CloudFlare Inc.
+Copyright (c) 2009-2016, Yichun "agentzh" Zhang (章亦春) <agentzh@gmail.com>, CloudFlare Inc.
This module is licensed under the terms of the BSD license.
@@ -788,9 +787,9 @@ See Also
* The original announcement email on the nginx mailing list: [ngx_memc: "an extended version of ngx_memcached that supports set, add, delete, and many more commands"](http://forum.nginx.org/read.php?2,28359)
* My slides demonstrating various ngx_memc usage: <http://agentzh.org/misc/slides/nginx-conf-scripting/nginx-conf-scripting.html#34> (use the arrow or pageup/pagedown keys on the keyboard to swith pages)
* The latest [memcached TCP protocol](http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt).
-* The [ngx_srcache](http://github.com/agentzh/srcache-nginx-module) module
-* The [lua-resty-memcached](https://github.com/agentzh/lua-resty-memcached) library based on the [lua-nginx-module](http://github.com/chaoslawful/lua-nginx-module) cosocket API.
+* The [ngx_srcache](http://github.com/openresty/srcache-nginx-module) module
+* The [lua-resty-memcached](https://github.com/openresty/lua-resty-memcached) library based on the [lua-nginx-module](http://github.com/openresty/lua-nginx-module) cosocket API.
* The standard [memcached](http://nginx.org/en/docs/http/ngx_http_memcached_module.html) module.
-* The [echo module](http://github.com/agentzh/echo-nginx-module) for Nginx module's automated testing.
-* The standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module and the 3rd-parth [headers-more](http://github.com/agentzh/headers-more-nginx-module) module.
+* The [echo module](http://github.com/openresty/echo-nginx-module) for Nginx module's automated testing.
+* The standard [headers](http://nginx.org/en/docs/http/ngx_http_headers_module.html) module and the 3rd-parth [headers-more](http://github.com/openresty/headers-more-nginx-module) module.
View
597 doc/HttpMemcModule.wiki
@@ -1,597 +0,0 @@
-= Name =
-
-'''ngx_memc''' - An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
-
-''This module is not distributed with the Nginx source.'' See [[#Installation|the installation instructions]].
-
-= Version =
-
-This document describes ngx_memc [http://github.com/agentzh/memc-nginx-module/tags v0.14] released on 14 December 2013.
-
-= Synopsis =
-
-<geshi lang="nginx">
- # GET /foo?key=dog
- #
- # POST /foo?key=cat
- # Cat's value...
- #
- # PUT /foo?key=bird
- # Bird's value...
- #
- # DELETE /foo?key=Tiger
- location /foo {
- set $memc_key $arg_key;
-
- # $memc_cmd defaults to get for GET,
- # add for POST, set for PUT, and
- # delete for the DELETE request method.
-
- memc_pass 127.0.0.1:11211;
- }
-</geshi>
-
-<geshi lang="nginx">
- # GET /bar?cmd=get&key=cat
- #
- # POST /bar?cmd=set&key=dog
- # My value for the "dog" key...
- #
- # DELETE /bar?cmd=delete&key=dog
- # GET /bar?cmd=delete&key=dog
- location /bar {
- set $memc_cmd $arg_cmd;
- set $memc_key $arg_key;
- set $memc_flags $arg_flags; # defaults to 0
- set $memc_exptime $arg_exptime; # defaults to 0
-
- memc_pass 127.0.0.1:11211;
- }
-</geshi>
-
-<geshi lang="nginx">
- # GET /bar?cmd=get&key=cat
- # GET /bar?cmd=set&key=dog&val=animal&flags=1234&exptime=2
- # GET /bar?cmd=delete&key=dog
- # GET /bar?cmd=flush_all
- location /bar {
- set $memc_cmd $arg_cmd;
- set $memc_key $arg_key;
- set $memc_value $arg_val;
- set $memc_flags $arg_flags; # defaults to 0
- set $memc_exptime $arg_exptime; # defaults to 0
-
- memc_cmds_allowed get set add delete flush_all;
-
- memc_pass 127.0.0.1:11211;
- }
-</geshi>
-
-<geshi lang="nginx">
- http {
- ...
- upstream backend {
- server 127.0.0.1:11984;
- server 127.0.0.1:11985;
- }
- server {
- location /stats {
- set $memc_cmd stats;
- memc_pass backend;
- }
- ...
- }
- }
- ...
-</geshi>
-
-<geshi lang="nginx">
- # read the memcached flags into the Last-Modified header
- # to respond 304 to conditional GET
- location /memc {
- set $memc_key $arg_key;
-
- memc_pass 127.0.0.1:11984;
-
- memc_flags_to_last_modified on;
- }
-</geshi>
-
-<geshi lang="nginx">
- location /memc {
- set $memc_key foo;
- set $memc_cmd get;
-
- # access the unix domain socket listend by memcached
- memc_pass unix:/tmp/memcached.sock;
- }
-</geshi>
-
-= Description =
-
-This module extends the standard [[HttpMemcachedModule|memcached module]] to support almost the whole [http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt memcached ascii protocol].
-
-It allows you to define a custom [http://en.wikipedia.org/wiki/REST REST] interface to your memcached servers or access memcached in a very efficient way from within the nginx server by means of subrequests or [http://github.com/srlindsay/nginx-independent-subrequest independent fake requests].
-
-This module is not supposed to be merged into the Nginx core because I've used [http://www.complang.org/ragel/ Ragel] to generate the memcached response parsers (in C) for joy :)
-
-If you are going to use this module to cache location responses out of the box, try [[HttpSRCacheModule]] with this module to achieve that.
-
-When used in conjunction with [[HttpLuaModule]], it is recommended to use the [http://github.com/agentzh/lua-resty-memcached lua-resty-memcached] library instead of this module though, because the former is much more flexible and memory-efficient.
-
-== Keep-alive connections to memcached servers ==
-
-You need [[HttpUpstreamKeepaliveModule]] together with this module for keep-alive TCP connections to your backend memcached servers.
-
-Here's a sample configuration:
-
-<geshi lang="nginx">
- http {
- upstream backend {
- server 127.0.0.1:11211;
-
- # a pool with at most 1024 connections
- # and do not distinguish the servers:
- keepalive 1024;
- }
-
- server {
- ...
- location /memc {
- set $memc_cmd get;
- set $memc_key $arg_key;
- memc_pass backend;
- }
- }
- }
-</geshi>
-
-== How it works ==
-
-It implements the memcached TCP protocol all by itself, based upon the <code>upstream</code> mechanism. Everything involving I/O is non-blocking.
-
-The module itself does not keep TCP connections to the upstream memcached servers across requests, just like other upstream modules. For a working solution, see section [[#Keep-alive connections to memcached servers|Keep-alive connections to memcached servers]].
-
-= Memcached commands supported =
-
-The memcached storage commands [[#set $memc_key $memc_flags $memc_exptime $memc_value|set]], [[#add $memc_key $memc_flags $memc_exptime $memc_value|add]], [[#replace $memc_key $memc_flags $memc_exptime $memc_value|replace]], [[#prepend $memc_key $memc_flags $memc_exptime $memc_value|prepend]], and [[#append $memc_key $memc_flags $memc_exptime $memc_value|append]] uses the <code>$memc_key</code> as the key, <code>$memc_exptime</code> as the expiration time (or delay) (defaults to 0), <code>$memc_flags</code> as the flags (defaults to 0), to build the corresponding memcached queries.
-
-If <code>$memc_value</code> is not defined at all, then the request body will be used as the value of the <code>$memc_value</code> except for the [[#incr $memc_key $memc_value|incr]] and [[#decr $memc_key $memc_value|decr]] commands. Note that if <code>$memc_value</code> is defined as an empty string (<code>""</code>), that empty string will still be used as the value as is.
-
-The following memcached commands have been implemented and tested (with their parameters marked by corresponding
-nginx variables defined by this module):
-
-== get $memc_key ==
-
-Retrieves the value using a key.
-
-<geshi lang="nginx">
- location /foo {
- set $memc_cmd 'get';
- set $memc_key 'my_key';
-
- memc_pass 127.0.0.1:11211;
-
- add_header X-Memc-Flags $memc_flags;
- }
-</geshi>
-
-Returns <code>200 OK</code> with the value put into the response body if the key is found, or <code>404 Not Found</code> otherwise. The <code>flags</code> number will be set into the <code>$memc_flags</code> variable so it's often desired to put that info into the response headers by means of the standard [[HttpHeadersModule#add_header|add_header directive]].
-
-It returns <code>502</code> for <code>ERROR</code>, <code>CLIENT_ERROR</code>, or <code>SERVER_ERROR</code>.
-
-== set $memc_key $memc_flags $memc_exptime $memc_value ==
-
-To use the request body as the memcached value, just avoid setting the <code>$memc_value</code> variable:
-
-<geshi lang="nginx">
- # POST /foo
- # my value...
- location /foo {
- set $memc_cmd 'set';
- set $memc_key 'my_key';
- set $memc_flags 12345;
- set $memc_exptime 24;
-
- memc_pass 127.0.0.1:11211;
- }
-</geshi>
-
-Or let the <code>$memc_value</code> hold the value:
-
-<geshi lang="nginx">
- location /foo {
- set $memc_cmd 'set';
- set $memc_key 'my_key';
- set $memc_flags 12345;
- set $memc_exptime 24;
- set $memc_value 'my_value';
-
- memc_pass 127.0.0.1:11211;
- }
-</geshi>
-
-Returns <code>201 Created</code> if the upstream memcached server replies <code>STORED</code>, <code>200</code> for <code>NOT_STORED</code>, <code>404</code> for <code>NOT_FOUND</code>, <code>502</code> for <code>ERROR</code>, <code>CLIENT_ERROR</code>, or <code>SERVER_ERROR</code>.
-
-The original memcached responses are returned as the response body except for <code>404 NOT FOUND</code>.
-
-== add $memc_key $memc_flags $memc_exptime $memc_value ==
-
-Similar to the [[#set $memc_key $memc_flags $memc_exptime $memc_value|set command]].
-
-== replace $memc_key $memc_flags $memc_exptime $memc_value ==
-
-Similar to the [[#set $memc_key $memc_flags $memc_exptime $memc_value|set command]].
-
-== append $memc_key $memc_flags $memc_exptime $memc_value ==
-
-Similar to the [[#set $memc_key $memc_flags $memc_exptime $memc_value|set command]].
-
-Note that at least memcached version 1.2.2 does not support the "append" and "prepend" commands. At least 1.2.4 and later versions seem to supports these two commands.
-
-== prepend $memc_key $memc_flags $memc_exptime $memc_value ==
-
-Similar to the [[#append $memc_key $memc_flags $memc_exptime $memc_value|append command]].
-
-== delete $memc_key ==
-
-Deletes the memcached entry using a key.
-
-<geshi lang="nginx">
- location /foo
- set $memc_cmd delete;
- set $memc_key my_key;
-
- memc_pass 127.0.0.1:11211;
- }
-</geshi>
-
-Returns <code>200 OK</code> if deleted successfully, <code>404 Not Found</code> for <code>NOT_FOUND</code>, or <code>502</code> for <code>ERROR</code>, <code>CLIENT_ERROR</code>, or <code>SERVER_ERROR</code>.
-
-The original memcached responses are returned as the response body except for <code>404 NOT FOUND</code>.
-
-== delete $memc_key $memc_exptime ==
-
-Similar to the [[#delete $memc_key|delete $memc_key]] command except it accepts an optional <code>expiration</code> time specified by the <code>$memc_exptime</code> variable.
-
-This command is no longer available in the latest memcached version 1.4.4.
-
-== incr $memc_key $memc_value ==
-
-Increments the existing value of <code>$memc_key</code> by the amount specified by <code>$memc_value</code>:
-
-<geshi lang="nginx">
- location /foo {
- set $memc_key my_key;
- set $memc_value 2;
- memc_pass 127.0.0.1:11211;
- }
-</geshi>
-
-In the preceding example, every time we access <code>/foo</code> will cause the value of <code>my_key</code> increments by <code>2</code>.
-
-Returns <code>200 OK</code> with the new value associated with that key as the response body if successful, or <code>404 Not Found</code> if the key is not found.
-
-It returns <code>502</code> for <code>ERROR</code>, <code>CLIENT_ERROR</code>, or <code>SERVER_ERROR</code>.
-
-== decr $memc_key $memc_value ==
-
-Similar to [[#incr $memc_key $memc_value|incr $memc_key $memc_value]].
-
-== flush_all ==
-
-Mark all the keys on the memcached server as expired:
-
-<geshi lang="nginx">
- location /foo {
- set $memc_cmd flush_all;
- memc_pass 127.0.0.1:11211;
- }
-</geshi>
-
-== flush_all $memc_exptime ==
-
-Just like [[#flush_all|flush_all]] but also accepts an expiration time specified by the <code>$memc_exptime</code> variable.
-
-== stats ==
-
-Causes the memcached server to output general-purpose statistics and settings
-
-<geshi lang="nginx">
- location /foo {
- set $memc_cmd stats;
- memc_pass 127.0.0.1:11211;
- }
-</geshi>
-
-Returns <code>200 OK</code> if the request succeeds, or 502 for <code>ERROR</code>, <code>CLIENT_ERROR</code>, or <code>SERVER_ERROR</code>.
-
-The raw <code>stats</code> command output from the upstream memcached server will be put into the response body.
-
-== version ==
-
-Queries the memcached server's version number:
-
-<geshi lang="nginx">
- location /foo {
- set $memc_cmd version;
- memc_pass 127.0.0.1:11211;
- }
-</geshi>
-
-Returns <code>200 OK</code> if the request succeeds, or 502 for <code>ERROR</code>, <code>CLIENT_ERROR</code>, or <code>SERVER_ERROR</code>.
-
-The raw <code>version</code> command output from the upstream memcached server will be put into the response body.
-
-= Directives =
-
-All the standard [[HttpMemcachedModule|memcached module]] directives in nginx 0.8.28 are directly inherited, with the <code>memcached_</code> prefixes replaced by <code>memc_</code>. For example, the <code>memcached_pass</code> directive is spelled <code>memc_pass</code>.
-
-Here we only document the most important two directives (the latter is a new directive introduced by this module).
-
-== memc_pass ==
-
-'''syntax:''' ''memc_pass <memcached server IP address>:<memcached server port>''
-
-'''syntax:''' ''memc_pass <memcached server hostname>:<memcached server port>''
-
-'''syntax:''' ''memc_pass <upstream_backend_name>''
-
-'''syntax:''' ''memc_pass unix:<path_to_unix_domain_socket>''
-
-'''default:''' ''none''
-
-'''context:''' ''http, server, location, if''
-
-'''phase:''' ''content''
-
-Specify the memcached server backend.
-
-== memc_cmds_allowed ==
-'''syntax:''' ''memc_cmds_allowed <cmd>...''
-
-'''default:''' ''none''
-
-'''context:''' ''http, server, location, if''
-
-Lists memcached commands that are allowed to access. By default, all the memcached commands supported by this module are accessible.
-An example is
-
-<geshi lang="nginx">
- location /foo {
- set $memc_cmd $arg_cmd;
- set $memc_key $arg_key;
- set $memc_value $arg_val;
-
- memc_pass 127.0.0.1:11211;
-
- memc_cmds_allowed get;
- }
-</geshi>
-
-== memc_flags_to_last_modified ==
-'''syntax:''' ''memc_flags_to_last_modified on|off''
-
-'''default:''' ''off''
-
-'''context:''' ''http, server, location, if''
-
-Read the memcached flags as epoch seconds and set it as the value of the <code>Last-Modified</code> header. For conditional GET, it will signal nginx to return <code>304 Not Modified</code> response to save bandwidth.
-
-== memc_connect_timeout ==
-'''syntax:''' ''memc_connect_timeout <time>''
-
-'''default:''' ''60s''
-
-'''context:''' ''http, server, location''
-
-The timeout for connecting to the memcached server, in seconds by default.
-
-It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes).
-
-This time must be less than 597 hours.
-
-== memc_send_timeout ==
-'''syntax:''' ''memc_send_timeout <time>''
-
-'''default:''' ''60s''
-
-'''context:''' ''http, server, location''
-
-The timeout for sending TCP requests to the memcached server, in seconds by default.
-
-It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes).
-
-This time must be less than 597 hours.
-
-== memc_read_timeout ==
-'''syntax:''' ''memc_read_timeout <time>''
-
-'''default:''' ''60s''
-
-'''context:''' ''http, server, location''
-
-The timeout for reading TCP responses from the memcached server, in seconds by default.
-
-It's wise to always explicitly specify the time unit to avoid confusion. Time units supported are "s"(seconds), "ms"(milliseconds), "y"(years), "M"(months), "w"(weeks), "d"(days), "h"(hours), and "m"(minutes).
-
-This time must be less than 597 hours.
-
-== memc_buffer_size ==
-'''syntax:''' ''memc_buffer_size <size>''
-
-'''default:''' ''4k/8k''
-
-'''context:''' ''http, server, location''
-
-This buffer size is used for the memory buffer to hold
-
-* the complete response for memcached commands other than <code>get</code>,
-* the complete response header (i.e., the first line of the response) for the <code>get</code> memcached command.
-
-This default size is the page size, may be <code>4k</code> or <code>8k</code>.
-
-== memc_ignore_client_abort ==
-'''syntax:''' ''memc_ignore_client_abort on|off''
-
-'''default:''' ''off''
-
-'''context:''' ''location''
-
-Determines whether the connection with a memcache server should be closed when a client closes a connection without waiting for a response.
-
-This directive was first added in the <code>v0.14</code> release.
-
-= Installation =
-
-You're recommended to install this module (as well as the Nginx core and many other goodies) via the [http://openresty.org ngx_openresty bundle]. See the [http://openresty.org/#Installation installation steps] for <code>ngx_openresty</code>.
-
-Alternatively, you can compile this module into the standard Nginx source distribution by hand:
-
-Grab the nginx source code from [http://nginx.org/ nginx.org], for example,
-the version 1.4.4 (see [[#Compatibility|nginx compatibility]]), and then build the source with this module:
-
-<geshi lang="bash">
- wget 'http://nginx.org/download/nginx-1.4.4.tar.gz'
- tar -xzvf nginx-1.4.4.tar.gz
- cd nginx-1.4.4/
-
- # Here we assume you would install you nginx under /opt/nginx/.
- ./configure --prefix=/opt/nginx \
- --add-module=/path/to/memc-nginx-module
-
- make -j2
- make install
-</geshi>
-
-Download the latest version of the release tarball of this module from [http://github.com/agentzh/memc-nginx-module/tags memc-nginx-module file list].
-
-== For Developers ==
-
-The memached response parsers were generated by [http://www.complang.org/ragel/ Ragel]. If you want to
-regenerate the parser's C file, i.e., [http://github.com/agentzh/memc-nginx-module/blob/master/src/ngx_http_memc_response.c src/ngx_http_memc_response.c], use the following command from the root of the memc module's source tree:
-
-<geshi lang="bash">
- $ ragel -G2 src/ngx_http_memc_response.rl
-</geshi>
-
-= Compatibility =
-
-The following versions of Nginx should work with this module:
-
-* '''1.5.x''' (last tested: 1.5.4)
-* '''1.4.x''' (last tested: 1.4.4)
-* '''1.2.x''' (last tested: 1.2.9)
-* '''1.1.x''' (last tested: 1.1.5)
-* '''1.0.x''' (last tested: 1.0.10)
-* '''0.9.x''' (last tested: 0.9.4)
-* '''0.8.x''' (last tested: 0.8.54)
-* '''0.7.x >= 0.7.46''' (last tested: 0.7.68)
-
-It's worth mentioning that some 0.7.x versions older than 0.7.46 might also work, but I can't easily test them because the test suite makes extensive use of the [[HttpEchoModule|echo module]]'s [[HttpEchoModule#echo_location|echo_location directive]], which requires at least nginx 0.7.46 :)
-
-Earlier versions of Nginx like 0.6.x and 0.5.x will ''not'' work.
-
-If you find that any particular version of Nginx above 0.7.46 does not work with this module, please consider [[#Report Bugs|reporting a bug]].
-
-= Community =
-
-== English Mailing List ==
-
-The [https://groups.google.com/group/openresty-en openresty-en] mailing list is for English speakers.
-
-== Chinese Mailing List ==
-
-The [https://groups.google.com/group/openresty openresty] mailing list is for Chinese speakers.
-
-= Report Bugs =
-
-Although a lot of effort has been put into testing and code tuning, there must be some serious bugs lurking somewhere in this module. So whenever you are bitten by any quirks, please don't hesitate to
-
-# create a ticket on the [http://github.com/agentzh/memc-nginx-module/issues issue tracking interface] provided by GitHub,
-# or send a bug report or even patches to the [http://mailman.nginx.org/mailman/listinfo/nginx nginx mailing list].
-
-= Source Repository =
-
-Available on github at [http://github.com/agentzh/memc-nginx-module agentzh/memc-nginx-module].
-
-= Changes =
-
-The changes of every release of this module can be obtained from the ngx_openresty bundle's change logs:
-
-http://openresty.org/#Changes
-
-= Test Suite =
-
-This module comes with a Perl-driven test suite. The [http://github.com/agentzh/memc-nginx-module/tree/master/t/ test cases] are
-[http://github.com/agentzh/memc-nginx-module/blob/master/t/storage.t declarative] too. Thanks to the [http://search.cpan.org/perldoc?Test::Base Test::Base] module in the Perl world.
-
-To run it on your side:
-
-<geshi lang="bash">
- $ PATH=/path/to/your/nginx-with-memc-module:$PATH prove -r t
-</geshi>
-
-You need to terminate any Nginx processes before running the test suite if you have changed the Nginx server binary.
-
-Either [http://search.cpan.org/perldoc?LWP::UserAgent LWP::UserAgent] or [http://search.cpan.org/perldoc?IO::Socket IO::Socket] is used by the [http://github.com/agentzh/memc-nginx-module/blob/master/test/lib/Test/Nginx/LWP.pm test scaffold].
-
-Because a single nginx server (by default, <code>localhost:1984</code>) is used across all the test scripts (<code>.t</code> files), it's meaningless to run the test suite in parallel by specifying <code>-jN</code> when invoking the <code>prove</code> utility.
-
-You should also keep a memcached server listening on the <code>11211</code> port at localhost before running the test suite.
-
-Some parts of the test suite requires modules [[HttpRewriteModule|rewrite]] and [[HttpEchoModule|echo]] to be enabled as well when building Nginx.
-
-= TODO =
-
-* add support for the memcached commands <code>cas</code>, <code>gets</code> and <code>stats $memc_value</code>.
-* add support for the <code>noreply</code> option.
-
-= Getting involved =
-
-You'll be very welcomed to submit patches to the [[#Author|author]] or just ask for a commit bit to the [[#Source Repository|source repository]] on GitHub.
-
-= Author =
-
-Yichun "agentzh" Zhang (章亦春) ''<agentzh@gmail.com>'', CloudFlare Inc.
-
-This wiki page is also maintained by the author himself, and everybody is encouraged to improve this page as well.
-
-= Copyright & License =
-
-The code base is borrowed directly from the standard [[HttpMemcachedModule|memcached module]] in the Nginx core. This part of code is copyrighted by Igor Sysoev and Nginx Inc.
-
-Copyright (c) 2009-2013, Yichun "agentzh" Zhang (章亦春) <agentzh@gmail.com>, CloudFlare Inc.
-
-This module is licensed under the terms of the BSD license.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-= See Also =
-
-* The original announcement email on the nginx mailing list: [http://forum.nginx.org/read.php?2,28359 ngx_memc: "an extended version of ngx_memcached that supports set, add, delete, and many more commands"]
-* My slides demonstrating various ngx_memc usage: http://agentzh.org/misc/slides/nginx-conf-scripting/nginx-conf-scripting.html#34 (use the arrow or pageup/pagedown keys on the keyboard to swith pages)
-* The latest [http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt memcached TCP protocol].
-* The [http://github.com/agentzh/srcache-nginx-module ngx_srcache] module
-* The [https://github.com/agentzh/lua-resty-memcached lua-resty-memcached] library based on the [[HttpLuaModule]] cosocket API.
-* The standard [[HttpMemcachedModule|memcached]] module.
-* The [[HttpEchoModule|echo module]] for Nginx module's automated testing.
-* The standard [[HttpHeadersModule|headers]] module and the 3rd-parth [[HttpHeadersMoreModule|headers-more]] module.
-
View
10 src/ddebug.h
@@ -1,8 +1,11 @@
#ifndef DDEBUG_H
#define DDEBUG_H
+
+#include <ngx_config.h>
#include <ngx_core.h>
+
#if defined(DDEBUG) && (DDEBUG)
# if (NGX_HAVE_VARIADIC_MACROS)
@@ -18,7 +21,8 @@
#include <stdarg.h>
-static void dd(const char* fmt, ...) {
+static ngx_inline void
+dd(const char* fmt, ...) {
}
# endif
@@ -33,7 +37,8 @@ static void dd(const char* fmt, ...) {
#include <stdarg.h>
-static void dd(const char* fmt, ...) {
+static ngx_inline void
+dd(const char* fmt, ...) {
}
# endif
@@ -68,4 +73,3 @@ static void dd(const char* fmt, ...) {
#endif
#endif /* DDEBUG_H */
-
View
18 src/ngx_http_memc_handler.c
@@ -1,3 +1,9 @@
+
+/*
+ * Copyright (C) Yichun Zhang (agentzh)
+ */
+
+
#ifndef DDEBUG
#define DDEBUG 0
#endif
@@ -306,6 +312,10 @@ ngx_http_memc_handler(ngx_http_request_t *r)
&& !ngx_http_memc_valid_uint32_str(exptime_vv->data,
exptime_vv->len))
{
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "variable \"$memc_exptime\" takes invalid value: %v",
+ exptime_vv);
+
return NGX_HTTP_BAD_REQUEST;
}
}
@@ -323,6 +333,10 @@ ngx_http_memc_handler(ngx_http_request_t *r)
&& flags_vv->len
&& !ngx_http_memc_valid_uint32_str(flags_vv->data, flags_vv->len))
{
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "variable \"$memc_flags\" takes invalid value: %v",
+ flags_vv);
+
return NGX_HTTP_BAD_REQUEST;
}
}
@@ -350,6 +364,10 @@ ngx_http_memc_handler(ngx_http_request_t *r)
if (!ngx_http_memc_valid_uint64_str(value_vv->data,
value_vv->len))
{
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "variable \"$memc_value\" is invalid for "
+ "incr/decr: %v", value_vv);
+
return NGX_HTTP_BAD_REQUEST;
}
}
View
6 src/ngx_http_memc_module.h
@@ -1,3 +1,9 @@
+
+/*
+ * Copyright (C) Yichun Zhang (agentzh)
+ */
+
+
#ifndef NGX_HTTP_MEMC_MODULE_H
#define NGX_HTTP_MEMC_MODULE_H
View
6 src/ngx_http_memc_request.h
@@ -1,3 +1,9 @@
+
+/*
+ * Copyright (C) Yichun Zhang (agentzh)
+ */
+
+
#ifndef NGX_HTTP_MEMC_REQUEST_H
#define NGX_HTTP_MEMC_REQUEST_H
View
236 src/ngx_http_memc_response.c
@@ -1,5 +1,11 @@
#line 1 "src/ngx_http_memc_response.rl"
+
+/*
+ * Copyright (C) Yichun Zhang (agentzh)
+ */
+
+
#ifndef DDEBUG
#define DDEBUG 0
#endif
@@ -17,98 +23,92 @@
-#line 18 "src/ngx_http_memc_response.rl"
+#line 24 "src/ngx_http_memc_response.rl"
-#line 23 "src/ngx_http_memc_response.c"
+#line 29 "src/ngx_http_memc_response.c"
static const int memc_storage_start = 1;
static const int memc_storage_first_final = 54;
static const int memc_storage_error = 0;
-static const int memc_storage_en_main = 1;
-#line 19 "src/ngx_http_memc_response.rl"
+#line 25 "src/ngx_http_memc_response.rl"
-#line 21 "src/ngx_http_memc_response.rl"
+#line 27 "src/ngx_http_memc_response.rl"
-#line 36 "src/ngx_http_memc_response.c"
+#line 42 "src/ngx_http_memc_response.c"
static const int memc_flush_all_start = 1;
static const int memc_flush_all_first_final = 30;
static const int memc_flush_all_error = 0;
-static const int memc_flush_all_en_main = 1;
-#line 22 "src/ngx_http_memc_response.rl"
+#line 28 "src/ngx_http_memc_response.rl"
-#line 24 "src/ngx_http_memc_response.rl"
+#line 30 "src/ngx_http_memc_response.rl"
-#line 49 "src/ngx_http_memc_response.c"
+#line 55 "src/ngx_http_memc_response.c"
static const int memc_version_start = 1;
static const int memc_version_first_final = 39;
static const int memc_version_error = 0;
-static const int memc_version_en_main = 1;
-#line 25 "src/ngx_http_memc_response.rl"
+#line 31 "src/ngx_http_memc_response.rl"
-#line 27 "src/ngx_http_memc_response.rl"
+#line 33 "src/ngx_http_memc_response.rl"
-#line 62 "src/ngx_http_memc_response.c"
+#line 68 "src/ngx_http_memc_response.c"
static const int memc_stats_start = 1;
static const int memc_stats_first_final = 43;
static const int memc_stats_error = 0;
-static const int memc_stats_en_main = 1;
-#line 28 "src/ngx_http_memc_response.rl"
+#line 34 "src/ngx_http_memc_response.rl"
-#line 30 "src/ngx_http_memc_response.rl"
+#line 36 "src/ngx_http_memc_response.rl"
-#line 75 "src/ngx_http_memc_response.c"
+#line 81 "src/ngx_http_memc_response.c"
static const int memc_delete_start = 1;
static const int memc_delete_first_final = 45;
static const int memc_delete_error = 0;
-static const int memc_delete_en_main = 1;
-#line 31 "src/ngx_http_memc_response.rl"
+#line 37 "src/ngx_http_memc_response.rl"
-#line 33 "src/ngx_http_memc_response.rl"
+#line 39 "src/ngx_http_memc_response.rl"
-#line 88 "src/ngx_http_memc_response.c"
+#line 94 "src/ngx_http_memc_response.c"
static const int memc_incr_decr_start = 1;
static const int memc_incr_decr_first_final = 40;
static const int memc_incr_decr_error = 0;
-static const int memc_incr_decr_en_main = 1;
-#line 34 "src/ngx_http_memc_response.rl"
+#line 40 "src/ngx_http_memc_response.rl"
u_char ngx_http_memc_end[] = CRLF "END" CRLF;
-static u_char * parse_memc_storage(int *cs_addr, u_char *p, u_char *pe,
+static u_char *parse_memc_storage(int *cs_addr, u_char *p, u_char *pe,
ngx_uint_t *status_addr, unsigned *done_addr);
-static u_char * parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe,
+static u_char *parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe,
ngx_uint_t *status_addr, unsigned *done_addr);
-static u_char * parse_memc_version(int *cs_addr, u_char *p, u_char *pe,
+static u_char *parse_memc_version(int *cs_addr, u_char *p, u_char *pe,
ngx_uint_t *status_addr, unsigned *done_addr);
-static u_char * parse_memc_stats(int *cs_addr, u_char *p, u_char *pe,
+static u_char *parse_memc_stats(int *cs_addr, u_char *p, u_char *pe,
ngx_uint_t *status_addr, unsigned *done_addr);
-static u_char * parse_memc_delete(int *cs_addr, u_char *p, u_char *pe,
+static u_char *parse_memc_delete(int *cs_addr, u_char *p, u_char *pe,
ngx_uint_t *status_addr, unsigned *done_addr);
-static u_char * parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe,
+static u_char *parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe,
ngx_uint_t *status_addr, unsigned *done_addr);
static ngx_int_t ngx_http_memc_write_simple_response(ngx_http_request_t *r,
ngx_http_upstream_t *u, ngx_http_memc_ctx_t *ctx,
@@ -144,66 +144,66 @@ ngx_http_memc_process_simple_header(ngx_http_request_t *r)
dd("init memc_storage machine...");
-#line 85 "src/ngx_http_memc_response.rl"
+#line 91 "src/ngx_http_memc_response.rl"
-#line 150 "src/ngx_http_memc_response.c"
+#line 156 "src/ngx_http_memc_response.c"
{
cs = memc_storage_start;
}
-#line 86 "src/ngx_http_memc_response.rl"
+#line 92 "src/ngx_http_memc_response.rl"
} else if (ctx->cmd == ngx_http_memc_cmd_flush_all) {
dd("init memc_flush_all machine...");
-#line 91 "src/ngx_http_memc_response.rl"
+#line 97 "src/ngx_http_memc_response.rl"
-#line 163 "src/ngx_http_memc_response.c"
+#line 169 "src/ngx_http_memc_response.c"
{
cs = memc_flush_all_start;
}
-#line 92 "src/ngx_http_memc_response.rl"
+#line 98 "src/ngx_http_memc_response.rl"
} else if (ctx->cmd == ngx_http_memc_cmd_version) {
dd("init memc_version machine...");
-#line 97 "src/ngx_http_memc_response.rl"
+#line 103 "src/ngx_http_memc_response.rl"
-#line 176 "src/ngx_http_memc_response.c"
+#line 182 "src/ngx_http_memc_response.c"
{
cs = memc_version_start;
}
-#line 98 "src/ngx_http_memc_response.rl"
+#line 104 "src/ngx_http_memc_response.rl"
} else if (ctx->cmd == ngx_http_memc_cmd_stats) {
dd("init memc_stats machine...");
-#line 103 "src/ngx_http_memc_response.rl"
+#line 109 "src/ngx_http_memc_response.rl"
-#line 189 "src/ngx_http_memc_response.c"
+#line 195 "src/ngx_http_memc_response.c"
{
cs = memc_stats_start;
}
-#line 104 "src/ngx_http_memc_response.rl"
+#line 110 "src/ngx_http_memc_response.rl"
} else if (ctx->cmd == ngx_http_memc_cmd_delete) {
dd("init memc_delete machine...");
-#line 109 "src/ngx_http_memc_response.rl"
+#line 115 "src/ngx_http_memc_response.rl"
-#line 202 "src/ngx_http_memc_response.c"
+#line 208 "src/ngx_http_memc_response.c"
{
cs = memc_delete_start;
}
-#line 110 "src/ngx_http_memc_response.rl"
+#line 116 "src/ngx_http_memc_response.rl"
} else if (ctx->cmd == ngx_http_memc_cmd_incr
|| ctx->cmd == ngx_http_memc_cmd_decr)
@@ -211,14 +211,14 @@ ngx_http_memc_process_simple_header(ngx_http_request_t *r)
dd("init memc_incr_decr machine...");
-#line 117 "src/ngx_http_memc_response.rl"
+#line 123 "src/ngx_http_memc_response.rl"
-#line 217 "src/ngx_http_memc_response.c"
+#line 223 "src/ngx_http_memc_response.c"
{
cs = memc_incr_decr_start;
}
-#line 118 "src/ngx_http_memc_response.rl"
+#line 124 "src/ngx_http_memc_response.rl"
} else {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
@@ -672,11 +672,11 @@ parse_memc_storage(int *cs_addr, u_char *p, u_char *pe,
int cs = *cs_addr;
-#line 571 "src/ngx_http_memc_response.rl"
+#line 577 "src/ngx_http_memc_response.rl"
-#line 572 "src/ngx_http_memc_response.rl"
+#line 578 "src/ngx_http_memc_response.rl"
-#line 680 "src/ngx_http_memc_response.c"
+#line 686 "src/ngx_http_memc_response.c"
{
if ( p == pe )
goto _test_eof;
@@ -844,7 +844,7 @@ case 15:
if ( ++p == pe )
goto _test_eof54;
case 54:
-#line 848 "src/ngx_http_memc_response.c"
+#line 854 "src/ngx_http_memc_response.c"
goto st0;
st16:
if ( ++p == pe )
@@ -1177,7 +1177,7 @@ case 53:
_out: {}
}
-#line 573 "src/ngx_http_memc_response.rl"
+#line 579 "src/ngx_http_memc_response.rl"
*cs_addr = cs;
@@ -1192,11 +1192,11 @@ parse_memc_flush_all(int *cs_addr, u_char *p, u_char *pe,
int cs = *cs_addr;
-#line 587 "src/ngx_http_memc_response.rl"
+#line 593 "src/ngx_http_memc_response.rl"
-#line 588 "src/ngx_http_memc_response.rl"
+#line 594 "src/ngx_http_memc_response.rl"
-#line 1200 "src/ngx_http_memc_response.c"
+#line 1206 "src/ngx_http_memc_response.c"
{
if ( p == pe )
goto _test_eof;
@@ -1338,7 +1338,7 @@ case 15:
if ( ++p == pe )
goto _test_eof30;
case 30:
-#line 1342 "src/ngx_http_memc_response.c"
+#line 1348 "src/ngx_http_memc_response.c"
goto st0;
st16:
if ( ++p == pe )
@@ -1473,7 +1473,7 @@ case 29:
_out: {}
}
-#line 589 "src/ngx_http_memc_response.rl"
+#line 595 "src/ngx_http_memc_response.rl"
*cs_addr = cs;
@@ -1488,11 +1488,11 @@ parse_memc_version(int *cs_addr, u_char *p, u_char *pe,
int cs = *cs_addr;
-#line 603 "src/ngx_http_memc_response.rl"
+#line 609 "src/ngx_http_memc_response.rl"
-#line 604 "src/ngx_http_memc_response.rl"
+#line 610 "src/ngx_http_memc_response.rl"
-#line 1496 "src/ngx_http_memc_response.c"
+#line 1502 "src/ngx_http_memc_response.c"
{
if ( p == pe )
goto _test_eof;
@@ -1627,7 +1627,7 @@ case 15:
if ( ++p == pe )
goto _test_eof39;
case 39:
-#line 1631 "src/ngx_http_memc_response.c"
+#line 1637 "src/ngx_http_memc_response.c"
goto st0;
st16:
if ( ++p == pe )
@@ -1789,7 +1789,7 @@ case 36:
if ( ++p == pe )
goto _test_eof40;
case 40:
-#line 1793 "src/ngx_http_memc_response.c"
+#line 1799 "src/ngx_http_memc_response.c"
if ( (*p) == 13 )
goto st36;
goto st35;
@@ -1852,7 +1852,7 @@ case 38:
_out: {}
}
-#line 605 "src/ngx_http_memc_response.rl"
+#line 611 "src/ngx_http_memc_response.rl"
*cs_addr = cs;
@@ -1867,11 +1867,11 @@ parse_memc_stats(int *cs_addr, u_char *p, u_char *pe, ngx_uint_t *status_addr,
int cs = *cs_addr;
-#line 619 "src/ngx_http_memc_response.rl"
+#line 625 "src/ngx_http_memc_response.rl"
-#line 620 "src/ngx_http_memc_response.rl"
+#line 626 "src/ngx_http_memc_response.rl"
-#line 1875 "src/ngx_http_memc_response.c"
+#line 1881 "src/ngx_http_memc_response.c"
{
if ( p == pe )
goto _test_eof;
@@ -2012,7 +2012,7 @@ case 15:
if ( ++p == pe )
goto _test_eof43;
case 43:
-#line 2016 "src/ngx_http_memc_response.c"
+#line 2022 "src/ngx_http_memc_response.c"
goto st0;
st16:
if ( ++p == pe )
@@ -2214,7 +2214,7 @@ case 40:
if ( ++p == pe )
goto _test_eof44;
case 44:
-#line 2218 "src/ngx_http_memc_response.c"
+#line 2224 "src/ngx_http_memc_response.c"
switch( (*p) ) {
case 13: goto st35;
case 69: goto st37;
@@ -2283,7 +2283,7 @@ case 42:
_out: {}
}
-#line 621 "src/ngx_http_memc_response.rl"
+#line 627 "src/ngx_http_memc_response.rl"
*cs_addr = cs;
@@ -2298,11 +2298,11 @@ parse_memc_delete(int *cs_addr, u_char *p, u_char *pe, ngx_uint_t *status_addr,
int cs = *cs_addr;
-#line 635 "src/ngx_http_memc_response.rl"
+#line 641 "src/ngx_http_memc_response.rl"
-#line 636 "src/ngx_http_memc_response.rl"
+#line 642 "src/ngx_http_memc_response.rl"
-#line 2306 "src/ngx_http_memc_response.c"
+#line 2312 "src/ngx_http_memc_response.c"
{
if ( p == pe )
goto _test_eof;
@@ -2458,7 +2458,7 @@ case 15:
if ( ++p == pe )
goto _test_eof45;
case 45:
-#line 2462 "src/ngx_http_memc_response.c"
+#line 2468 "src/ngx_http_memc_response.c"
goto st0;
st16:
if ( ++p == pe )
@@ -2713,7 +2713,7 @@ case 44:
_out: {}
}
-#line 637 "src/ngx_http_memc_response.rl"
+#line 643 "src/ngx_http_memc_response.rl"
*cs_addr = cs;
@@ -2728,11 +2728,11 @@ parse_memc_incr_decr(int *cs_addr, u_char *p, u_char *pe,
int cs = *cs_addr;
-#line 651 "src/ngx_http_memc_response.rl"
+#line 657 "src/ngx_http_memc_response.rl"
-#line 652 "src/ngx_http_memc_response.rl"
+#line 658 "src/ngx_http_memc_response.rl"
-#line 2736 "src/ngx_http_memc_response.c"
+#line 2742 "src/ngx_http_memc_response.c"
{
if ( p == pe )
goto _test_eof;
@@ -2762,7 +2762,7 @@ cs = 0;
if ( ++p == pe )
goto _test_eof2;
case 2:
-#line 2766 "src/ngx_http_memc_response.c"
+#line 2772 "src/ngx_http_memc_response.c"
switch( (*p) ) {
case 13: goto tr6;
case 32: goto tr7;
@@ -2781,7 +2781,7 @@ case 2:
if ( ++p == pe )
goto _test_eof3;
case 3:
-#line 2785 "src/ngx_http_memc_response.c"
+#line 2791 "src/ngx_http_memc_response.c"
if ( (*p) == 10 )
goto tr8;
goto st0;
@@ -2844,7 +2844,7 @@ case 3:
if ( ++p == pe )
goto _test_eof40;
case 40:
-#line 2848 "src/ngx_http_memc_response.c"
+#line 2854 "src/ngx_http_memc_response.c"
goto st0;
tr7:
#line 26 "src/memc_common.rl"
@@ -2857,7 +2857,7 @@ case 40:
if ( ++p == pe )
goto _test_eof4;
case 4:
-#line 2861 "src/ngx_http_memc_response.c"
+#line 2867 "src/ngx_http_memc_response.c"
switch( (*p) ) {
case 13: goto tr6;
case 32: goto tr7;
@@ -2874,7 +2874,7 @@ case 4:
if ( ++p == pe )
goto _test_eof5;
case 5:
-#line 2878 "src/ngx_http_memc_response.c"
+#line 2884 "src/ngx_http_memc_response.c"
if ( (*p) == 76 )
goto tr9;
goto st0;
@@ -2889,7 +2889,7 @@ case 5:
if ( ++p == pe )
goto _test_eof6;
case 6:
-#line 2893 "src/ngx_http_memc_response.c"
+#line 2899 "src/ngx_http_memc_response.c"
if ( (*p) == 73 )
goto tr10;
goto st0;
@@ -2904,7 +2904,7 @@ case 6:
if ( ++p == pe )
goto _test_eof7;
case 7:
-#line 2908 "src/ngx_http_memc_response.c"
+#line 2914 "src/ngx_http_memc_response.c"
if ( (*p) == 69 )
goto tr11;
goto st0;
@@ -2919,7 +2919,7 @@ case 7:
if ( ++p == pe )
goto _test_eof8;
case 8:
-#line 2923 "src/ngx_http_memc_response.c"
+#line 2929 "src/ngx_http_memc_response.c"
if ( (*p) == 78 )
goto tr12;
goto st0;
@@ -2934,7 +2934,7 @@ case 8:
if ( ++p == pe )
goto _test_eof9;
case 9:
-#line 2938 "src/ngx_http_memc_response.c"
+#line 2944 "src/ngx_http_memc_response.c"
if ( (*p) == 84 )
goto tr13;
goto st0;
@@ -2949,7 +2949,7 @@ case 9:
if ( ++p == pe )
goto _test_eof10;
case 10:
-#line 2953 "src/ngx_http_memc_response.c"
+#line 2959 "src/ngx_http_memc_response.c"
if ( (*p) == 95 )
goto tr14;
goto st0;
@@ -2964,7 +2964,7 @@ case 10:
if ( ++p == pe )
goto _test_eof11;
case 11:
-#line 2968 "src/ngx_http_memc_response.c"
+#line 2974 "src/ngx_http_memc_response.c"
if ( (*p) == 69 )
goto tr15;
goto st0;
@@ -2979,7 +2979,7 @@ case 11:
if ( ++p == pe )
goto _test_eof12;
case 12:
-#line 2983 "src/ngx_http_memc_response.c"
+#line 2989 "src/ngx_http_memc_response.c"
if ( (*p) == 82 )
goto tr16;
goto st0;
@@ -2994,7 +2994,7 @@ case 12:
if ( ++p == pe )
goto _test_eof13;
case 13:
-#line 2998 "src/ngx_http_memc_response.c"
+#line 3004 "src/ngx_http_memc_response.c"
if ( (*p) == 82 )
goto tr17;
goto st0;
@@ -3009,7 +3009,7 @@ case 13:
if ( ++p == pe )
goto _test_eof14;
case 14:
-#line 3013 "src/ngx_http_memc_response.c"
+#line 3019 "src/ngx_http_memc_response.c"
if ( (*p) == 79 )
goto tr18;
goto st0;
@@ -3024,7 +3024,7 @@ case 14:
if ( ++p == pe )
goto _test_eof15;
case 15:
-#line 3028 "src/ngx_http_memc_response.c"
+#line 3034 "src/ngx_http_memc_response.c"
if ( (*p) == 82 )
goto tr19;
goto st0;
@@ -3039,7 +3039,7 @@ case 15:
if ( ++p == pe )
goto _test_eof16;
case 16:
-#line 3043 "src/ngx_http_memc_response.c"
+#line 3049 "src/ngx_http_memc_response.c"
if ( (*p) == 32 )
goto tr20;
goto st0;
@@ -3054,7 +3054,7 @@ case 16:
if ( ++p == pe )
goto _test_eof17;
case 17:
-#line 3058 "src/ngx_http_memc_response.c"
+#line 3064 "src/ngx_http_memc_response.c"
if ( (*p) == 13 )
goto tr21;
goto tr20;
@@ -3069,7 +3069,7 @@ case 17:
if ( ++p == pe )
goto _test_eof18;
case 18:
-#line 3073 "src/ngx_http_memc_response.c"
+#line 3079 "src/ngx_http_memc_response.c"
switch( (*p) ) {
case 10: goto tr22;
case 13: goto tr21;
@@ -3086,7 +3086,7 @@ case 18:
if ( ++p == pe )
goto _test_eof19;
case 19:
-#line 3090 "src/ngx_http_memc_response.c"
+#line 3096 "src/ngx_http_memc_response.c"
if ( (*p) == 82 )
goto tr23;
goto st0;
@@ -3101,7 +3101,7 @@ case 19:
if ( ++p == pe )
goto _test_eof20;
case 20:
-#line 3105 "src/ngx_http_memc_response.c"
+#line 3111 "src/ngx_http_memc_response.c"
if ( (*p) == 82 )
goto tr24;
goto st0;
@@ -3116,7 +3116,7 @@ case 20:
if ( ++p == pe )
goto _test_eof21;
case 21:
-#line 3120 "src/ngx_http_memc_response.c"
+#line 3126 "src/ngx_http_memc_response.c"
if ( (*p) == 79 )
goto tr25;
goto st0;
@@ -3131,7 +3131,7 @@ case 21:
if ( ++p == pe )
goto _test_eof22;
case 22:
-#line 3135 "src/ngx_http_memc_response.c"
+#line 3141 "src/ngx_http_memc_response.c"
if ( (*p) == 82 )
goto tr26;
goto st0;
@@ -3146,7 +3146,7 @@ case 22:
if ( ++p == pe )
goto _test_eof23;
case 23:
-#line 3150 "src/ngx_http_memc_response.c"
+#line 3156 "src/ngx_http_memc_response.c"
if ( (*p) == 13 )
goto tr27;
goto st0;
@@ -3161,7 +3161,7 @@ case 23:
if ( ++p == pe )
goto _test_eof24;
case 24:
-#line 3165 "src/ngx_http_memc_response.c"
+#line 3171 "src/ngx_http_memc_response.c"
if ( (*p) == 10 )
goto tr22;
goto st0;
@@ -3176,7 +3176,7 @@ case 24:
if ( ++p == pe )
goto _test_eof25;
case 25:
-#line 3180 "src/ngx_http_memc_response.c"
+#line 3186 "src/ngx_http_memc_response.c"
if ( (*p) == 79 )
goto tr28;
goto st0;
@@ -3191,7 +3191,7 @@ case 25:
if ( ++p == pe )
goto _test_eof26;
case 26:
-#line 3195 "src/ngx_http_memc_response.c"
+#line 3201 "src/ngx_http_memc_response.c"
if ( (*p) == 84 )
goto tr29;
goto st0;
@@ -3206,7 +3206,7 @@ case 26:
if ( ++p == pe )
goto _test_eof27;
case 27:
-#line 3210 "src/ngx_http_memc_response.c"
+#line 3216 "src/ngx_http_memc_response.c"
if ( (*p) == 95 )
goto tr30;
goto st0;
@@ -3221,7 +3221,7 @@ case 27:
if ( ++p == pe )
goto _test_eof28;
case 28: