You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Rainer Jung <ra...@kippdata.de> on 2007/04/01 19:35:03 UTC

Re: svn commit: r521417 - /tomcat/connectors/trunk/jk/native/common/jk_util.c

Hi Mladen,

I checked out jk trunk today and built mod_jk on XP pro using Visual
Studio .net against httpd 2.0.59, 2.2.4 and 1.3.37. The build worked
without problems.

I then made a little test using LogLevel debug without rotatelogs, so
logging directly to file and the resulting log file contained unix line
endings!

More precisely: this happened for 2.0.59 and 2.2.4.

For 1.3.37, mod_jk opened the log file, but all log output went directly
to STDOUT or STDERR and produced error log lines like:

[Sun Apr 01 18:58:22 2007] [error] mod_jk: jk_log_to_file [Sun Apr 01
18:58:22 2007] [4132:4580] [debug] ajp_init::jk_ajp_common.c (2137):
buffer size:      0\n failed

Could you check trunk in your build env? I could provide you my build
results and I could also check yours against my Apache/Win.

The reason why I don't simply assume my build is borked, is that I saw
the same unix line endings in some environment running the official
build download (before I introduced the patch).

I think we don't use stdio. APR has apr_file_open() which uses
CreateFile() and apr_file_write() which goes back to WriteFile() on Windows.

Regards,

Rainer

Mladen Turk schrieb:
> Rainer Jung wrote:
>> I think I added those after I was frustrated by a customer whose
>> mod_jk logs had all non-windows line endings. Sorry, I didn't really
>> test your change, but my experience questions this patch.
>>
> 
> With you patch the line endings were \r,\r,\n
> 
> 
>> Do we need to set text mode on the file? Will this work for direct
>> logs and piped logs?
>>
> 
> Text mode is default unless you open the file with "ab+"
> The "b" standing for binary.
> 
> Probably not. The logs will have \n line endings unless
> the log rotator itself mangles them.
> 
> Anyhow, either we can have binary files (using read/write)
> instead stdio for logs, and use platform specific lineends,
> or depend on the stdio provided ones.
> 
> Regards,
> Mladen.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r521417 - /tomcat/connectors/trunk/jk/native/common/jk_util.c

Posted by Henri Gomez <he...@gmail.com>.
jk2 was more than just APRised mod_jk.


2007/4/2, Mladen Turk <mt...@apache.org>:
> Henri Gomez wrote:
> > May be at some time in the future we should think about a mod_jk 2.x
> > requiring and using APR to remove all platform complexity :-)
> >
>
> Think we tried that with jk2 and failed.
>
> > Even on Apache 1.3 we could have jk bundled with APR statically
> >
>
> Don't think so.
>
> Regards,
> Mladen.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r521417 - /tomcat/connectors/trunk/jk/native/common/jk_util.c

Posted by Mladen Turk <mt...@apache.org>.
Henri Gomez wrote:
> May be at some time in the future we should think about a mod_jk 2.x
> requiring and using APR to remove all platform complexity :-)
>

Think we tried that with jk2 and failed.

> Even on Apache 1.3 we could have jk bundled with APR statically
> 

Don't think so.

Regards,
Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r521417 - /tomcat/connectors/trunk/jk/native/common/jk_util.c

Posted by Henri Gomez <he...@gmail.com>.
May be at some time in the future we should think about a mod_jk 2.x
requiring and using APR to remove all platform complexity :-)

Even on Apache 1.3 we could have jk bundled with APR statically



2007/4/2, Mladen Turk <mt...@apache.org>:
> Rainer Jung wrote:
> > I used 2003 .net, but this includes a 7.0 version of msvcrt.dll.
> >
> > I build apache httpd 1.3 by myself and then mod_jk, and now everything
> > works as expected. So you are right, the binary httpd download is not
> > compatible with module compilation by vc++ 7.0.
> >
> > Any idea how one can make vc++ 7 use the 6.0 msvcrt dll? The 6.0 dll is
> > included in the msi for apache 1.3 from the download.
> >
>
> You cannot do that unless you have VS 6.0.
> This is BTW the reason why the httpd binaries are compiled with
> msvcrt.dll (the binaries can be used with msvcrt71 or msvcrt80,
> but not the other way round).
>
> Regards,
> Mladen.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r521417 - /tomcat/connectors/trunk/jk/native/common/jk_util.c

