Permalink
Browse files

various coding style fixes and also turned off ddebug.

  • Loading branch information...
1 parent e0be891 commit 468319aa371961b9c8e333bc560e759c387624bb @agentzh agentzh committed Jul 5, 2010
Showing with 17 additions and 15 deletions.
  1. +2 −2 src/ngx_http_set_base32.c
  2. +5 −3 src/ngx_http_set_local_today.c
  3. +10 −10 src/ngx_http_set_misc_module.c
@@ -230,9 +230,9 @@ encode_base32(int slen, const char *src, int *dlen, char *dst)
* src = (char*)"6RRU6H5CI3======";
* dst = malloc(base32_decoded_length(slen));
* if (!decode_base32(slen, src, &(dlen), dst)) {
- * // do something with dst
+ * ...do something with dst
* } else {
- * // decoding error
+ * ...decoding error
* }
* </code>
* @param slen 源数据串长度.
@@ -1,13 +1,13 @@
-#define DDEBUG 1
+#define DDEBUG 0
#include "ddebug.h"
+
#include <ndk.h>
ngx_int_t
ngx_http_set_local_today(ngx_http_request_t *r, ngx_str_t *res,
ngx_http_variable_value_t *v)
{
- //ngx_time_t *t;
time_t now;
ngx_tm_t tm;
u_char *p;
@@ -19,12 +19,14 @@ ngx_http_set_local_today(ngx_http_request_t *r, ngx_str_t *res,
ngx_gmtime(now + ngx_cached_time->gmtoff * 60, &tm);
dd("tm.ngx_tm_hour:%d", tm.ngx_tm_hour);
+
p = ngx_palloc(r->pool, sizeof("xxxx-xx-xx") - 1);
if (p == NULL) {
return NGX_ERROR;
}
- ngx_sprintf(p, "%04d-%02d-%02d", tm.ngx_tm_year, tm.ngx_tm_mon, tm.ngx_tm_mday);
+ ngx_sprintf(p, "%04d-%02d-%02d", tm.ngx_tm_year, tm.ngx_tm_mon,
+ tm.ngx_tm_mday);
res->data = p;
res->len = sizeof("xxxx-xx-xx") - 1;
@@ -166,15 +166,15 @@ static ngx_http_module_t ngx_http_set_misc_module_ctx = {
ngx_module_t ngx_http_set_misc_module = {
NGX_MODULE_V1,
- &ngx_http_set_misc_module_ctx, // module context
- ngx_http_set_misc_commands, // module directives
- NGX_HTTP_MODULE, // module type
- NULL, // init master
- NULL, // init module
- NULL, // init process
- NULL, // init thread
- NULL, // exit thread
- NULL, // exit process
- NULL, // exit master
+ &ngx_http_set_misc_module_ctx, /* module context */
+ ngx_http_set_misc_commands, /* module directives */
+ NGX_HTTP_MODULE, /* module type */
+ NULL, /* init master */
+ NULL, /* init module */
+ NULL, /* init process */
+ NULL, /* init thread */
+ NULL, /* exit thread */
+ NULL, /* exit process */
+ NULL, /* exit master */
NGX_MODULE_V1_PADDING
};

0 comments on commit 468319a

Please sign in to comment.