comparison src/http/ngx_http_core_module.c @ 118:644a7935144b NGINX_0_3_6

nginx 0.3.6 *) Change: now the IMAP/POP3 proxy do not send the empty login to authorization server. *) Feature: the "log_format" supports the variables in the $name form. *) Bugfix: if at least in one server was no the "listen" directive, then nginx did not listen on the 80 port; bug appeared in 0.3.3. *) Bugfix: if the URI part is omitted in "proxy_pass" directive, the the 80 port was always used.
author Igor Sysoev <http://sysoev.ru>
date Mon, 24 Oct 2005 00:00:00 +0400
parents 408f195b3482
children d25a1d6034f1
comparison
equal deleted inserted replaced
117:0821ea4ccfc5 118:644a7935144b
1170 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1170 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1171 "http subrequest \"%V\"", uri); 1171 "http subrequest \"%V\"", uri);
1172 1172
1173 ngx_http_handler(sr); 1173 ngx_http_handler(sr);
1174 1174
1175 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1175 /* the request pool may be already destroyed */
1176 "http subrequest \"%V\" done", uri);
1177 1176
1178 return NGX_OK; 1177 return NGX_OK;
1179 } 1178 }
1180 1179
1181 1180
1229 1228
1230 return NGX_DONE; 1229 return NGX_DONE;
1231 } 1230 }
1232 1231
1233 1232
1234 #if 0 /* STUB: test the delay http handler */ 1233 ngx_http_cleanup_t *
1235 1234 ngx_http_cleanup_add(ngx_http_request_t *r, size_t size)
1236 ngx_int_t 1235 {
1237 ngx_http_delay_handler(ngx_http_request_t *r) 1236 ngx_http_cleanup_t *cln;
1238 { 1237
1239 static int on; 1238 r = r->main;
1240 1239
1241 if (on++ == 0) { 1240 cln = ngx_palloc(r->pool, sizeof(ngx_http_cleanup_t));
1242 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1241 if (cln == NULL) {
1243 "http set delay"); 1242 return NULL;
1244 ngx_add_timer(r->connection->write, 10000); 1243 }
1245 return NGX_AGAIN; 1244
1246 } 1245 if (size) {
1247 1246 cln->data = ngx_palloc(r->pool, size);
1248 r->connection->write->timedout = 0; 1247 if (cln->data == NULL) {
1249 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1248 return NULL;
1250 "http reset delay"); 1249 }
1251 return NGX_DECLINED; 1250
1252 } 1251 } else {
1253 1252 cln->data = NULL;
1254 #endif 1253 }
1254
1255 cln->handler = NULL;
1256 cln->next = r->cleanup;
1257
1258 r->cleanup = cln;
1259
1260 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1261 "http cleanup add: %p", cln);
1262
1263 return cln;
1264 }
1255 1265
1256 1266
1257 static char * 1267 static char *
1258 ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) 1268 ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
1259 { 1269 {
1663 if (cmcf == NULL) { 1673 if (cmcf == NULL) {
1664 return NGX_CONF_ERROR; 1674 return NGX_CONF_ERROR;
1665 } 1675 }
1666 1676
1667 if (ngx_array_init(&cmcf->servers, cf->pool, 4, 1677 if (ngx_array_init(&cmcf->servers, cf->pool, 4,
1668 sizeof(ngx_http_core_srv_conf_t *)) == NGX_ERROR) 1678 sizeof(ngx_http_core_srv_conf_t *))
1679 == NGX_ERROR)
1669 { 1680 {
1670 return NGX_CONF_ERROR; 1681 return NGX_CONF_ERROR;
1671 } 1682 }
1672 1683
1673 cmcf->server_names_hash = NGX_CONF_UNSET_UINT; 1684 cmcf->server_names_hash = NGX_CONF_UNSET_UINT;
1765 #else 1776 #else
1766 /* STUB: getuid() should be cached */ 1777 /* STUB: getuid() should be cached */
1767 ls->port = (getuid() == 0) ? 80 : 8000; 1778 ls->port = (getuid() == 0) ? 80 : 8000;
1768 #endif 1779 #endif
1769 ls->family = AF_INET; 1780 ls->family = AF_INET;
1781
1782 ls->conf.backlog = -1;
1783 ls->conf.rcvbuf = -1;
1784 ls->conf.sndbuf = -1;
1770 } 1785 }
1771 1786
1772 if (conf->server_names.nelts == 0) { 1787 if (conf->server_names.nelts == 0) {
1773 sn = ngx_array_push(&conf->server_names); 1788 sn = ngx_array_push(&conf->server_names);
1774 if (sn == NULL) { 1789 if (sn == NULL) {