Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1 [solved]

2009-05-13 Thread Alexey Pechnikov
Hello! On Wednesday 13 May 2009 03:03:07 Tom Jackson wrote: You include the buggy snprintf line above, but this isn't in the patch. Debian package has _wrong_ locale-dependence fixing patch: = --- aolserver4-4.5.1.orig/nsd/httptime.c +++

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1

2009-05-12 Thread Alexey Pechnikov
Hello! On Tuesday 12 May 2009 12:51:02 Gustaf Neumann wrote: Very wierd. So, the behavior must be influenced by the environment. What is the output, if you call time-format from aolserver (via exec) (this way, the external program runs with the same set of environment variables as the

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1

2009-05-12 Thread Gustaf Neumann
Mr Spock would say: fascinating. We know at least, that the environment is indeed not the problem. Can you check, whether both programs use the same strftime function? such as: $ nm time-format| fgrep strftime U strftime@@GLIBC_2.2.5 $ nm

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1

2009-05-12 Thread Alexey Pechnikov
Hello! On Tuesday 12 May 2009 17:29:38 Gustaf Neumann wrote: Mr Spock would say: fascinating. We know at least, that the environment is indeed not the problem. Can you check, whether both programs use the same strftime function? such as: $ nm time-format| fgrep strftime

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1

2009-05-12 Thread Tom Jackson
Looking at the source for a strftime, I see only two possible problems: 1. The format passed to sprintf is wrong, or 2. the case 'd' branch could be missing the continue, so that case 'e' runs, and replaces the result of 'd': case 'd': pt = _conv(t-tm_mday, %02d, pt, ptlim);

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1 [solved]

2009-05-12 Thread Alexey Pechnikov
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:

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1 [solved]

2009-05-12 Thread Tom Jackson
Great! I was actually thinking that it would be much easier in this particular case to avoid strftime, since all of the variability in the format is removed. It is huge overkill, and obviously broken in non-english languages. tom jackson On Tue, 2009-05-12 at 20:36 +0400, Alexey Pechnikov

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1 [solved]

2009-05-12 Thread Tom Jackson
On Tue, 2009-05-12 at 20:36 +0400, Alexey Pechnikov wrote: 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

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1

2009-05-11 Thread Gustaf Neumann
Dear Alexey, From the output, i start to believe that the setting of LANG/LOCALE is not the problem, but i am getting the suspicion that there is a bug in the c-library of your operating system. What operating system do you use? Rationale: aolserver uses strftime(..., ..., ... %d ..., ...) to

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1

2009-05-11 Thread Tom Jackson
I also looked into this, I think Gustaf must be right. The reason is that the AOLserver C code passes in the format string, which is clearly correct. %d is the zero padded day number [01-31]. After the call, the modified buffer is sent back as-is, so the bug isn't in AOLserver. The good news, if

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1

2009-05-11 Thread Alexey Pechnikov
Hello! On Monday 11 May 2009 11:02:09 Gustaf Neumann wrote: What operating system do you use? My operation system is debian lenny. Best regards, Alexey Pechnikov. http://pechnikov.tel/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1

2009-05-11 Thread Gustaf Neumann
Alexey Pechnikov schrieb: My operation system is debian lenny. Indeed, very strange. To pin down the problem, compile the progam below and check the output. It should show the same bug on your system. I don't have a lenny system around to test, but at least in Ubuntu 8.0.4, everything

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1

2009-05-10 Thread Tom Jackson
On Sun, 2009-05-10 at 22:03 +0400, Alexey Pechnikov wrote: Hello! On Sunday 10 May 2009 21:15:03 Tom Jackson wrote: Alexey: you can use the nstclsh shell to test if changing the locale makes any difference (in same location as your nsd file): ./bin/nstclsh % set ::env(LANG)

Re: [AOLSERVER] Fwd: [AOLSERVER] ns_httptime format error in AOL 4.5.1

2009-05-10 Thread Alexey Pechnikov
Hello! On Sunday 10 May 2009 23:42:08 Tom Jackson wrote: I wonder if you have to set this before your start nstclsh? $ LANG=en_US.UTF-8 nstclsh % ns_httptime 0 Thu, 1 Jan 1970 00:00:00 GMT You might also see what my replacement proc produces, or just try in nstclsh: $ nstclsh % set seconds