18 messages in ru.sysoev.nginxRe: Possible rewrite regular expressi...
FromSent OnAttachments
Peter HoangJun 23, 2008 2:33 am 
RoxisJun 23, 2008 2:44 am 
Peter HoangJun 23, 2008 6:01 am 
Peter HoangJun 23, 2008 7:43 am 
Igor SysoevJun 23, 2008 7:55 am 
RoxisJun 23, 2008 7:56 am 
Peter HoangJun 23, 2008 8:01 am 
Peter HoangJun 24, 2008 8:47 am 
Igor SysoevJun 24, 2008 8:54 am 
Peter HoangJun 24, 2008 9:03 am 
Peter HoangJun 24, 2008 9:43 am 
Igor SysoevJun 24, 2008 11:01 am 
Igor SysoevJun 24, 2008 11:02 am 
Peter HoangJun 24, 2008 6:09 pm 
Peter HoangJun 24, 2008 10:01 pm 
Peter HoangJun 25, 2008 1:12 am 
Peter HoangJun 25, 2008 11:56 am 
Michal MachJul 23, 2009 4:13 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Possible rewrite regular expression bug?Actions...
From:Peter Hoang (list@public.gmane.org)
Date:Jun 25, 2008 11:56:40 am
List:ru.sysoev.nginx

The escape_uri function is called in 3 different places in ngx_http_script.c:

1) size_t ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e) 2) void ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e) 3) void ngx_http_script_regex_start_code(ngx_http_script_engine_t *e)

If I were to add "ne" flag as following:

rewrite ^/search /search/q-$q.html last ne;

I could do check for ngx_strcmp(value[4].data, "ne") == 0 in ngx_http_rewrite and store the flag somewhere. My question is, how do we store this flag so that we can retrieve it in 3 above functions? Can I just create an additional flag in ngx_http_script_engine_t to do this?

As for the redirect decoding, what is the effect of commenting the following line in ngx_http_script.c:

/* ngx_unescape_uri(&dst, &src, e->pos - e->buf.data, NGX_UNESCAPE_REDIRECT); */

Thanks in advance.

Cheers, Peter