Mercurial > hg > nginx
comparison src/http/ngx_http_script.c @ 99:a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 02 Jun 2003 15:24:30 +0000 |
parents | |
children | da8c5707af39 |
comparison
equal
deleted
inserted
replaced
98:c9b243802a17 | 99:a059e1aa65d4 |
---|---|
1 | |
2 #include <ngx_config.h> | |
3 #include <ngx_core.h> | |
4 #include <ngx_http.h> | |
5 | |
6 | |
7 char *ngx_http_script_copy(ngx_http_request_t *r, | |
8 ngx_http_script_code_t *code, | |
9 char *p, size_t len) | |
10 { | |
11 return ngx_cpymem(p, code->offset, code->len < len ? code->len : len); | |
12 } | |
13 | |
14 | |
15 char *ngx_http_script_header_in(ngx_http_request_t *r, | |
16 ngx_http_script_code_t *code, | |
17 char *p, size_t len) | |
18 { | |
19 ngx_str_t *s; | |
20 | |
21 s = (ngx_str_t *) (((char *) r->headers_in) + code->offset); | |
22 | |
23 return ngx_cpymem(p, s->data, s->len < len ? s->len : len); | |
24 } | |
25 | |
26 | |
27 /* the log script codes */ | |
28 | |
29 char *ngx_http_script_request_line(ngx_http_request_t *r, char *p, size_t len) | |
30 { | |
31 return ngx_cpymem(p, r->request_line.data, | |
32 r->request_line.len < len ? r->request_line.len : len); | |
33 } | |
34 | |
35 | |
36 char *ngx_http_script_status(ngx_http_request_t *r, char *p, size_t len) | |
37 { | |
38 p += ngx_snprintf(p, len, "%d", r->headers_out.status); | |
39 | |
40 return p; | |
41 } | |
42 | |
43 | |
44 char *ngx_http_script_sent(ngx_http_request_t *r, char *p, size_t len) | |
45 { | |
46 p += ngx_snprintf(p, len, OFF_FMT, r->connection->sent); | |
47 | |
48 return p; | |
49 } |