Commit 6077df9b authored by Anders Berg's avatar Anders Berg

Fixed timestamp so thats it's correct. PHK added a new variable to ReqEnd that...

Fixed timestamp so thats it's correct. PHK added a new variable to ReqEnd that contains a correct endtime.



git-svn-id: http://www.varnish-cache.org/svn/trunk@980 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 768103c1
...@@ -82,7 +82,7 @@ clean_order(void) ...@@ -82,7 +82,7 @@ clean_order(void)
} }
} }
static struct tm *make_timestring(char *tmpPtra){ static struct tm *make_timestruct(char *tmpPtra){
char *tmpPtrb; char *tmpPtrb;
int timesec = 0; int timesec = 0;
time_t req_time; // Timeobject used for making the requesttime. time_t req_time; // Timeobject used for making the requesttime.
...@@ -92,17 +92,19 @@ static struct tm *make_timestring(char *tmpPtra){ ...@@ -92,17 +92,19 @@ static struct tm *make_timestring(char *tmpPtra){
temp_time[0] = '\0'; temp_time[0] = '\0';
for ( tmpPtrb = strtok(tmpPtra," "); tmpPtrb != NULL; tmpPtrb = strtok(NULL, " ")){ for ( tmpPtrb = strtok(tmpPtra," "); tmpPtrb != NULL; tmpPtrb = strtok(NULL, " ")){
if (i == 1){ if (i == 2){
// We have the right time // We have the right time
//printf("Time: %s\n", tmpPtrb); //printf("Time: %s\n", tmpPtrb);
tmpPtra = tmpPtrb; tmpPtra = tmpPtrb;
strncpy(temp_time, tmpPtra, 10);
temp_time[11] = '\0';
} }
//printf("ReqServTime number %d: %s\n", i, tmpPtrb); //printf("ReqServTime number %d: %s\n", i, tmpPtrb);
i++; i++;
} }
strncpy(temp_time, tmpPtra, 10);
temp_time[10] = '\0'; //strncpy(temp_time, tmpPtra, 20);
//printf("inten: %s\n",temp_time); //printf("inten: %s\n",temp_time);
timesec = atoi(temp_time); timesec = atoi(temp_time);
req_time = timesec; req_time = timesec;
...@@ -229,7 +231,7 @@ extended_log_format(unsigned char *p) ...@@ -229,7 +231,7 @@ extended_log_format(unsigned char *p)
// We use ReqServTime to find how the time the request was delivered // We use ReqServTime to find how the time the request was delivered
// also to define that a request is finished. // also to define that a request is finished.
tmpPtra = strdup(p + 4); tmpPtra = strdup(p + 4);
ll[u].logline_time = make_timestring(tmpPtra); ll[u].logline_time = make_timestruct(tmpPtra);
free(tmpPtra); free(tmpPtra);
ll[u].df_rfini = 1; ll[u].df_rfini = 1;
//printf("ReqServTime %s\n", temp_time); //printf("ReqServTime %s\n", temp_time);
...@@ -301,7 +303,7 @@ extended_log_format(unsigned char *p) ...@@ -301,7 +303,7 @@ extended_log_format(unsigned char *p)
char temp_time[27]; // Where we store the string we take from the log char temp_time[27]; // Where we store the string we take from the log
// make temp_time // 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){ if (ll[u].df_h[0] == '\0' || ll[u].bogus_req){
ll[u].bogus_req = 0; ll[u].bogus_req = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment