]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2564: logformat '%tl' field not working as advertised
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 17 Jan 2009 01:31:49 +0000 (14:31 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 17 Jan 2009 01:31:49 +0000 (14:31 +1300)
src/access_log.cc

index cf3901402adf5dbee5b5ea29b4e7fe0fdf74d77c..c56b0896eb7abc9a5ba6261f3ae0a8670fd91127 100644 (file)
@@ -604,23 +604,22 @@ accessLogCustom(AccessLogEntry * al, customlog * log)
 
         case LFT_TIME_GMT: {
                 const char *spec;
-
                 struct tm *t;
                 spec = fmt->data.timespec;
 
-                if (!spec)
-                    spec = "%d/%b/%Y:%H:%M:%S";
-
-                if (fmt->type == LFT_TIME_LOCALTIME)
+                if (fmt->type == LFT_TIME_LOCALTIME) {
+                    if (!spec)
+                        spec = "%d/%b/%Y:%H:%M:%S %z";
                     t = localtime(&squid_curtime);
-                else
+                } else {
+                    if (!spec)
+                        spec = "%d/%b/%Y:%H:%M:%S";
                     t = gmtime(&squid_curtime);
+                }
 
                 strftime(tmp, sizeof(tmp), spec, t);
-
                 out = tmp;
             }
-
             break;
 
         case LFT_TIME_TO_HANDLE_REQUEST: