You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ti...@bankerstrust.com.au on 1999/09/30 02:08:45 UTC

[PATCH] ApacheBench on Windows (was RE: cvs commit: apache-1.3/sr c/support ab.c ab.8)

This patch addresses three differences between Win32 and most Unixes that are relevant to ApacheBench. 

First, it substitutes the gettimeofday calls and struct timevals with calls to QueryPerformanceCounter using a #define gettimeofday(a,b) QueryPerformanceCounter(a). The timedif function compiled is also different if WIN32 is defined. (gettimeofday doesn't exist on windows).

Second, all functions that read/write on sockets have been replaced with their winsock counterparts (send, recv, etc). Where WIN32 is not defined, these calls are #defined back to the original calls, eg. #define send(a,b,c,d) write(a,b,c). Note that most of the time, the parameters are the same. If anyone has a better idea of how to do this, by all means suggest it.

Third, it does some #ifdefing at the top of the file to include and define the "right" headers and macros. The windows build relies on the apache source tree for things like getopt and ap_base64encode, so I didn't bother modifying ab.c so that it could be compiled without the apache source. 

The patch modifies ab.c and creates ab.mak, and should be run from just outside src. I made an effort to separate the changes for win32 using #defines, so hopefully none of the changes will have slipped through and broken the unix build.

 <<ab.diff>> 
Tim

Re: [PATCH] ApacheBench on Windows (was RE: cvs commit: apache-1.3/sr c/support ab.c ab.8)

Posted by Ryan Bloom <rb...@ntrnet.net>.

While I agree that getting ab to run on Windows is a good thing, I am
skeptical about this patch.  I have not reviewed the patch, so it has
nothing to do with how the patch is written.  I do not believe we need it.
ApacheBench has been running on windows for the last few weeks.  It was
one of the test programs for APR.  I know this means we won't release it
working on Windows until 2.0, but it also means we won't have to do a huge
re-write of ab for Apache 1.3.9 and then change it to a VERY close
aproximation of it's current state for 2.0.  I think we are better off
just leaving ab be until 2.0 ships.  Just MHO.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@ntrnet.net
6209 H Shanda Dr.
Raleigh, NC 27609		Ryan Bloom -- thinker, adventurer, artist,
				     writer, but mostly, friend.
-------------------------------------------------------------------------------