Commit ad82113e authored by Anders Berg's avatar Anders Berg

Cleaned up User-Agent and Referer. Both should now work correct. As far as I...

Cleaned up User-Agent and Referer. Both should now work correct. As far as I can see, I only have the timestamp left for a sane loggline.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@958 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent bf34c757
......@@ -200,12 +200,17 @@ extended_log_format(unsigned char *p, char *w_opt)
// printf("Lengde: %d\n", w);
ll[u].df_U = strdup(p + 4);
//strchr(ll[u].df_U, ':');
// Jump ahead past "User-Agent: "
ll[u].df_U = ll[u].df_U + 12;
ll[u].df_Ufini = 1;
}
/*
if (p[1] >= 8 && !strncasecmp((void *)&p[4], "referer:",8)){
ll[u].df_R = strdup(p + 4);
ll[u].df_R = ll[u].df_R + 9;
ll[u].df_Rfini = 1;
}
/*
else if (ll[u].df_R == NULL){
ll[u].df_R = strdup(p + 4);
ll[u].df_R[0] = '-';
......@@ -322,7 +327,14 @@ extended_log_format(unsigned char *p, char *w_opt)
printf("[%d] %s - - %s ", u, ll[u].df_h, temp_time );
vsb_finish(ob[u]);
printf("\"%s\"", vsb_data(ob[u]));
printf(" %s %s \"%s\"", ll[u].df_s, ll[u].df_b, ll[u].df_R);
printf(" %s %s ", ll[u].df_s, ll[u].df_b, ll[u].df_R);
if (ll[u].df_Rfini){
printf(" \"%s\" ", ll[u].df_R);
}
else {
printf(" \"-\" ");
}
if (ll[u].df_Ufini){
printf(" \"%s\" ", ll[u].df_U);
}
......@@ -359,6 +371,7 @@ extended_log_format(unsigned char *p, char *w_opt)
// Clean User-Agent and Referer
if (ll[u].df_Ufini){
ll[u].df_U = ll[u].df_U - 12;
free(ll[u].df_U);
ll[u].df_Ufini = 0;
ll[u].df_UN[0] = '\0';
......@@ -368,8 +381,11 @@ extended_log_format(unsigned char *p, char *w_opt)
//printf("Jalla: %d\n", jalla);
}
if (ll[u].df_R != NULL){
if (ll[u].df_Rfini){
ll[u].df_R = ll[u].df_R - 9;
free(ll[u].df_R);
ll[u].df_R[0] = '\0';
ll[u].df_Rfini = 0;
//printf("Freed df_R [%d]\n", u);
jalla = strlen(ll[u].df_R);
//printf("Jalla: %d\n", jalla);
......
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