[PATCH 3 of 3] Style: use ngx_str_set()

cubicdaiya at gmail.com cubicdaiya at gmail.com
Wed Jul 9 14:31:10 UTC 2014


# HG changeset patch
# User Tatsuhiko Kubo <cubicdaiya at gmail.com>
# Date 1404915839 -32400
#      Wed Jul 09 23:23:59 2014 +0900
# Node ID d80543940f9a33b262d05864a30ab8b22e906455
# Parent  f166c521b619dab231b15e60cec47dd81f52833e
Style: use ngx_str_set().

diff -r f166c521b619 -r d80543940f9a src/http/modules/ngx_http_memcached_module.c
--- a/src/http/modules/ngx_http_memcached_module.c	Wed Jul 09 23:22:14 2014 +0900
+++ b/src/http/modules/ngx_http_memcached_module.c	Wed Jul 09 23:23:59 2014 +0900
@@ -380,11 +380,8 @@
             }
 
             h->hash = 1;
-            h->key.len = sizeof("Content-Encoding") - 1;
-            h->key.data = (u_char *) "Content-Encoding";
-            h->value.len = sizeof("gzip") - 1;
-            h->value.data = (u_char *) "gzip";
-
+            ngx_str_set(&h->key, "Content-Encoding");
+            ngx_str_set(&h->value, "gzip");
             r->headers_out.content_encoding = h;
         }
 



More information about the nginx-devel mailing list