summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorSergey A. Osokin <osa@FreeBSD.org>2009-12-25 09:53:04 +0000
committerSergey A. Osokin <osa@FreeBSD.org>2009-12-25 09:53:04 +0000
commit537b63c32645befca2a78efe5a6a6529ddeea614 (patch)
tree5e2849bed6e86df431ea889dab6456713390d38c /www
parent- WITH_APACHE2 is deprecated (diff)
Improve redis protocol support.
Do not bump PORTREVISION.
Notes
Notes: svn path=/head/; revision=246583
Diffstat (limited to 'www')
-rw-r--r--www/nginx-devel/Makefile4
-rw-r--r--www/nginx-devel/files/extra-patch-ngx_http_redis_module.c45
-rw-r--r--www/nginx/Makefile4
-rw-r--r--www/nginx/files/extra-patch-ngx_http_redis_module.c45
4 files changed, 98 insertions, 0 deletions
diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile
index 3ebe72e3dc4d..c65b634d3aa6 100644
--- a/www/nginx-devel/Makefile
+++ b/www/nginx-devel/Makefile
@@ -397,6 +397,10 @@ post-patch:
@${PATCH} ${PATCH_ARGS} < \
${PATCHDIR}/extra-patch-ngx_http_notice_module.c
.endif
+.if defined(WITH_HTTP_REDIS_MODULE)
+ @${PATCH} ${PATCH_ARGS} < \
+ ${PATCHDIR}/extra-patch-ngx_http_redis_module.c
+.endif
.if defined(WITH_HTTP_UPLOAD_MODULE)
@${PATCH} ${PATCH_ARGS} < \
${PATCHDIR}/extra-patch-ngx_http_upload_module.c
diff --git a/www/nginx-devel/files/extra-patch-ngx_http_redis_module.c b/www/nginx-devel/files/extra-patch-ngx_http_redis_module.c
new file mode 100644
index 000000000000..57d944b6d3a0
--- /dev/null
+++ b/www/nginx-devel/files/extra-patch-ngx_http_redis_module.c
@@ -0,0 +1,45 @@
+--- ../ngx_http_redis-0.3.0/ngx_http_redis_module.c.orig 2009-12-23 16:55:12.000000000 +0300
++++ ../ngx_http_redis-0.3.0/ngx_http_redis_module.c 2009-12-24 18:09:13.000000000 +0300
+@@ -343,17 +343,29 @@
+ ngx_http_redis_process_header(ngx_http_request_t *r)
+ {
+ u_char *p, *len;
+- u_int c = 0;
++ u_int c, try;
+ ngx_str_t line;
+ ngx_http_upstream_t *u;
+ ngx_http_redis_ctx_t *ctx;
+
++ c = try = 0;
++
+ u = r->upstream;
+
++ p = u->buffer.pos;
++
++ if (*p == '+') {
++ try = 2;
++ } else if (*p == '-') {
++ try = 1;
++ } else {
++ goto no_valid;
++ }
++
+ for (p = u->buffer.pos; p < u->buffer.last; p++) {
+ if (*p == LF) {
+ c++;
+- if (c == 2) {
++ if (c == try) {
+ goto found;
+ }
+ }
+@@ -379,8 +391,8 @@
+ ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
+ "error was received from redis");
+
+- u->headers_in.status_n = 404;
+- u->state->status = 404;
++ u->headers_in.status_n = 502;
++ u->state->status = 502;
+
+ return NGX_OK;
+ }
diff --git a/www/nginx/Makefile b/www/nginx/Makefile
index 5ad87ce53739..8e738a0768b2 100644
--- a/www/nginx/Makefile
+++ b/www/nginx/Makefile
@@ -385,6 +385,10 @@ post-patch:
@${PATCH} ${PATCH_ARGS} < \
${PATCHDIR}/extra-patch-ngx_http_notice_module.c
.endif
+.if defined(WITH_HTTP_REDIS_MODULE)
+ @${PATCH} ${PATCH_ARGS} < \
+ ${PATCHDIR}/extra-patch-ngx_http_redis_module.c
+.endif
.if defined(WITH_HTTP_UPLOAD_PROGRESS)
@${PATCH} ${PATCH_ARGS} < \
${PATCHDIR}/extra-patch-ngx_http_uploadprogress_module.c
diff --git a/www/nginx/files/extra-patch-ngx_http_redis_module.c b/www/nginx/files/extra-patch-ngx_http_redis_module.c
new file mode 100644
index 000000000000..57d944b6d3a0
--- /dev/null
+++ b/www/nginx/files/extra-patch-ngx_http_redis_module.c
@@ -0,0 +1,45 @@
+--- ../ngx_http_redis-0.3.0/ngx_http_redis_module.c.orig 2009-12-23 16:55:12.000000000 +0300
++++ ../ngx_http_redis-0.3.0/ngx_http_redis_module.c 2009-12-24 18:09:13.000000000 +0300
+@@ -343,17 +343,29 @@
+ ngx_http_redis_process_header(ngx_http_request_t *r)
+ {
+ u_char *p, *len;
+- u_int c = 0;
++ u_int c, try;
+ ngx_str_t line;
+ ngx_http_upstream_t *u;
+ ngx_http_redis_ctx_t *ctx;
+
++ c = try = 0;
++
+ u = r->upstream;
+
++ p = u->buffer.pos;
++
++ if (*p == '+') {
++ try = 2;
++ } else if (*p == '-') {
++ try = 1;
++ } else {
++ goto no_valid;
++ }
++
+ for (p = u->buffer.pos; p < u->buffer.last; p++) {
+ if (*p == LF) {
+ c++;
+- if (c == 2) {
++ if (c == try) {
+ goto found;
+ }
+ }
+@@ -379,8 +391,8 @@
+ ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
+ "error was received from redis");
+
+- u->headers_in.status_n = 404;
+- u->state->status = 404;
++ u->headers_in.status_n = 502;
++ u->state->status = 502;
+
+ return NGX_OK;
+ }