Permalink
Browse files

converted CRLF in the source files and test files to LF. also fixed o…

…ne place that does not check the pointer returned by the memory allocator.
  • Loading branch information...
1 parent 91997b2 commit 290d6cbe19e859826c7a92299bb613a499130d86 @agentzh agentzh committed Dec 16, 2011
Showing with 675 additions and 647 deletions.
  1. +72 −72 src/ngx_http_set_hash.c
  2. +310 −305 src/ngx_http_set_quote_sql.c
  3. +181 −181 src/ngx_http_set_unescape_uri.c
  4. +89 −89 t/default-value.t
  5. +23 −0 valgrind.suppress
View
@@ -1,72 +1,72 @@
-#define DDEBUG 0
-#include "ddebug.h"
-
-#include "ngx_http_set_hash.h"
-#include "ngx_sha1.h"
-#include "ngx_md5.h"
-
-
-#ifndef SHA_DIGEST_LENGTH
-#define SHA_DIGEST_LENGTH 20
-#endif
-
-#ifndef MD5_DIGEST_LENGTH
-#define MD5_DIGEST_LENGTH 16
-#endif
-
-enum {
- SHA_HEX_LENGTH = SHA_DIGEST_LENGTH * 2,
- MD5_HEX_LENGTH = MD5_DIGEST_LENGTH * 2
-};
-
-
-ngx_int_t
-ngx_http_set_misc_set_sha1(ngx_http_request_t *r,
- ngx_str_t *res, ngx_http_variable_value_t *v)
-{
- u_char *p;
- ngx_sha1_t sha;
- u_char sha_buf[SHA_DIGEST_LENGTH];
-
- p = ngx_palloc(r->pool, SHA_HEX_LENGTH);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- ngx_sha1_init(&sha);
- ngx_sha1_update(&sha, v->data, v->len);
- ngx_sha1_final(sha_buf, &sha);
-
- ngx_hex_dump(p, sha_buf, sizeof(sha_buf));
-
- res->data = p;
- res->len = SHA_HEX_LENGTH;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_set_misc_set_md5(ngx_http_request_t *r,
- ngx_str_t *res, ngx_http_variable_value_t *v)
-{
- u_char *p;
- ngx_md5_t md5;
- u_char md5_buf[MD5_DIGEST_LENGTH];
-
- p = ngx_palloc(r->pool, MD5_HEX_LENGTH);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- ngx_md5_init(&md5);
- ngx_md5_update(&md5, v->data, v->len);
- ngx_md5_final(md5_buf, &md5);
-
- ngx_hex_dump(p, md5_buf, sizeof(md5_buf));
-
- res->data = p;
- res->len = MD5_HEX_LENGTH;
-
- return NGX_OK;
-}
+#define DDEBUG 0
+#include "ddebug.h"
+
+#include "ngx_http_set_hash.h"
+#include "ngx_sha1.h"
+#include "ngx_md5.h"
+
+
+#ifndef SHA_DIGEST_LENGTH
+#define SHA_DIGEST_LENGTH 20
+#endif
+
+#ifndef MD5_DIGEST_LENGTH
+#define MD5_DIGEST_LENGTH 16
+#endif
+
+enum {
+ SHA_HEX_LENGTH = SHA_DIGEST_LENGTH * 2,
+ MD5_HEX_LENGTH = MD5_DIGEST_LENGTH * 2
+};
+
+
+ngx_int_t
+ngx_http_set_misc_set_sha1(ngx_http_request_t *r,
+ ngx_str_t *res, ngx_http_variable_value_t *v)
+{
+ u_char *p;
+ ngx_sha1_t sha;
+ u_char sha_buf[SHA_DIGEST_LENGTH];
+
+ p = ngx_palloc(r->pool, SHA_HEX_LENGTH);
+ if (p == NULL) {
+ return NGX_ERROR;
+ }
+
+ ngx_sha1_init(&sha);
+ ngx_sha1_update(&sha, v->data, v->len);
+ ngx_sha1_final(sha_buf, &sha);
+
+ ngx_hex_dump(p, sha_buf, sizeof(sha_buf));
+
+ res->data = p;
+ res->len = SHA_HEX_LENGTH;
+
+ return NGX_OK;
+}
+
+
+ngx_int_t
+ngx_http_set_misc_set_md5(ngx_http_request_t *r,
+ ngx_str_t *res, ngx_http_variable_value_t *v)
+{
+ u_char *p;
+ ngx_md5_t md5;
+ u_char md5_buf[MD5_DIGEST_LENGTH];
+
+ p = ngx_palloc(r->pool, MD5_HEX_LENGTH);
+ if (p == NULL) {
+ return NGX_ERROR;
+ }
+
+ ngx_md5_init(&md5);
+ ngx_md5_update(&md5, v->data, v->len);
+ ngx_md5_final(md5_buf, &md5);
+
+ ngx_hex_dump(p, md5_buf, sizeof(md5_buf));
+
+ res->data = p;
+ res->len = MD5_HEX_LENGTH;
+
+ return NGX_OK;
+}
Oops, something went wrong.

0 comments on commit 290d6cb

Please sign in to comment.