[nginx] Style: use ngx_str_set().

Maxim Dounin mdounin at mdounin.ru
Wed Jul 9 15:30:43 UTC 2014


details:   http://hg.nginx.org/nginx/rev/d80543940f9a
branches:  
changeset: 5765:d80543940f9a
user:      Tatsuhiko Kubo <cubicdaiya at gmail.com>
date:      Wed Jul 09 23:23:59 2014 +0900
description:
Style: use ngx_str_set().

diffstat:

 src/http/modules/ngx_http_memcached_module.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (17 lines):

diff --git a/src/http/modules/ngx_http_memcached_module.c b/src/http/modules/ngx_http_memcached_module.c
--- a/src/http/modules/ngx_http_memcached_module.c
+++ b/src/http/modules/ngx_http_memcached_module.c
@@ -380,11 +380,8 @@ found:
             }
 
             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