mirror of
https://github.com/nginx/nginx.git
synced 2024-11-28 08:09:00 +08:00
nginx-0.0.1-2003-04-24-18:46:08 import
This commit is contained in:
parent
fb970519d4
commit
0e18ebd0d9
@ -18,9 +18,10 @@
|
|||||||
|
|
||||||
/* STUB */
|
/* STUB */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int dummy;
|
int type;
|
||||||
} ngx_cache_header_t;
|
} ngx_cache_header_t;
|
||||||
|
|
||||||
|
|
||||||
static int ngx_http_proxy_handler(ngx_http_request_t *r);
|
static int ngx_http_proxy_handler(ngx_http_request_t *r);
|
||||||
|
|
||||||
static ngx_chain_t *ngx_http_proxy_create_request(ngx_http_proxy_ctx_t *p);
|
static ngx_chain_t *ngx_http_proxy_create_request(ngx_http_proxy_ctx_t *p);
|
||||||
@ -609,8 +610,8 @@ static int ngx_http_proxy_connect(ngx_http_proxy_ctx_t *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wev->event_handler = rev->event_handler =
|
rev->event_handler = ngx_http_proxy_process_upstream_event;
|
||||||
ngx_http_proxy_process_upstream_event;
|
p->request->connection->write->event_handler = NULL;
|
||||||
|
|
||||||
p->state_write_upstream_handler = ngx_http_proxy_send_request;
|
p->state_write_upstream_handler = ngx_http_proxy_send_request;
|
||||||
p->state_read_upstream_handler = ngx_http_proxy_init_upstream;
|
p->state_read_upstream_handler = ngx_http_proxy_init_upstream;
|
||||||
@ -1087,7 +1088,7 @@ static int ngx_http_proxy_read_upstream_body(ngx_http_proxy_ctx_t *p)
|
|||||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->event_proxy->upstream_eof && p->event_proxy->upstream_error) {
|
if (p->event_proxy->upstream_eof || p->event_proxy->upstream_error) {
|
||||||
rc = ngx_event_close_connection(p->connection->read);
|
rc = ngx_event_close_connection(p->connection->read);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1095,6 +1096,21 @@ static int ngx_http_proxy_read_upstream_body(ngx_http_proxy_ctx_t *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int ngx_http_proxy_process_client_event(ngx_event_t *ev)
|
||||||
|
{
|
||||||
|
ngx_connection_t *c;
|
||||||
|
ngx_http_request_t *r;
|
||||||
|
ngx_http_proxy_ctx_t *p;
|
||||||
|
|
||||||
|
c = (ngx_connection_t *) ev->data;
|
||||||
|
r = (ngx_http_request_t *) c->data;
|
||||||
|
p = (ngx_http_proxy_ctx_t *)
|
||||||
|
ngx_http_get_module_ctx(r, ngx_http_proxy_module_ctx);
|
||||||
|
|
||||||
|
return ngx_http_proxy_process_upstream(p, ev);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int ngx_http_proxy_write_upstream_body(ngx_http_proxy_ctx_t *p)
|
static int ngx_http_proxy_write_upstream_body(ngx_http_proxy_ctx_t *p)
|
||||||
{
|
{
|
||||||
return ngx_event_proxy_write_to_downstream(p->event_proxy);
|
return ngx_event_proxy_write_to_downstream(p->event_proxy);
|
||||||
@ -1105,6 +1121,23 @@ static int ngx_http_proxy_write_upstream_body(ngx_http_proxy_ctx_t *p)
|
|||||||
|
|
||||||
static int ngx_http_proxy_finalize_request(ngx_http_proxy_ctx_t *p, int error)
|
static int ngx_http_proxy_finalize_request(ngx_http_proxy_ctx_t *p, int error)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
|
||||||
|
if (p->event_proxy->upstream_eof) {
|
||||||
|
rc = ngx_event_close_connection(p->connection->read);
|
||||||
|
link cache;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p->event_proxy->upstream_error) {
|
||||||
|
rc = ngx_event_close_connection(p->connection->read);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p->event_proxy->downstream_error) {
|
||||||
|
rc = ngx_event_close_connection(p->request->connection->write);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return ngx_http_finalize_request(p->request, error);
|
return ngx_http_finalize_request(p->request, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy)
|
|||||||
module = (ngx_http_module_t *) ngx_modules[i]->ctx;
|
module = (ngx_http_module_t *) ngx_modules[i]->ctx;
|
||||||
|
|
||||||
if (module->create_loc_conf) {
|
if (module->create_loc_conf) {
|
||||||
ngx_test_null(ctx->loc_conf[ngx_modules[i]->index],
|
ngx_test_null(ctx->loc_conf[module->index],
|
||||||
module->create_loc_conf(cf->pool),
|
module->create_loc_conf(cf->pool),
|
||||||
NGX_CONF_ERROR);
|
NGX_CONF_ERROR);
|
||||||
}
|
}
|
||||||
|
@ -674,8 +674,6 @@ static char *ngx_server_block(ngx_conf_t *cf, ngx_command_t *cmd, char *dummy)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_log_debug(cf->pool->log, "main merge");
|
|
||||||
|
|
||||||
if (module->merge_loc_conf) {
|
if (module->merge_loc_conf) {
|
||||||
if (module->merge_loc_conf(cf->pool,
|
if (module->merge_loc_conf(cf->pool,
|
||||||
prev->loc_conf[module->index],
|
prev->loc_conf[module->index],
|
||||||
@ -684,8 +682,6 @@ ngx_log_debug(cf->pool->log, "main merge");
|
|||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_log_debug(cf->pool->log, "server merge");
|
|
||||||
|
|
||||||
for (j = 0; j < scf->locations.nelts; j++) {
|
for (j = 0; j < scf->locations.nelts; j++) {
|
||||||
if (module->merge_loc_conf(cf->pool,
|
if (module->merge_loc_conf(cf->pool,
|
||||||
ctx->loc_conf[module->index],
|
ctx->loc_conf[module->index],
|
||||||
@ -694,7 +690,6 @@ ngx_log_debug(cf->pool->log, "server merge");
|
|||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ngx_log_debug(cf->pool->log, "server merge done");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,8 +169,6 @@ static void *ngx_http_write_filter_create_conf(ngx_pool_t *pool)
|
|||||||
|
|
||||||
conf->buffer_output = NGX_CONF_UNSET;
|
conf->buffer_output = NGX_CONF_UNSET;
|
||||||
|
|
||||||
ngx_log_debug(pool->log, "write conf %08X %08X" _ conf _ conf->buffer_output);
|
|
||||||
|
|
||||||
return conf;
|
return conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,8 +183,6 @@ static char *ngx_http_write_filter_merge_conf(ngx_pool_t *pool,
|
|||||||
|
|
||||||
ngx_conf_size_merge(conf->buffer_output, prev->buffer_output, 1460);
|
ngx_conf_size_merge(conf->buffer_output, prev->buffer_output, 1460);
|
||||||
|
|
||||||
ngx_log_debug(pool->log, "write merge %08X %08X %08X" _ prev _ conf _ conf->buffer_output);
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user