Mercurial > hg > nginx
comparison src/http/modules/ngx_http_flv_module.c @ 2415:d311b7f6a403
ngx_http_arg()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 22 Dec 2008 12:02:05 +0000 |
parents | 8564129d49b6 |
children | aee735f41627 |
comparison
equal
deleted
inserted
replaced
2414:cc13ff6d5c07 | 2415:d311b7f6a403 |
---|---|
58 | 58 |
59 | 59 |
60 static ngx_int_t | 60 static ngx_int_t |
61 ngx_http_flv_handler(ngx_http_request_t *r) | 61 ngx_http_flv_handler(ngx_http_request_t *r) |
62 { | 62 { |
63 u_char *p, *n, *last; | 63 u_char *last; |
64 off_t start, len; | 64 off_t start, len; |
65 size_t root; | 65 size_t root; |
66 ngx_int_t rc; | 66 ngx_int_t rc; |
67 ngx_uint_t level, i; | 67 ngx_uint_t level, i; |
68 ngx_str_t path; | 68 ngx_str_t path, value; |
69 ngx_log_t *log; | 69 ngx_log_t *log; |
70 ngx_buf_t *b; | 70 ngx_buf_t *b; |
71 ngx_chain_t out[2]; | 71 ngx_chain_t out[2]; |
72 ngx_open_file_info_t of; | 72 ngx_open_file_info_t of; |
73 ngx_http_core_loc_conf_t *clcf; | 73 ngx_http_core_loc_conf_t *clcf; |
165 start = 0; | 165 start = 0; |
166 len = of.size; | 166 len = of.size; |
167 i = 1; | 167 i = 1; |
168 | 168 |
169 if (r->args.len) { | 169 if (r->args.len) { |
170 p = (u_char *) ngx_strnstr(r->args.data, "start=", r->args.len); | 170 |
171 | 171 if (ngx_http_arg(r, (u_char *) "start", 5, &value) == NGX_OK) { |
172 if (p) { | 172 |
173 p += 6; | 173 start = ngx_atoof(value.data, value.len); |
174 | |
175 for (n = p; n < r->args.data + r->args.len; n++) { | |
176 if (*n == '&') { | |
177 break; | |
178 } | |
179 } | |
180 | |
181 start = ngx_atoof(p, n - p); | |
182 | 174 |
183 if (start == NGX_ERROR || start >= len) { | 175 if (start == NGX_ERROR || start >= len) { |
184 start = 0; | 176 start = 0; |
185 } | 177 } |
186 | 178 |