diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2008-12-22 12:02:05 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2008-12-22 12:02:05 +0000 |
| commit | 84d17bba650167380268ee0f86c6789a04a02426 (patch) | |
| tree | 13b6bf1466ef1ac3112c2a4d028d34c31385eaac /src/http/modules/ngx_http_flv_module.c | |
| parent | ed9b6d8962c6b7cf0546d0b2d69f34c879395757 (diff) | |
| download | nginx-84d17bba650167380268ee0f86c6789a04a02426.tar.gz nginx-84d17bba650167380268ee0f86c6789a04a02426.tar.bz2 | |
ngx_http_arg()
Diffstat (limited to 'src/http/modules/ngx_http_flv_module.c')
| -rw-r--r-- | src/http/modules/ngx_http_flv_module.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/http/modules/ngx_http_flv_module.c b/src/http/modules/ngx_http_flv_module.c index 3cc7d8176..2197b6c32 100644 --- a/src/http/modules/ngx_http_flv_module.c +++ b/src/http/modules/ngx_http_flv_module.c @@ -60,12 +60,12 @@ ngx_module_t ngx_http_flv_module = { static ngx_int_t ngx_http_flv_handler(ngx_http_request_t *r) { - u_char *p, *n, *last; + u_char *last; off_t start, len; size_t root; ngx_int_t rc; ngx_uint_t level, i; - ngx_str_t path; + ngx_str_t path, value; ngx_log_t *log; ngx_buf_t *b; ngx_chain_t out[2]; @@ -167,18 +167,10 @@ ngx_http_flv_handler(ngx_http_request_t *r) i = 1; if (r->args.len) { - p = (u_char *) ngx_strnstr(r->args.data, "start=", r->args.len); - if (p) { - p += 6; + if (ngx_http_arg(r, (u_char *) "start", 5, &value) == NGX_OK) { - for (n = p; n < r->args.data + r->args.len; n++) { - if (*n == '&') { - break; - } - } - - start = ngx_atoof(p, n - p); + start = ngx_atoof(value.data, value.len); if (start == NGX_ERROR || start >= len) { start = 0; |
