comparison src/http/ngx_http_script.h @ 507:cd3117ad9aab release-0.1.28

nginx-0.1.28-RELEASE import *) Bugfix: nginx hogs CPU while proxying the huge files. *) Bugfix: nginx could not be built by gcc 4.0 on Linux.
author Igor Sysoev <igor@sysoev.ru>
date Fri, 08 Apr 2005 15:18:55 +0000
parents c52408583801
children 9b8c906f6e63
comparison
equal deleted inserted replaced
506:005e65646622 507:cd3117ad9aab
11 #include <ngx_config.h> 11 #include <ngx_config.h>
12 #include <ngx_core.h> 12 #include <ngx_core.h>
13 #include <ngx_http.h> 13 #include <ngx_http.h>
14 14
15 15
16 typedef u_char *(*ngx_http_script_code_pt) (ngx_http_request_t *r, 16 typedef struct {
17 u_char *buf, void *data); 17 u_char *ip;
18 u_char *pos;
19 ngx_http_request_t *request;
20 } ngx_http_script_lite_engine_t;
18 21
19 typedef struct ngx_http_script_code_s { 22
20 size_t data_len; 23 typedef struct {
21 size_t code_len; 24 ngx_http_script_lite_engine_t lite;
22 ngx_http_script_code_pt code; 25 } ngx_http_script_engine_t;
23 } ngx_http_script_code_t; 26
27
28 typedef void (*ngx_http_script_code_pt) (ngx_http_script_engine_t *e);
29 typedef size_t (*ngx_http_script_len_code_pt)
30 (ngx_http_script_lite_engine_t *e);
31
32 typedef ngx_int_t (*ngx_http_script_compile_lite_start_pt) (ngx_table_elt_t *h,
33 ngx_array_t *lengths, ngx_array_t *values, ngx_uint_t value);
34 typedef ngx_int_t (*ngx_http_script_compile_lite_end_pt) (ngx_array_t *lengths,
35 ngx_array_t *values);
36
37
38 typedef struct {
39 ngx_http_script_code_pt code;
40 uintptr_t len;
41 } ngx_http_script_copy_code_t;
42
43
44 typedef struct {
45 ngx_http_script_code_pt code;
46 uintptr_t index;
47 } ngx_http_script_var_code_t;
48
49
50 ngx_int_t ngx_http_script_compile_lite(ngx_conf_t *cf, ngx_array_t *sources,
51 ngx_array_t **lengths, ngx_array_t **values,
52 ngx_http_script_compile_lite_start_pt start,
53 ngx_http_script_compile_lite_end_pt end);
54
55
56 static void *ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes,
57 size_t size);
58
59 size_t ngx_http_script_copy_len(ngx_http_script_engine_t *e);
60 void ngx_http_script_copy(ngx_http_script_engine_t *e);
61 size_t ngx_http_script_copy_var_len(ngx_http_script_engine_t *e);
62 void ngx_http_script_copy_var(ngx_http_script_engine_t *e);
63
24 64
25 65
26 #endif /* _NGX_HTTP_SCRIPT_H_INCLUDED_ */ 66 #endif /* _NGX_HTTP_SCRIPT_H_INCLUDED_ */