fixed evaluation variable at the end of string

This commit is contained in:
Roman Arutyunyan 2012-09-13 15:20:14 +04:00
parent e1650d8629
commit 8494e179d1
3 changed files with 8 additions and 7 deletions

View file

@ -142,7 +142,7 @@ ngx_module_t ngx_rtmp_enotify_module = {
static void
ngx_rtmp_enotify_eval_cstr(ngx_rtmp_session_t *s, ngx_rtmp_eval_t *e,
ngx_rtmp_enotify_eval_astr(ngx_rtmp_session_t *s, ngx_rtmp_eval_t *e,
ngx_str_t *ret)
{
ngx_rtmp_enotify_ctx_t *ctx;
@ -153,7 +153,7 @@ ngx_rtmp_enotify_eval_cstr(ngx_rtmp_session_t *s, ngx_rtmp_eval_t *e,
return;
}
ret->data = *(u_char **) ((u_char *) ctx + e->offset);
ret->data = (u_char *) ctx + e->offset;
ret->len = ngx_strlen(ret->data);
}
@ -177,11 +177,11 @@ ngx_rtmp_enotify_eval_str(ngx_rtmp_session_t *s, ngx_rtmp_eval_t *e,
static ngx_rtmp_eval_t ngx_rtmp_enotify_eval[] = {
{ ngx_string("name"),
ngx_rtmp_enotify_eval_cstr,
ngx_rtmp_enotify_eval_astr,
offsetof(ngx_rtmp_enotify_ctx_t, name) },
{ ngx_string("args"),
ngx_rtmp_enotify_eval_cstr,
ngx_rtmp_enotify_eval_astr,
offsetof(ngx_rtmp_enotify_ctx_t, args) },
{ ngx_string("path"),

View file

@ -173,6 +173,7 @@ ngx_rtmp_eval(ngx_rtmp_session_t *s, ngx_str_t *in, ngx_rtmp_eval_t **e,
}
if (state == NAME) {
p = &in->data[n];
name.len = p - name.data;
ngx_rtmp_eval_append_var(s, &b, e, &name);
}

View file

@ -123,7 +123,7 @@ ngx_module_t ngx_rtmp_exec_module = {
static void
ngx_rtmp_exec_eval_cstr(ngx_rtmp_session_t *s, ngx_rtmp_eval_t *e,
ngx_rtmp_exec_eval_astr(ngx_rtmp_session_t *s, ngx_rtmp_eval_t *e,
ngx_str_t *ret)
{
ngx_rtmp_exec_ctx_t *ctx;
@ -134,7 +134,7 @@ ngx_rtmp_exec_eval_cstr(ngx_rtmp_session_t *s, ngx_rtmp_eval_t *e,
return;
}
ret->data = *(u_char **) ((u_char *) ctx + e->offset);
ret->data = (u_char *) ctx + e->offset;
ret->len = ngx_strlen(ret->data);
}
@ -142,7 +142,7 @@ ngx_rtmp_exec_eval_cstr(ngx_rtmp_session_t *s, ngx_rtmp_eval_t *e,
static ngx_rtmp_eval_t ngx_rtmp_exec_eval[] = {
{ ngx_string("name"),
ngx_rtmp_exec_eval_cstr,
ngx_rtmp_exec_eval_astr,
offsetof(ngx_rtmp_exec_ctx_t, name) },
ngx_rtmp_null_eval