You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by TO...@aol.com on 2001/08/09 06:11:37 UTC

Re: [PATCH] Make Apache Monitor Display Windows XP correctly

> William A. Wrowe Jr. wrote...
>
>  Guys...
>  
> with only 3 recognized apache services (more on that in a minute) ... it 
> consumes a working set of 1.8 MB (!!!) we need to rip out a bit of this 
cruft.  
> K.I.S.S!
>
>  TARGET:  500kb working set, or less!  Possible?  Don't know yet.
>  Bill

How does ten times smaller than that sound?

Attached is a re-submission of a complete working Apache TRAY icon
program + source code that I have been using here to run Apache from 
the TRAY bar since the first version of Apache for Win32.

The executable is only 53k.

This is the same code that was uploaded 4 or 5 months ago.
It even has the Apache ICON built in and meets a fair amount
of the criteria you pronounced around that time for an Apache 
Win32 TRAY deal.

There is only 1 source file for the entire APP called
TRAY1.C and it's only 47,199 bytes even with TONS
of comments and help text in the code itself.

The entire exectuable TRAY application is only 53,248 bytes.

Source code is not "OOP" or "WHOOPS" or even "Pardon me"... 
It's just straight top-down ANSI 'C' making minimal Win32 API calls.
( Which is what you said you wanted ).

It compiles clean with either MSVC or Borland and 
there are 4 build scripts that show how to compile the 
smallest possible Win32 Console application with either
MSVC 5.0, 6.0 or Borland 5.0 or 5.5 ( the free version ).

As I said 4 or 5 months ago... I don't care what you do with this code...
it's yours to do with as you wish... but if the boys with the GUI IDE's
are having trouble pointing and clicking their way to 1.8 megabytes
worth of crap just for a TRAY application they might just want to
look at this and port the 'extra' stuff they did over to this 'simple'
application and stay around 50-60k. 

Also.. if nothing else... if ya'll still have any hopes of getting away
from expensive commercial MSVC Win32 compiler then NOW is the time
to look at this code and don't make the usual mistakes of committing
code to CVS that is 'MSVC' specific. This puppy is 100 percent compatible
with the 'free' version of Borland compiler. Look at the _argc and 
_argv handling, etc.

Here is the same 'blurb' that was included last time this
source was sent up...

[snip - From top of TRAY1.C]

// TRAY1 - Simple Win32 Tray ICON application

// This 'simple' program can act as a front-end for any Win32
// Service related application.

// It does NOT use ATL, MFC, or any of that other bloat.
// It is a clean-and-simple .C program that used the Win32 API
// to establish and maintain a Win9x/2000 or NT TRAY ICON.

// The final TOTAL size of the .EXE is only around 53k.
// If MFC or ATL were used the .EXE would be MUCH, MUCH larger
// and more complicated.

// This particular instance of the code has been made to 'look'
// like a demo front-end for the Win32 version of the Apache
// Web Server 'Service'. The TRAY ICON itself will appear as a
// small 'feather' which is simply the standard APACHE.ICON icon
// from ..\SRC\OS\WIN32\APACHE.ICO

// The menu options simply say...

// 1. Show  the Apache Web Server Control Panel
// 2. Start the Apache Web Server
// 3. Stop  the Apache Web Server

// The TRAY related calls and globals are all prefixed with
// 'ap_tray1_xxxxx()' so they don't conflict with any
// non-Apache routines.

// To BUILD this demo just use the .BAT files.
// There are no makefiles or project files.
// They are not necessary for such a simple program.

// MKMSVC5.BAT <- Rebuild TRAY1.EXE manually using MSVC 5.x
// MKMSVC6.BAT <- Rebuild TRAY1.EXE manually using MSVC 6.x
// MKBOR50.BAT  <- Rebuild TRAY1.EXE manually using Borland 5.0 (tlink32)
// MKBOR55.BAT  <- Rebuild TRAY1.EXE manually using Borland 5.5 (ilink32)

// The program also shows the proper way to use _argc and _argv[]
// command line argument info in WinMain() and make it generic to
// both MSVC and Borland.

// MSVC adds extra underscores to command line arguments
// visible to WinMain() so just re-map to Borland equivalents
// like this...

// #ifndef __BORLANDC__
// #define _argc __argc
// #define _argv __argv
// #endif

// See the start of WinMain() for more details...