Posted by Mladen Turk <mt...@apache.org>.
Rainer Jung wrote:
> I used 2003 .net, but this includes a 7.0 version of msvcrt.dll.
> 
> I build apache httpd 1.3 by myself and then mod_jk, and now everything
> works as expected. So you are right, the binary httpd download is not
> compatible with module compilation by vc++ 7.0.
> 
> Any idea how one can make vc++ 7 use the 6.0 msvcrt dll? The 6.0 dll is
> included in the msi for apache 1.3 from the download.
> 

You cannot do that unless you have VS 6.0.
This is BTW the reason why the httpd binaries are compiled with
msvcrt.dll (the binaries can be used with msvcrt71 or msvcrt80,
but not the other way round).

Regards,
Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r521417 - /tomcat/connectors/trunk/jk/native/common/jk_util.c

Posted by Rainer Jung <ra...@kippdata.de>.
I used 2003 .net, but this includes a 7.0 version of msvcrt.dll.

I build apache httpd 1.3 by myself and then mod_jk, and now everything
works as expected. So you are right, the binary httpd download is not
compatible with module compilation by vc++ 7.0.

Any idea how one can make vc++ 7 use the 6.0 msvcrt dll? The 6.0 dll is
included in the msi for apache 1.3 from the download.

Regards, and thanks for the hint

Rainer

Mladen Turk schrieb:
> Rainer Jung wrote:
>> Hi Mladen,
>>
>> I built against an installed form of the official
>> download apache_1.3.37-win32-x86-src.msi.
>>
> 
> ... and you are using VS 2005 I suppose?
> That won't work cause you have different MSVCRT's
> 
> Regards,
> Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r521417 - /tomcat/connectors/trunk/jk/native/common/jk_util.c

Posted by Mladen Turk <mt...@apache.org>.
Rainer Jung wrote:
> Hi Mladen,
> 
> I built against an installed form of the official
> download apache_1.3.37-win32-x86-src.msi.
> 

... and you are using VS 2005 I suppose?
That won't work cause you have different MSVCRT's

Regards,
Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r521417 - /tomcat/connectors/trunk/jk/native/common/jk_util.c

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Mladen,

Aaah, OK, so I was always talking about Apache and you about IIS. That
explains our different observations.

If we don't find a solution making line endings work for IIS/Sun/Apache
und Cygwin, we could also add the platform information to the
jk_logger_t or it's logger_private and use this info in jk_log to
determine the correct line endings. To make it perform, we could
actually put the line ending and it's size into the jk_logger_t or it's
private.

Concerning apache 1.3: I did the same kind of build with 1.2.21 and
1.2.20 and got the same negative result (httpd opening the log file but
writing all log output to stdout/stderr and to the error log). But:
using your official build for 1.2.20 logging worked normally! So that
problem seems to be related to my build, but I've got no idea what's
wrong with my build. I built against an installed form of the official
download apache_1.3.37-win32-x86-src.msi.

Regards,

Rainer

Mladen Turk schrieb:
> Rainer Jung wrote:
>> Hi Mladen,
>>
>> I think we don't use stdio. APR has apr_file_open() which uses
>> CreateFile() and apr_file_write() which goes back to WriteFile() on
>> Windows.
>>
> 
> We are using stdio for other web servers, so if you add CRLF then
> the IIS will be broken. Perhaps opening the files as binary for
> windows, and then forcing CRLF will do. However this would break
> cygwin builds thought.
> 
> I'll check 1.3 tomorrow.
> 
> Regards,
> Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r521417 - /tomcat/connectors/trunk/jk/native/common/jk_util.c

Posted by Mladen Turk <mt...@apache.org>.
Rainer Jung wrote:
> Hi Mladen,
> 
> I think we don't use stdio. APR has apr_file_open() which uses
> CreateFile() and apr_file_write() which goes back to WriteFile() on Windows.
>

We are using stdio for other web servers, so if you add CRLF then
the IIS will be broken. Perhaps opening the files as binary for
windows, and then forcing CRLF will do. However this would break
cygwin builds thought.

I'll check 1.3 tomorrow.

Regards,
Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r521417 - /tomcat/connectors/trunk/jk/native/common/jk_util.c

Posted by Mladen Turk <mt...@apache.org>.
Rainer Jung wrote:
> Hi Mladen,
> 
> I checked out jk trunk today and built mod_jk

Can you double check the trunk?
Think I've fixed the CRLF issue.

Regards,
Mladen.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org