You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jim Jagielski <ji...@jaguNET.com> on 2000/02/02 23:46:53 UTC

AddDefaultCharset

I'm wondering... maybe we could streamline AddDefaultCharset and
AddDefaultCharsetName. Just have AddDefaultCharset which
defines the default charset to include. For none, we specify
AddDefaultCharset None. So one directive replaces the two.

Comments?
-- 
===========================================================================
   Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
                "Are you suggesting coconuts migrate??"

RE: PR3715 NT piped TransferLog bug (was logged, guess I didn't need to)

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
> Thanks for submitting this. We really are short on people
> interested in
> working on the Windows port of Apache.  In general, I am
> focusing most of my
> efforts on Apache 2.0, but since you went to the trouble of
> working up some
> code, I'll take a look at it :-) Thanks again!
>
> Bill

As a matter of fact - I just downloaded the apache2 code last night - and am
looking into if it is affected by the same issue.

If so, I will follow up with a 2.0 fix.

I am really concerned about the piping problems with NT as well, and will be
watching the 2.0 codebase for those.

Bill


Re: PR3715 NT piped TransferLog bug (was logged, guess I didn't need to)

Posted by Bill Stoddard <st...@raleigh.ibm.com>.
Bill,
Thanks for submitting this. We really are short on people interested in
working on the Windows port of Apache.  In general, I am focusing most of my
efforts on Apache 2.0, but since you went to the trouble of working up some
code, I'll take a look at it :-) Thanks again!

Bill

>   Also - While you are at it, close PR3741 'custom install does not set up
> conf directory'.  The start/stop apache icons in 1.3.11 work quite nicely,
> thank you!
Done

>
>   As for PR1643 'making the server console hideable' and PR3594 'Please
add
> an Apache icon to the systray instead of a DOS window' I will look at the
> requests (they are really related, with the later being more of an
external
> app staring at the hidden console window.)  I will look at PR 2208 'Is
there
> anyway to get Apache to work as a Windows 95 service' but I don't expect
to
> report much <g>.
Great.



RE: PR3715 NT piped TransferLog bug (was logged, guess I didn't need to)

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
Any NT advocate here to help a newbie contributor???

Synopsis:

  PR #3715 Can't pipe TransferLog (in Win32)

  In fact, cannot pipe TransferLog, CustomLog or ErrorLog.

Issue:

  The path to the shell is required by spawnl (as it is by Unix as well).
The SHELL_PATH value of "CMD.EXE" is insufficient.  The full path and file
spec of the Win32 machine's shell path is retrieved by getenv("COMSPEC").
This returns "C:\WinNT\System32\CMD.EXE" or "C:\Windows\Command\COMMAND.COM"
as configured.  If the admin has mucked this up, it's their own problem.

Solution:

  Attached fix is relative to CVS 1.83 (included CSS patch!)

  The fixups of piped_log_child() and error_log_child() in http_log.c are
required, as I proposed last night.  I changed just the 'if (!shellcmd)'
result to do something (rather than nothing) - even though it is unlikely to
help the admin at that point.  Nothing more is required - I tested the
solution below in an NT4 SP4 VC5 build.

  The other notes about rotatelogs.c below are easy to implement.

  I am not proposing a fix to piped_log_spawn() (not pulled into the Win32
build).  For that behavior, the async fork emulation is best saved for the
2.0 release.

  This is a platform specific fix (not a change to the global codebase) - so
I am wondering if someone could be so kind as to submit it and close PR3715.
Feedback to the original post would be appreciated as well.

  Also - While you are at it, close PR3741 'custom install does not set up
conf directory'.  The start/stop apache icons in 1.3.11 work quite nicely,
thank you!

  As for PR1643 'making the server console hideable' and PR3594 'Please add
an Apache icon to the systray instead of a DOS window' I will look at the
requests (they are really related, with the later being more of an external
app staring at the hidden console window.)  I will look at PR 2208 'Is there
anyway to get Apache to work as a Windows 95 service' but I don't expect to
report much <g>.

Bill

note - the fix below is depreciated - rather than return(-1) for missing
COMSPEC, my proposed diff takes SHELL_PATH, not that it will do much good
<g>.

>
> Question of coding practice after forcing rotatelogs.c to work on NT:
>
> my fixup of http_log.c for both piped_log_child() and error_log_child():
>
> {
> ...
> #if defined(WIN32)
>     char *shellcmd;
> #endif
> ...
> #elif defined(WIN32)
>     shellcmd = getenv("COMSPEC");
>     if (!shellcmd)
>         shellcmd = "C:\COMMAND.COM";
>     child_pid = spawnl(_P_NOWAIT, shellcmd, shellcmd, "/c", (char *)cmd,
NULL);
> ...
>
>
> samewise fixup perhaps is needed in piped_log_spawn(), etc (though
> not where we have recoded with the CreateProcess fixup, wonder if
> 1/2 that issue wasn't the lack of path info)...
> this fixup is perhaps ugly, but resolves CMD.EXE vs. COMMAND.COM and
> other discrepancies in Win32.
>
> There must be a 'more proper' way of maintaining the
> necessity of a dynamic
> command shell value vs. the static Unix macro to "/bin/sh".
>
> 1) Would an ap_shell_path() to a char* be acceptable?  As far
> as I can tell,
> SHELL_PATH is used infrequently so it might be overkill.
>
> 2) Is the getenv() acceptable for host environment access, or
> could you
> point me at an internal cache of the environment that is more
> appropriate?
>
> 3) What about wrapping the entire junk in an
> ap_spawn_shell(arg0, [arg1,
> [,...]] NULL) wrapper?



> Oh, I came across this issue in rotatelogs.c as well; can we strike
>
> #define MAX_PATH	1024
>
> and replace with _MAX_PATH in the char buf2[MAX_PATH] declaration?
> (Everyone has _MAX_PATH, right???  At least I tracked one down in msvc
> stdlib.h, which is not so standard, I know <g>.  If not, some
> define in
> ap_config.h et. al. would be good.)  The only other compiler
> warning came
> from no return(0); close (not that it returns <g>).

>> That reminds me (thanks) that if we get rotatelogs.exe functioning under
>> NT - the config notes MUST state that blanks in names (or quoted names)
will
>> NOT work - they must use the tilde'd (8.3) equiv for the path and file
spec
>> (not too much of a hardship - it's the admin we are talking about, not
the
>> html author or user!)

>> (ie. C:\Progra~1\Apache~1\Apache\logs\logfilenamemaybelongjustnospaces)

>> It would be nice to throw an .exe of rotatelogs at them, since most won't
>> have a compiler (some days that wintel world seems just kinda nuts).


> I'm more than happy to submit a diff'd fixup, if someone
> would first comment
> on my 3 Q's.  Any suggestions on a diff for WinNT?
>

NT piped TransferLog bug (not logged, I will if you insist)

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
Question of coding practice after forcing rotatelogs.c to work on NT:

my fixup of http_log.c for both piped_log_child() and error_log_child():

{
...
#if defined(WIN32)
    char *shellcmd;
#endif
...
#elif defined(WIN32)
    shellcmd = getenv("COMSPEC");
    if (!shellcmd) return (-1);
    child_pid = spawnl(_P_NOWAIT, shellcmd, shellcmd, "/c", (char *)cmd,
NULL);
...

was failing (in 1.3.11) with simply:
#elif defined(WIN32)
    child_pid = spawnl(P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd,
NULL);

samewise fixup is needed in piped_log_spawn(), etc (though not where we have
recoded with the CreateProcess fixup, wonder if 1/2 that issue wasn't the
lack of path info)...  this fixup looks ugly, but resolves CMD.EXE vs.
COMMAND.COM and other discrepancies in Win32.

There must be a 'more proper' way of maintaining the necessity of a dynamic
command shell value vs. the static Unix macro to "/bin/sh".

1) Would an ap_shell_path() to a char* be acceptable?  As far as I can tell,
SHELL_PATH is used infrequently so it might be overkill.

2) Is the getenv() acceptable for host environment access, or could you
point me at an internal cache of the environment that is more appropriate?

3) What about wrapping the entire junk in an ap_spawn_shell(arg0, [arg1,
[,...]] NULL) wrapper?

Oh, I came across this issue in rotatelogs.c as well; can we strike

#define MAX_PATH	1024

and replace with _MAX_PATH in the char buf2[MAX_PATH] declaration?
(Everyone has _MAX_PATH, right???  At least I tracked one down in msvc
stdlib.h, which is not so standard, I know <g>.  If not, some define in
ap_config.h et. al. would be good.)  The only other compiler warning came
from no return(0); close (not that it returns <g>).

I'm more than happy to submit a diff'd fixup, if someone would first comment
on my 3 Q's.  Any suggestions on a diff for WinNT?


Re: AddDefaultCharset

Posted by Marc Slemko <ma...@znep.com>.
On Wed, 2 Feb 2000, Jim Jagielski wrote:

> I'm wondering... maybe we could streamline AddDefaultCharset and
> AddDefaultCharsetName. Just have AddDefaultCharset which
> defines the default charset to include. For none, we specify
> AddDefaultCharset None. So one directive replaces the two.

<shrug>

I prefer two directives because I find overloading a single one to be
unnecessarily messy and confusing.  Most sites that use this only have to
set "AddDefaultCharset on", since most sites can use the default charset
just fine.

I will say the directive names suck, but I had trouble thinking of better
ones.  Or thinking at all for that matter... <g>