comparison src/http/modules/ngx_http_map_module.c @ 797:36f7b549f481

fix segfault if $server_addr failed
author Igor Sysoev <igor@sysoev.ru>
date Fri, 20 Oct 2006 19:07:50 +0000
parents e60fe4cf1d4e
children 8ef04207c84f bf7814d77484
comparison
equal deleted inserted replaced
796:3db9dd3d9d8c 797:36f7b549f481
113 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 113 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
114 "http map started"); 114 "http map started");
115 115
116 vv = ngx_http_get_flushed_variable(r, map->index); 116 vv = ngx_http_get_flushed_variable(r, map->index);
117 117
118 if (vv == NULL || vv->not_found) {
119 *v = *map->default_value;
120 return NGX_OK;
121 }
122
118 len = vv->len; 123 len = vv->len;
119 124
120 if (len && map->hostnames && vv->data[len - 1] == '.') { 125 if (len && map->hostnames && vv->data[len - 1] == '.') {
121 len--; 126 len--;
122 } 127 }