Dear Alexey,

Glad the problem is resolved. i commited a slightly
modified version of the patch (moved the static definition
to the right place in the file, made sure that year is always
4 digits) to CVS head on sourceforge. The patch makes
perfectly sense for non en* locale settings.

It would have saved all of us time if you would have
told us earlier that you are using a patched version.
I have checked the debian patches, there are no
other .c or .h files in the change set, so hopefully
this source of confusion is closed.

Many thanks for your help.

best regards
-gustaf neumann

PS: Tom, can you commit your improvements to queue.c
as well to cvs head?

Alexey Pechnikov schrieb:
Hello!

I'm sorry but the problem is produced by patch for non-english locale. This patch use wrong format string:
snprintf(buf, 40, "%s, %d %s %d %02d:%02d:%02d GMT",

I did fix the bug and I'm think this patch may be added to upstream.

Patch is here:
http://mobigroup.ru/files/aol4.5.1/httptime.c.diff

Thanks for help!

=====================
--- httptime.c.orig     2003-01-18 22:24:20.000000000 +0300
+++ httptime.c  2009-05-12 20:14:24.000000000 +0400
@@ -27,6 +27,9 @@
  * version of this file under either the License or the GPL.
  */

+static char *weekdays_names[7] =
+{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
+

 /*
  * time.c --
@@ -92,11 +95,14 @@
     }

     /*
-     * This will most likely break if the locale is not an english one.
+     * Using snprintf instead of strftime to always use english names
      * The format is RFC 1123: "Sun, 06 Nov 1997 09:12:45 GMT"
      */

-    strftime(buf, 40, "%a, %d %b %Y %H:%M:%S GMT", tmPtr);
+    snprintf(buf, 40, "%s, %02d %s %d %02d:%02d:%02d GMT",
+    weekdays_names[tmPtr->tm_wday], tmPtr->tm_mday,
+    month_names[tmPtr->tm_mon], tmPtr->tm_year + 1900,
+    tmPtr->tm_hour, tmPtr->tm_min, tmPtr->tm_sec);

     Ns_DStringAppend(pds, buf);
     return pds->string;


Best regards, Alexey Pechnikov.
http://pechnikov.tel/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to