Mercurial > hg > nginx
comparison src/http/ngx_http_event.c @ 20:a649c0a0adb3
nginx-0.0.1-2002-12-03-18:45:38 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 03 Dec 2002 15:45:38 +0000 |
parents | d7908993fdeb |
children | aa3b53e74728 |
comparison
equal
deleted
inserted
replaced
19:d7908993fdeb | 20:a649c0a0adb3 |
---|---|
268 rc = ngx_read_http_request_line(r); | 268 rc = ngx_read_http_request_line(r); |
269 | 269 |
270 c = r->connection; | 270 c = r->connection; |
271 | 271 |
272 if (rc == NGX_OK) { | 272 if (rc == NGX_OK) { |
273 ngx_test_null(r->uri, | 273 len = r->uri_end - r->uri_start + 1; |
274 ngx_palloc(r->pool, r->uri_end - r->uri_start + 1), | 274 ngx_test_null(r->uri, ngx_palloc(r->pool, len), |
275 ngx_http_close_request(r)); | 275 ngx_http_close_request(r)); |
276 ngx_cpystrn(r->uri, r->uri_start, r->uri_end - r->uri_start + 1); | 276 ngx_cpystrn(r->uri, r->uri_start, len); |
277 | 277 |
278 r->request_line.len = r->request_end - r->header_in->start; | |
279 ngx_test_null(r->request_line.data, | |
280 ngx_palloc(r->pool, r->request_line.len + 1), | |
281 ngx_http_close_request(r)); | |
282 ngx_cpystrn(r->request_line.data, r->header_in->start, | |
283 r->request_line.len + 1); | |
284 | |
285 /* TEMP */ | |
278 ngx_test_null(request, ngx_push_array(c->requests), | 286 ngx_test_null(request, ngx_push_array(c->requests), |
279 ngx_http_close_request(r)); | 287 ngx_http_close_request(r)); |
280 | 288 |
281 if (r->request_end) | 289 if (r->request_end) |
282 len = r->request_end - r->header_in->start + 1; | 290 len = r->request_end - r->header_in->start + 1; |
286 ngx_test_null(*request, ngx_palloc(c->pool, len), | 294 ngx_test_null(*request, ngx_palloc(c->pool, len), |
287 ngx_http_close_request(r)); | 295 ngx_http_close_request(r)); |
288 ngx_cpystrn(*request, r->header_in->start, len); | 296 ngx_cpystrn(*request, r->header_in->start, len); |
289 | 297 |
290 ngx_log_debug(c->log, "REQ: '%s'" _ *request); | 298 ngx_log_debug(c->log, "REQ: '%s'" _ *request); |
299 /* */ | |
291 | 300 |
292 if (r->uri_ext) { | 301 if (r->uri_ext) { |
293 ngx_test_null(r->exten, | 302 ngx_test_null(r->exten, |
294 ngx_palloc(r->pool, r->uri_end - r->uri_ext + 1), | 303 ngx_palloc(r->pool, r->uri_end - r->uri_ext + 1), |
295 ngx_http_close_request(r)); | 304 ngx_http_close_request(r)); |
370 static int ngx_http_process_request_header_line(ngx_http_request_t *r) | 379 static int ngx_http_process_request_header_line(ngx_http_request_t *r) |
371 { | 380 { |
372 int i; | 381 int i; |
373 ngx_table_elt_t *h; | 382 ngx_table_elt_t *h; |
374 | 383 |
375 ngx_test_null(h, ngx_push_array(r->headers_in.headers), NGX_ERROR); | 384 ngx_test_null(h, ngx_push_table(r->headers_in.headers), NGX_ERROR); |
376 | 385 |
377 h->key.len = r->header_name_end - r->header_name_start; | 386 h->key.len = r->header_name_end - r->header_name_start; |
378 ngx_test_null(h->key.data, ngx_palloc(r->pool, h->key.len + 1), NGX_ERROR); | 387 ngx_test_null(h->key.data, ngx_palloc(r->pool, h->key.len + 1), NGX_ERROR); |
379 ngx_cpystrn(h->key.data, r->header_name_start, h->key.len + 1); | 388 ngx_cpystrn(h->key.data, r->header_name_start, h->key.len + 1); |
380 | 389 |
581 static int ngx_http_set_default_handler(ngx_http_request_t *r) | 590 static int ngx_http_set_default_handler(ngx_http_request_t *r) |
582 { | 591 { |
583 int err, rc; | 592 int err, rc; |
584 char *name, *loc, *file; | 593 char *name, *loc, *file; |
585 | 594 |
586 #if 0 | 595 #if 1 |
587 /* STUB */ | 596 /* STUB */ |
588 r->handler = ngx_http_proxy_handler; | 597 r->handler = ngx_http_proxy_handler; |
589 return NGX_OK; | 598 return NGX_OK; |
590 #endif | 599 #endif |
591 | 600 |