// There is no copyright of any kind. It's just a demo.

// Original author: Kevin Kiley, 1998

[snip - From top of TRAY1.C ]

* Original message...

In a message dated 01-08-08 17:17:56 EDT, William A. Rowe, Jr. writes...

> Subj: Re: [PATCH] Mkae Apache Monitor Display Windows XP correctly
> Date: 01-08-08 17:17:56 EDT
> From: wrowe@rowe-clan.net (William A. Rowe, Jr.)
> Reply-to: new-httpd@apache.org
> To: new-httpd@apache.org
>  
>  Guys...
>  
> with only 3 recognized apache services (more on that in a minute) ... it 
> consumes a working set of 1.8 MB (!!!) we need to rip out a bit of this 
cruft.  
> K.I.S.S!
>  
>    The about box is a waste (in most programs), but _especially_ in a task 
> bar 
>  application reporting the Windows OS (and all the dead-weight to go along 
> with it.)
>  A "What's This?" tooltip box is more than sufficient, no?  Only my 
touchpad 
> has a real
>  "About..." box, and it wastes no effort on reporting the Windows version :)
>  
>    If they don't know which windows they are using, oh well.
>  
>    I'll offer a patch Monday if nobody beats me to it.  (I'm following 
these 
>  discussions off-line).  I will also hook in apr.lib (static, not dynamic) 
> for
>  nothing more than table and pool create/destruct...
>  
>    Pools should make this app very memory-lite, since each iteratation can 
> gain a
>  sub pool that is then destroyed cleanly (without the leaking resources).
>  Using a table or hash to track the installed/running services (when there 
> are 
>  many) will also be a nice improvement.
>  
>    TARGET:  500kb working set, or less!  Possible?  Don't know yet.
>  
>  Bill
>  
>  [I've renamed each generation of Apache.exe by number, since all 7 
versions 
> I track are
>  running on different ports.  Apache1.3.14.exe means more when I look at 
the 
> process list
>  than seeing 30 Apache's.  Of course, that breaks the association for the 
> task bar app,
>  as well.  I'll try working up some cute fix for this quandry next week, 
> because I'd sure
>  like to fold all 10 of my servers under this controller :)]
>  
>  ----- Original Message ----- 
>  From: "Jerry Baker" <je...@weirdness.com>
>  To: <ne...@apache.org>
>  Sent: Tuesday, August 07, 2001 8:01 PM
>  Subject: [PATCH] Mkae Apache Monitor Display Windows XP correctly
>  
>  
>  > Index: ApacheMonitor.c
>  > ===================================================================
>  > RCS file: /home/cvspublic/httpd-2.0/support/win32/ApacheMonitor.c,v
>  > retrieving revision 1.2
>  > diff -u -r1.2 ApacheMonitor.c
>  > --- ApacheMonitor.c     2001/08/07 19:54:10     1.2
>  > +++ ApacheMonitor.c     2001/08/08 00:58:33
>  > @@ -212,7 +212,7 @@
>  >              else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion ==
>  > 0)
>  >                  strcpy(szVersion, "MS Windows 2000 ");
>  >              else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion ==
>  > 1)
>  > -                strcpy(szVersion, "Whistler ");
>  > +                strcpy(szVersion, "MS Windows XP ");
>  >              /* Test for product type.*/
>  >  #ifdef VER_VORKSTATION_NT
>  >              if (bOsVersionInfoEx)
>  > 

RE: [PATCH] Make Apache Monitor Display Windows XP correctly

Posted by Mladen Turk <ml...@mail.inet.hr>.
> -----Original Message-----
> From: TOKILEY@aol.com [mailto:TOKILEY@aol.com]
> Sent: Thursday, August 09, 2001 6:12 AM
> To: new-httpd@apache.org
> Subject: Re: [PATCH] Make Apache Monitor Display Windows XP correctly
>
>
>
> > William A. Wrowe Jr. wrote...
> >
> >  Guys...
> >
> > with only 3 recognized apache services (more on that in a
> minute) ... it
> > consumes a working set of 1.8 MB (!!!) we need to rip out a bit of this
> cruft.
> > K.I.S.S!
> >
> >  TARGET:  500kb working set, or less!  Possible?  Don't know yet.
> >  Bill
>
> How does ten times smaller than that sound?

Sorry but you app when compiled eats 1152K of memory and does nothing :-)

MT.