]> git.kaiwu.me - nginx.git/commitdiff
*) copy regex captures $1, $2, etc.
authorIgor Sysoev <igor@sysoev.ru>
Sun, 9 Dec 2007 20:52:14 +0000 (20:52 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sun, 9 Dec 2007 20:52:14 +0000 (20:52 +0000)
*) SV flags debug logging

src/http/modules/perl/nginx.xs

index 65ec69c16543f73f5340e75d8ebd1ecf97ca169b..45b03ef3ced292832720e8bbbc38f4258353ffab 100644 (file)
@@ -42,8 +42,12 @@ ngx_http_perl_sv2str(pTHX_ ngx_http_request_t *r, ngx_str_t *s, SV *sv)
 
     s->len = len;
 
-    if (SvREADONLY(sv)) {
+    if (SvREADONLY(sv) && SvPOK(sv)) {
         s->data = p;
+
+        ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                       "perl sv2str: %08XD \"%V\"", sv->sv_flags, s);
+
         return NGX_OK;
     }
 
@@ -54,6 +58,9 @@ ngx_http_perl_sv2str(pTHX_ ngx_http_request_t *r, ngx_str_t *s, SV *sv)
 
     ngx_memcpy(s->data, p, len);
 
+    ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                   "perl sv2str: %08XD \"%V\"", sv->sv_flags, s);
+
     return NGX_OK;
 }
 
@@ -532,7 +539,7 @@ print(r, ...)
             sv = SvRV(sv);
         }
 
-        if (SvREADONLY(sv)) {
+        if (SvREADONLY(sv) && SvPOK(sv)) {
 
             p = (u_char *) SvPV(sv, len);