summaryrefslogtreecommitdiffhomepage
path: root/src/http
diff options
context:
space:
mode:
Diffstat (limited to 'src/http')
-rw-r--r--src/http/modules/ngx_http_static_handler.c15
-rw-r--r--src/http/ngx_http.c3
-rw-r--r--src/http/ngx_http_core_module.c4
-rw-r--r--src/http/ngx_http_request.c10
4 files changed, 19 insertions, 13 deletions
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c
index 31dd1fb58..617bb4d80 100644
--- a/src/http/modules/ngx_http_static_handler.c
+++ b/src/http/modules/ngx_http_static_handler.c
@@ -87,8 +87,8 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r)
}
/*
- * there is a valid cached open file, i.e by index handler,
- * and it must be already registered in r->cleanup
+ * there is a valid cached open file, i.e by the index handler,
+ * and it should be already registered in r->cleanup
*/
if (r->cache && !r->cache->expired) {
@@ -100,13 +100,14 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r)
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
/*
- * make a file name
- * 2 bytes is for a trailing '/' in a possible redirect and for '\0'
+ * make a file name, reserve 2 bytes for a trailing '/'
+ * in a possible redirect and for the last '\0'
*/
- ngx_test_null(name.data,
- ngx_palloc(r->pool, clcf->doc_root.len + r->uri.len + 2),
- NGX_HTTP_INTERNAL_SERVER_ERROR);
+ name.data = ngx_palloc(r->pool, clcf->doc_root.len + r->uri.len + 2);
+ if (name.data == NULL) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
location.data = ngx_cpymem(name.data, clcf->doc_root.data,
clcf->doc_root.len);
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 2ada19171..08958141a 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -483,6 +483,9 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_pcalloc(cf->pool, sizeof(struct sockaddr_in)),
NGX_CONF_ERROR);
+#if (HAVE_SIN_LEN)
+ addr_in->sin_len = sizeof(struct sockaddr_in);
+#endif
addr_in->sin_family = AF_INET;
addr_in->sin_addr.s_addr = in_addr[a].addr;
addr_in->sin_port = htons((u_short) in_port[p].port);
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 53be3848f..ad5b3aa0f 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1217,10 +1217,10 @@ static char *ngx_http_core_merge_loc_conf(ngx_conf_t *cf,
prev->default_type, "text/plain");
ngx_conf_merge_msec_value(conf->client_body_timeout,
- prev->client_body_timeout, 10000);
+ prev->client_body_timeout, 60000);
ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0);
- ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 10000);
+ ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000);
ngx_conf_merge_size_value(conf->send_lowat, prev->send_lowat, 0);
ngx_conf_merge_size_value(conf->discarded_buffer_size,
prev->discarded_buffer_size, 1500);
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 5d411a84f..8d20a31d5 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -84,6 +84,8 @@ void ngx_http_init_connection(ngx_connection_t *c)
rev->event_handler = ngx_http_init_request;
rev->log_error = NGX_ERROR_INFO;
+ /* STUB: epoll */ c->write->event_handler = ngx_http_empty_handler;
+
if (rev->ready) {
/* deferred accept, aio, iocp, epoll */
ngx_http_init_request(rev);
@@ -160,7 +162,7 @@ static void ngx_http_init_request(ngx_event_t *rev)
if (in_port->addrs.nelts > 1) {
/*
- * There're the several addresses on this port and one of them
+ * There are the several addresses on this port and one of them
* is "*:port" so getsockname() is needed to determine
* the server address.
* AcceptEx() already gave this address.
@@ -215,8 +217,8 @@ static void ngx_http_init_request(ngx_event_t *rev)
c->log->log_level = clcf->err_log->log_level;
if (c->buffer == NULL) {
- c->buffer =
- ngx_create_temp_hunk(c->pool, cscf->client_header_buffer_size);
+ c->buffer = ngx_create_temp_hunk(c->pool,
+ cscf->client_header_buffer_size);
if (c->buffer == NULL) {
ngx_http_close_connection(c);
return;
@@ -918,7 +920,7 @@ void ngx_http_finalize_request(ngx_http_request_t *r, int rc)
#if (NGX_KQUEUE)
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log,
r->connection->read->kq_errno,
- "kevent reported about closed connection by client");
+ "kevent() reported about an closed connection");
#endif
ngx_http_close_request(r, 0);
ngx_http_close_connection(r->connection);