aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_string.c28
-rw-r--r--src/core/ngx_string.h19
2 files changed, 29 insertions, 18 deletions
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
index 29dc39f5a..6a927b03b 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -105,21 +105,21 @@ ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...)
u_char *
ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
{
- u_char *p, zero, *last, temp[NGX_INT64_LEN + 1];
+ u_char *p, zero, *last, temp[NGX_INT64_LEN + 1];
/*
* really we need temp[NGX_INT64_LEN] only,
* but icc issues the warning
*/
- int d;
- size_t len;
- uint32_t ui32;
- int64_t i64;
- uint64_t ui64;
- ngx_msec_t ms;
- ngx_str_t *s;
- ngx_uint_t width, sign, hexadecimal, max_width;
- static u_char hex[] = "0123456789abcdef";
- static u_char HEX[] = "0123456789ABCDEF";
+ int d;
+ size_t len;
+ uint32_t ui32;
+ int64_t i64;
+ uint64_t ui64;
+ ngx_msec_t ms;
+ ngx_uint_t width, sign, hexadecimal, max_width;
+ ngx_variable_value_t *v;
+ static u_char hex[] = "0123456789abcdef";
+ static u_char HEX[] = "0123456789ABCDEF";
if (max == 0) {
return buf;
@@ -188,12 +188,12 @@ ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
switch (*fmt) {
case 'V':
- s = va_arg(args, ngx_str_t *);
+ v = va_arg(args, ngx_variable_value_t *);
- len = s->len & 0xffff;
+ len = v->len;
len = (buf + len < last) ? len : (size_t) (last - buf);
- buf = ngx_cpymem(buf, s->data, len);
+ buf = ngx_cpymem(buf, v->data, len);
fmt++;
continue;
diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h
index 6b432d1f2..9e0b06394 100644
--- a/src/core/ngx_string.h
+++ b/src/core/ngx_string.h
@@ -13,17 +13,28 @@
typedef struct {
- size_t len;
- u_char *data;
+ size_t len;
+ u_char *data;
} ngx_str_t;
typedef struct {
- ngx_str_t key;
- ngx_str_t value;
+ ngx_str_t key;
+ ngx_str_t value;
} ngx_keyval_t;
+typedef struct {
+ unsigned len:29;
+
+ unsigned valid:1;
+ unsigned no_cachable:1;
+ unsigned not_found:1;
+
+ u_char *data;
+} ngx_variable_value_t;
+
+
#define ngx_string(str) { sizeof(str) - 1, (u_char *) str }
#define ngx_null_string { 0, NULL }