]> err.no Git - varnish/commitdiff
Fixed timestamp so thats it's correct. PHK added a new variable to ReqEnd that contai...
authorandersb <andersb@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 13 Sep 2006 21:26:01 +0000 (21:26 +0000)
committerandersb <andersb@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 13 Sep 2006 21:26:01 +0000 (21:26 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@980 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishncsa/varnishncsa.c

index fccc6362df897f5ca666b8434c8f773db6c3dbaa..6787c32a27d0947f03f7213ffdf2bae009e77697 100644 (file)
@@ -82,7 +82,7 @@ clean_order(void)
        }
 }
 
-static struct tm *make_timestring(char *tmpPtra){
+static struct tm *make_timestruct(char *tmpPtra){
        char *tmpPtrb;
        int timesec = 0;
        time_t req_time; // Timeobject used for making the requesttime.
@@ -92,17 +92,19 @@ static struct tm *make_timestring(char *tmpPtra){
 
        temp_time[0] = '\0';
        for ( tmpPtrb = strtok(tmpPtra," "); tmpPtrb != NULL; tmpPtrb = strtok(NULL, " ")){
-               if (i == 1){
+               if (i == 2){
                        // We have the right time
                        //printf("Time: %s\n", tmpPtrb);
                        tmpPtra = tmpPtrb;
+                       strncpy(temp_time, tmpPtra, 10);
+                       temp_time[11] = '\0';
                }
                //printf("ReqServTime number %d: %s\n", i, tmpPtrb);
        
                 i++;
          }
-       strncpy(temp_time, tmpPtra, 10);
-       temp_time[10] = '\0';
+
+       //strncpy(temp_time, tmpPtra, 20);
        //printf("inten: %s\n",temp_time);
        timesec = atoi(temp_time);
        req_time = timesec;
@@ -229,7 +231,7 @@ extended_log_format(unsigned char *p)
                // We use ReqServTime to find how the time the request was delivered
                // also to define that a request is finished.
                tmpPtra =  strdup(p + 4);
-               ll[u].logline_time = make_timestring(tmpPtra);
+               ll[u].logline_time = make_timestruct(tmpPtra);
                free(tmpPtra);
                ll[u].df_rfini = 1;
                //printf("ReqServTime %s\n", temp_time);
@@ -301,7 +303,7 @@ extended_log_format(unsigned char *p)
                char temp_time[27]; // Where we store the string we take from the log
 
                // make temp_time
-               strftime (temp_time, 28, "[%d/%b/%Y:%X %z] ", ll[u].logline_time);
+               strftime (temp_time, 29, "[%d/%b/%Y:%X %z] ", ll[u].logline_time);
 
                if (ll[u].df_h[0] == '\0' || ll[u].bogus_req){
                        ll[u].bogus_req = 0;