[Reconnoiter-devel] [reconnoiter commit] r1281 - trunk/src

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Fri May 7 10:05:44 EDT 2010


Author: jesus
Date: 2010-05-07 10:05:44 -0400 (Fri, 07 May 2010)
New Revision: 1281

Modified:
   trunk/src/noit_http.c
   trunk/src/noit_http.h
Log:
always process the querystring after finalizing the request, fixes #274

Modified: trunk/src/noit_http.c
===================================================================
--- trunk/src/noit_http.c	2010-05-06 21:49:40 UTC (rev 1280)
+++ trunk/src/noit_http.c	2010-05-07 14:05:44 UTC (rev 1281)
@@ -215,9 +215,11 @@
   sub_timeval(end_time, ctx->req.start_time, &diff);
   time_ms = diff.tv_sec * 1000 + diff.tv_usec / 1000;
   noit_convert_sockaddr_to_buff(ip, sizeof(ip), &ctx->ac->remote.remote_addr);
-  noitL(http_access, "%s - - [%s] \"%s %s %s\" %d %llu %.3f\n",
+  noitL(http_access, "%s - - [%s] \"%s %s%s%s %s\" %d %llu %.3f\n",
         ip, timestr,
-        ctx->req.method_str, ctx->req.uri_str, ctx->req.protocol_str,
+        ctx->req.method_str, ctx->req.uri_str,
+        ctx->req.orig_qs ? "?" : "", ctx->req.orig_qs ? ctx->req.orig_qs : "",
+        ctx->req.protocol_str,
         ctx->res.status_code,
         (long long unsigned)ctx->res.bytes_written,
         time_ms);
@@ -452,6 +454,7 @@
   cp = strchr(req->uri_str, '?');
   if(!cp) return;
   *cp++ = '\0';
+  req->orig_qs = strdup(cp);
   for (interest = strtok_r(cp, "&", &brk);
        interest;
        interest = strtok_r(NULL, "&", &brk)) {
@@ -571,6 +574,7 @@
     ctx->drainage -= drained;
   }
   RELEASE_BCHAIN(ctx->req.current_request_chain);
+  if(ctx->req.orig_qs) free(ctx->req.orig_qs);
   memset(&ctx->req, 0, sizeof(ctx->req));
 }
 void
@@ -705,6 +709,7 @@
       return mask | maybe_write_mask;
     }
     noitL(http_debug, "HTTP start request (%s)\n", ctx->req.uri_str);
+    noit_http_process_querystring(&ctx->req);
   }
 
   /* only dispatch if the response is not complete */

Modified: trunk/src/noit_http.h
===================================================================
--- trunk/src/noit_http.h	2010-05-06 21:49:40 UTC (rev 1280)
+++ trunk/src/noit_http.h	2010-05-07 14:05:44 UTC (rev 1281)
@@ -97,6 +97,7 @@
   noit_hash_table headers;
   noit_boolean complete;
   struct timeval start_time;
+  char *orig_qs;
 } noit_http_request;
 
 typedef struct {



More information about the Reconnoiter-devel mailing list