Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 557:ecd9c160f25b release-0.3.0
nginx-0.3.0-RELEASE import
*) Change: the 10-days live time limit of worker process was
eliminated. The limit was introduced because of millisecond timers
overflow.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 07 Oct 2005 13:30:52 +0000 |
parents | 7bd37aef1e7e |
children | 9c2f3ed7a247 |
comparison
equal
deleted
inserted
replaced
556:21a706ff4e1f | 557:ecd9c160f25b |
---|---|
909 return NGX_OK; | 909 return NGX_OK; |
910 } | 910 } |
911 | 911 |
912 | 912 |
913 ngx_int_t | 913 ngx_int_t |
914 ngx_http_send_header(ngx_http_request_t *r) | |
915 { | |
916 if (r->err_status) { | |
917 r->headers_out.status = r->err_status; | |
918 r->headers_out.status_line.len = 0; | |
919 } | |
920 | |
921 return ngx_http_top_header_filter(r); | |
922 } | |
923 | |
924 | |
925 ngx_int_t | |
926 ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *in) | |
927 { | |
928 ngx_int_t rc; | |
929 | |
930 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
931 "http output filter \"%V\"", &r->uri); | |
932 | |
933 rc = ngx_http_top_body_filter(r, in); | |
934 | |
935 if (rc == NGX_ERROR) { | |
936 /* NGX_ERROR may be returned by any filter */ | |
937 r->connection->closed = 1; | |
938 } | |
939 | |
940 return rc; | |
941 } | |
942 | |
943 | |
944 ngx_int_t | |
945 ngx_http_set_exten(ngx_http_request_t *r) | 914 ngx_http_set_exten(ngx_http_request_t *r) |
946 { | 915 { |
947 ngx_int_t i; | 916 ngx_int_t i; |
948 | 917 |
949 r->exten.len = 0; | 918 r->exten.len = 0; |
971 } | 940 } |
972 | 941 |
973 r->low_case_exten = 0; | 942 r->low_case_exten = 0; |
974 | 943 |
975 return NGX_OK; | 944 return NGX_OK; |
945 } | |
946 | |
947 | |
948 ngx_int_t | |
949 ngx_http_send_header(ngx_http_request_t *r) | |
950 { | |
951 if (r->err_status) { | |
952 r->headers_out.status = r->err_status; | |
953 r->headers_out.status_line.len = 0; | |
954 } | |
955 | |
956 return ngx_http_top_header_filter(r); | |
957 } | |
958 | |
959 | |
960 ngx_int_t | |
961 ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *in) | |
962 { | |
963 ngx_int_t rc; | |
964 | |
965 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
966 "http output filter \"%V\"", &r->uri); | |
967 | |
968 rc = ngx_http_top_body_filter(r, in); | |
969 | |
970 if (rc == NGX_ERROR) { | |
971 /* NGX_ERROR may be returned by any filter */ | |
972 r->connection->closed = 1; | |
973 } | |
974 | |
975 return rc; | |
976 } | |
977 | |
978 | |
979 u_char * | |
980 ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path, | |
981 size_t reserved) | |
982 { | |
983 u_char *last; | |
984 size_t alias; | |
985 ngx_http_core_loc_conf_t *clcf; | |
986 | |
987 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | |
988 | |
989 alias = clcf->alias ? clcf->name.len : 0; | |
990 | |
991 path->len = clcf->root.len + r->uri.len - alias + 1 + reserved; | |
992 | |
993 path->data = ngx_palloc(r->pool, path->len); | |
994 if (path->data == NULL) { | |
995 return NULL; | |
996 } | |
997 | |
998 last = ngx_cpymem(path->data, clcf->root.data, clcf->root.len); | |
999 last = ngx_cpystrn(last, r->uri.data + alias, r->uri.len - alias + 1); | |
1000 | |
1001 return last; | |
976 } | 1002 } |
977 | 1003 |
978 | 1004 |
979 ngx_int_t | 1005 ngx_int_t |
980 ngx_http_auth_basic_user(ngx_http_request_t *r) | 1006 ngx_http_auth_basic_user(ngx_http_request_t *r) |