Changeset 8310b2
- Timestamp:
- 02/03/09 19:45:01 (3 years ago)
- Branches:
- master-v0.7, nginx-v0.7, nginx-v0.8, upstream_count_limit
- Children:
- e86d7f, f54237
- Parents:
- 2ac4f5
- git-author:
- George Potapov <nephrite@…> (02/03/09 19:45:01)
- git-committer:
- George Potapov <nephrite@…> (02/03/09 19:45:01)
- Location:
- server
- Files:
-
- 10 edited
-
CHANGES (modified) (1 diff)
-
CHANGES.ru (modified) (1 diff)
-
src/core/nginx.h (modified) (1 diff)
-
src/core/ngx_resolver.c (modified) (7 diffs)
-
src/http/modules/ngx_http_index_module.c (modified) (9 diffs)
-
src/http/modules/perl/nginx.pm (modified) (1 diff)
-
src/http/ngx_http_core_module.c (modified) (2 diffs)
-
src/http/ngx_http_request.c (modified) (1 diff)
-
src/http/ngx_http_variables.c (modified) (3 diffs)
-
src/mail/ngx_mail_smtp_handler.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
server/CHANGES
r2ac4f5 r8310b2 1 2 Changes with nginx 0.7.33 02 Feb 2009 3 4 *) Bugfix: a double response might be returned if the epoll or rtsig 5 methods are used and a redirect was returned to a request with 6 body. 7 Thanks to Eden Li. 8 9 *) Bugfix: the $sent_http_location variable was empty for some 10 redirects types. 11 12 *) Bugfix: a segmentation fault might occur in worker process if 13 "resolver" directive was used in SMTP proxy. 14 1 15 2 16 Changes with nginx 0.7.32 26 Jan 2009 -
server/CHANGES.ru
r2ac4f5 r8310b2 1 2 éÚÍÅÎÅÎÉÑ × nginx 0.7.33 02.02.2009 3 4 *) éÓÐÒÁ×ÌÅÎÉÅ: ÅÓÌÉ ÎÁ ÚÁÐÒÏÓ Ó ÔÅÌÏÍ ×ÏÚ×ÒÁÝÁÌÓÑ ÒÅÄÉÒÅËÔ, ÔÏ ÏÔ×ÅÔ 5 ÍÏÇ ÂÙÔØ Ä×ÏÊÎÙÍ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÍÅÔÏÄÏ× epoll ÉÌÉ rtsig. 6 óÐÁÓÉÂÏ Eden Li. 7 8 *) éÓÐÒÁ×ÌÅÎÉÅ: ÄÌÑ ÎÅËÏÔÏÒÙÈ ÔÉÐÏ× ÒÅÄÉÒÅËÔÏ× × ÐÅÒÅÍÅÎÎÏÊ 9 $sent_http_location ÂÙÌÏ ÐÕÓÔÏÅ ÚÎÁÞÅÎÉÅ. 10 11 *) éÓÐÒÁ×ÌÅÎÉÅ: ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÄÉÒÅËÔÉ×Ù resolver × SMTP 12 ÐÒÏËÓÉ-ÓÅÒ×ÅÒÅ × ÒÁÂÏÞÅÍ ÐÒÏÃÅÓÓÅ ÍÏÇ ÐÒÏÉÚÏÊÔÉ segmentation fault. 13 1 14 2 15 éÚÍÅÎÅÎÉÑ × nginx 0.7.32 26.01.2009 -
server/src/core/nginx.h
r2ac4f5 r8310b2 9 9 10 10 11 #define NGINX_VERSION "0.7.3 2"11 #define NGINX_VERSION "0.7.33" 12 12 #define NGINX_VER "nginx/" NGINX_VERSION 13 13 -
server/src/core/ngx_resolver.c
r43a52e r8310b2 579 579 ngx_resolve_addr(ngx_resolver_ctx_t *ctx) 580 580 { 581 u_char *name; 581 582 ngx_resolver_t *r; 582 583 ngx_resolver_node_t *rn; … … 602 603 ngx_queue_insert_head(&r->addr_expire_queue, &rn->queue); 603 604 604 ctx->name.len = rn->nlen; 605 ctx->name.data = ngx_resolver_dup(r, rn->name, rn->nlen); 606 if (ctx->name.data == NULL) { 605 name = ngx_resolver_dup(r, rn->name, rn->nlen); 606 if (name == NULL) { 607 607 goto failed; 608 608 } 609 609 610 ctx->name.len = rn->nlen; 611 ctx->name.data = name; 612 610 613 /* unlock addr mutex */ 611 614 … … 614 617 ctx->handler(ctx); 615 618 616 ngx_resolver_free(r, ctx->name.data);619 ngx_resolver_free(r, name); 617 620 618 621 return NGX_OK; … … 624 627 rn->waiting = ctx; 625 628 626 return NGX_AGAIN; 629 /* unlock addr mutex */ 630 631 return NGX_OK; 627 632 } 628 633 … … 1337 1342 } 1338 1343 1339 if (naddrs ) {1344 if (naddrs > 1) { 1340 1345 ngx_resolver_free(r, addrs); 1341 1346 } … … 1514 1519 } 1515 1520 1516 len -= 2;1517 1518 1521 if (ngx_resolver_copy(r, &name, buf, &buf[i], &buf[n]) != NGX_OK) { 1519 1522 return; … … 1522 1525 ngx_log_debug1(NGX_LOG_DEBUG_CORE, r->log, 0, "resolver an:%V", &name); 1523 1526 1524 if (len != (size_t) rn->nlen || ngx_strncmp(name.data, rn->name, len) != 0) 1527 if (name.len != (size_t) rn->nlen 1528 || ngx_strncmp(name.data, rn->name, name.len) != 0) 1525 1529 { 1526 ngx_resolver_free(r, rn->name); 1530 if (rn->nlen) { 1531 ngx_resolver_free(r, rn->name); 1532 } 1533 1534 rn->nlen = (u_short) name.len; 1527 1535 rn->name = name.data; 1528 1536 1529 name.data = ngx_resolver_dup(r, rn->name, len);1537 name.data = ngx_resolver_dup(r, rn->name, name.len); 1530 1538 if (name.data == NULL) { 1531 1539 goto failed; -
server/src/http/modules/ngx_http_index_module.c
rb82943 r8310b2 97 97 { 98 98 u_char *p, *name; 99 size_t len, nlen, root, allocated;99 size_t len, root, reserve, allocated; 100 100 ngx_int_t rc; 101 101 ngx_str_t path, uri; … … 129 129 dir_tested = 0; 130 130 name = NULL; 131 /* suppress MSVC warning */ 131 132 path.data = NULL; 132 133 … … 140 141 } 141 142 142 len= ilcf->max_index_len;143 nlen = index[i].name.len;143 reserve = ilcf->max_index_len; 144 len = index[i].name.len; 144 145 145 146 } else { … … 150 151 e.flushed = 1; 151 152 152 /* 1 byte for terminating '\0' */ 153 153 /* 1 is for terminating '\0' as in static names */ 154 154 len = 1; 155 155 … … 159 159 } 160 160 161 nlen = len;162 163 161 /* 16 bytes are preallocation */ 164 162 165 len +=16;166 } 167 168 if ( len > (size_t) (path.data + allocated - name)) {169 170 name = ngx_http_map_uri_to_path(r, &path, &root, len);163 reserve = len + 16; 164 } 165 166 if (reserve > allocated) { 167 168 name = ngx_http_map_uri_to_path(r, &path, &root, reserve); 171 169 if (name == NULL) { 172 170 return NGX_ERROR; 173 171 } 174 172 175 allocated = path. len;173 allocated = path.data + path.len - name; 176 174 } 177 175 … … 194 192 195 193 if (*name == '/') { 196 uri.len = nlen - 1;194 uri.len = len - 1; 197 195 uri.data = name; 198 196 return ngx_http_internal_redirect(r, &uri, &r->args); … … 249 247 } 250 248 251 uri.len = r->uri.len + nlen - 1;249 uri.len = r->uri.len + len - 1; 252 250 253 251 if (!clcf->alias) { … … 261 259 262 260 p = ngx_copy(uri.data, r->uri.data, r->uri.len); 263 ngx_memcpy(p, name, nlen - 1);261 ngx_memcpy(p, name, len - 1); 264 262 } 265 263 … … 492 490 } 493 491 494 /* include the terminating '\0' to the length to use ngx_ copy() */492 /* include the terminating '\0' to the length to use ngx_memcpy() */ 495 493 index->name.len++; 496 494 -
server/src/http/modules/perl/nginx.pm
r2ac4f5 r8310b2 48 48 ); 49 49 50 our $VERSION = '0.7.3 2';50 our $VERSION = '0.7.33'; 51 51 52 52 require XSLoader; -
server/src/http/ngx_http_core_module.c
r2ac4f5 r8310b2 1035 1035 ngx_http_phase_handler_t *ph) 1036 1036 { 1037 size_t len, root, alias; 1038 ssize_t reserve, allocated; 1037 size_t len, root, alias, reserve, allocated; 1039 1038 u_char *p, *name; 1040 1039 ngx_str_t path; … … 1060 1059 root = 0; 1061 1060 name = NULL; 1062 path.len = 0;1061 /* suppress MSVC warning */ 1063 1062 path.data = NULL; 1064 1063 -
server/src/http/ngx_http_request.c
rb82943 r8310b2 2186 2186 2187 2187 if (r->discard_body) { 2188 r->write_event_handler = ngx_http_request_empty_handler; 2188 2189 r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000); 2189 2190 ngx_add_timer(rev, clcf->lingering_timeout); -
server/src/http/ngx_http_variables.c
ra90ad7 r8310b2 69 69 ngx_http_variable_value_t *v, uintptr_t data); 70 70 static ngx_int_t ngx_http_variable_sent_content_length(ngx_http_request_t *r, 71 ngx_http_variable_value_t *v, uintptr_t data); 72 static ngx_int_t ngx_http_variable_sent_location(ngx_http_request_t *r, 71 73 ngx_http_variable_value_t *v, uintptr_t data); 72 74 static ngx_int_t ngx_http_variable_sent_last_modified(ngx_http_request_t *r, … … 211 213 ngx_http_variable_sent_content_length, 0, 0, 0 }, 212 214 215 { ngx_string("sent_http_location"), NULL, 216 ngx_http_variable_sent_location, 0, 0, 0 }, 217 213 218 { ngx_string("sent_http_last_modified"), NULL, 214 219 ngx_http_variable_sent_last_modified, 0, 0, 0 }, … … 1243 1248 1244 1249 static ngx_int_t 1250 ngx_http_variable_sent_location(ngx_http_request_t *r, 1251 ngx_http_variable_value_t *v, uintptr_t data) 1252 { 1253 if (r->headers_out.location) { 1254 v->len = r->headers_out.location->value.len; 1255 v->valid = 1; 1256 v->no_cacheable = 0; 1257 v->not_found = 0; 1258 v->data = r->headers_out.location->value.data; 1259 1260 return NGX_OK; 1261 } 1262 1263 return ngx_http_variable_unknown_header(v, (ngx_str_t *) data, 1264 &r->headers_out.headers.part, 1265 sizeof("sent_http_") - 1); 1266 } 1267 1268 1269 static ngx_int_t 1245 1270 ngx_http_variable_sent_last_modified(ngx_http_request_t *r, 1246 1271 ngx_http_variable_value_t *v, uintptr_t data) -
server/src/mail/ngx_mail_smtp_handler.c
rb82943 r8310b2 13 13 14 14 static void ngx_mail_smtp_resolve_addr_handler(ngx_resolver_ctx_t *ctx); 15 static void ngx_mail_smtp_resolve_name(ngx_event_t *rev); 15 16 static void ngx_mail_smtp_resolve_name_handler(ngx_resolver_ctx_t *ctx); 16 17 static void ngx_mail_smtp_greeting(ngx_mail_session_t *s, ngx_connection_t *c); … … 92 93 ngx_mail_smtp_resolve_addr_handler(ngx_resolver_ctx_t *ctx) 93 94 { 94 ngx_connection_t *c; 95 ngx_mail_session_t *s; 96 ngx_mail_core_srv_conf_t *cscf; 95 ngx_connection_t *c; 96 ngx_mail_session_t *s; 97 97 98 98 s = ctx->data; … … 134 134 ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, 135 135 "address resolved: %V", &s->host); 136 137 c->read->handler = ngx_mail_smtp_resolve_name; 138 139 ngx_post_event(c->read, &ngx_posted_events); 140 } 141 142 143 static void 144 ngx_mail_smtp_resolve_name(ngx_event_t *rev) 145 { 146 ngx_connection_t *c; 147 ngx_mail_session_t *s; 148 ngx_resolver_ctx_t *ctx; 149 ngx_mail_core_srv_conf_t *cscf; 150 151 c = rev->data; 152 s = c->data; 136 153 137 154 cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
Note: See TracChangeset
for help on using the changeset viewer.
