boa-devel Mailing List for Boa (Page 11)
Brought to you by:
jnelson
You can subscribe to this list here.
2000 |
Jan
(31) |
Feb
(42) |
Mar
(77) |
Apr
(8) |
May
(8) |
Jun
(16) |
Jul
|
Aug
(4) |
Sep
(20) |
Oct
(1) |
Nov
(11) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
|
Feb
(9) |
Mar
(3) |
Apr
|
May
(3) |
Jun
|
Jul
(3) |
Aug
|
Sep
(5) |
Oct
|
Nov
(1) |
Dec
(1) |
2002 |
Jan
(2) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(7) |
Oct
(15) |
Nov
(6) |
Dec
(41) |
2003 |
Jan
(32) |
Feb
(20) |
Mar
(1) |
Apr
(1) |
May
(3) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(12) |
2004 |
Jan
(2) |
Feb
(5) |
Mar
(5) |
Apr
(1) |
May
(10) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2005 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(8) |
2006 |
Jan
(10) |
Feb
(3) |
Mar
(1) |
Apr
(1) |
May
(6) |
Jun
(13) |
Jul
(12) |
Aug
(13) |
Sep
(4) |
Oct
(23) |
Nov
(29) |
Dec
(26) |
2007 |
Jan
(15) |
Feb
(19) |
Mar
(29) |
Apr
(79) |
May
(74) |
Jun
(112) |
Jul
(44) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jon N. <jn...@ja...> - 2003-01-10 01:09:17
|
I'm making rc10 available soon. Anybody interested in early taker's please contact me, and I'll get a diff out or something. It should fix some issues with the refactored select and poll loops, and a few tweaks. -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: Jon N. <jn...@ja...> - 2003-01-06 17:06:02
|
On Mon, 6 Jan 2003, Allan Wind wrote: > On 2003-01-06 10:37:17, Jon Nelson wrote: > > I'm not sure exactly what you are trying to do here. You are trying > > to take all requests for the 'root' URL (just '/' but not > > '/something') and turn it into '/home'? > > I want redirect ^/$ (and ^/index.html$) to /home (and /home/index.html). OK. I can't really think of a practical way to do this with Boa without code modification. The /index.htm and /index.html redirects should be easy. Redirect /index.htm /home/index.html Redirect /index.html /home/index.html As for redirecting ^/$ to /home/ (not /home, because that in itself will generate yet-another 30x series redirection because it's a directory that doesn't end in a '/'), I'm sure a tiny bit of code modification could be done. -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: <all...@li...> - 2003-01-06 16:55:33
|
On 2003-01-06 10:37:17, Jon Nelson wrote: > I'm not sure exactly what you are trying to do here. You are trying > to take all requests for the 'root' URL (just '/' but not > '/something') and turn it into '/home'? I want redirect ^/$ (and ^/index.html$) to /home (and /home/index.html). > What about requests for '/foo' ? Should that be '/homefoo' > or '/home/foo' ? /foo -> /foo > It's important to match up the trailing slashes for Aliases > and stuff, and slightly less so for Redirects.=20 I played with that and found it not to make a difference in my case. > Are you sure you want a Redirect (you want the client browser to issue a > new request? Yes. > Please tell me more about what you are trying to accomplish here. I want the conceptual "home" directory to live in physical directory of the same name. /Allan --=20 Allan Wind P.O. Box 2022 Woburn, MA 01888-0022 USA |
From: Jon N. <jn...@ja...> - 2003-01-06 16:51:20
|
On Mon, 6 Jan 2003, Allan Wind wrote: > I was trying to 'redirect / /home' and found that to trigger recursive > expansion of the '/' ending up with /homehomehomehome etc. Is there a > way to do this? Support for regular expressions would probably be the > most general and elegant solution. I'm not sure exactly what you are trying to do here. You are trying to take all requests for the 'root' URL (just '/' but not '/something') and turn it into '/home'? What about requests for '/foo' ? Should that be '/homefoo' or '/home/foo' ? It's important to match up the trailing slashes for Aliases and stuff, and slightly less so for Redirects. Are you sure you want a Redirect (you want the client browser to issue a new request? Please tell me more about what you are trying to accomplish here. -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: <all...@li...> - 2003-01-06 16:30:01
|
I was trying to 'redirect / /home' and found that to trigger recursive expansion of the '/' ending up with /homehomehomehome etc. Is there a way to do this? Support for regular expressions would probably be the most general and elegant solution. /Allan --=20 Allan Wind P.O. Box 2022 Woburn, MA 01888-0022 USA |
From: Jon N. <jn...@ja...> - 2003-01-06 14:34:11
|
There may be a minor issue with 0.94.14rc9. In select.c and poll.c the algorithm was changed slightly. The potentially undesireable result is that, while there are active requests, we may not poll the server socket often enough, resulting in connections "timing out". I'm not sure yet why it shows up as timed out requests, but the following patches seem to fix it, and are logically correct as well -- I just can't link the problem and a this solution very tightly. Index: poll.c =================================================================== RCS file: /home/jnelson/cvs/boa/src/poll.c,v retrieving revision 1.2.2.5 diff -u -r1.2.2.5 poll.c --- poll.c 28 Dec 2002 06:00:19 -0000 1.2.2.5 +++ poll.c 6 Jan 2003 14:16:44 -0000 @@ -102,7 +102,8 @@ if (errno == EINTR) continue; /* while(1) */ } - if (!sigterm_flag && (pfds[server_pfd].revents & POLLIN)) + if (!sigterm_flag && (request_ready || + pfds[server_pfd].revents & POLLIN)) pending_requests = 1; } Index: select.c =================================================================== RCS file: /home/jnelson/cvs/boa/src/select.c,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- select.c 27 Dec 2002 21:17:40 -0000 1.1.2.7 +++ select.c 4 Jan 2003 04:08:23 -0000 1.1.2.8 @@ -21,7 +21,7 @@ * */ -/* $Id: select.c,v 1.1.2.7 2002/12/27 21:17:40 jnelson Exp $*/ +/* $Id: select.c,v 1.1.2.8 2003/01/04 04:08:23 jnelson Exp $*/ /* algorithm: * handle any signals @@ -110,7 +110,8 @@ fdset_update(); } - if (!sigterm_flag && FD_ISSET(server_s, &block_read_fdset)) { + if (!sigterm_flag && (request_ready || + FD_ISSET(server_s, &block_read_fdset))) { pending_requests = 1; } -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: Jon N. <jn...@ja...> - 2003-01-04 03:00:35
|
On 2 Jan 2003, Peter Korsgaard wrote: > >>>>> "Jon" == Jon Nelson <jn...@ja...> writes: > > Jon> The select and poll loops both got almost rewritten here, so > Jon> please give this a big test. Most of the other changes have > Jon> been tested by others and appear to be good. > > Unfortunately there's a few minor problems in rc9: > > - config.h.in defines GUNZIP twice > - access.c uses DIE/WARN but doesn't include boa.h > - access_init() after parsing of config file in config.c (my mistake) > > I have made a small patch to fix these: > > http://peter.korsgaard.com/software/boa.misc.0.94.14rc9.patch Applied, Thanks! -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: Peter K. <ja...@su...> - 2003-01-02 10:51:34
|
>>>>> "Jon" == Jon Nelson <jn...@ja...> writes: Jon> The select and poll loops both got almost rewritten here, so Jon> please give this a big test. Most of the other changes have Jon> been tested by others and appear to be good. Unfortunately there's a few minor problems in rc9: - config.h.in defines GUNZIP twice - access.c uses DIE/WARN but doesn't include boa.h - access_init() after parsing of config file in config.c (my mistake) I have made a small patch to fix these: http://peter.korsgaard.com/software/boa.misc.0.94.14rc9.patch -- Bye, Peter Korsgaard |
From: Jon N. <jn...@ja...> - 2003-01-02 00:12:29
|
at http://www.boa.org/boa-0.94.14rc9.tar.gz and http://www.boa.org/boa-0.94.14rc9.tar.bz2 The select and poll loops both got almost rewritten here, so please give this a big test. Most of the other changes have been tested by others and appear to be good. -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: Jon N. <jn...@ja...> - 2002-12-22 14:39:31
|
On Sun, 22 Dec 2002, Allan Wind wrote: > http://www.boa.org/documentation/boa-3.html#ss3.3 links to > http://www.boa.org/documentation/todo.txt whcih doesn't exist. Thanks for the heads up! Fixed. -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: <all...@at...> - 2002-12-22 05:22:59
|
http://www.boa.org/documentation/boa-3.html#ss3.3 links to=20 http://www.boa.org/documentation/todo.txt whcih doesn't exist. /Allan --=20 Allan Wind P.O. Box 2022 Woburn, MA 01888-0022 USA |
From: Jon N. <jn...@ja...> - 2002-12-21 00:30:37
|
On 17 Dec 2002, Peter Korsgaard wrote: > Hi, > > Ups, I just noticed a minor memleak in access.c - this patch fixes it. > > http://peter.korsgaard.com/software/boa.accesscontrol-memleak.patch I finally found time to zip through the access stuff. I added your patch in slightly modified form, and modified some of the rest of the access code slightly. rc9 will have all the new stuff. -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: Peter K. <ja...@su...> - 2002-12-17 21:57:23
|
Hi, Ups, I just noticed a minor memleak in access.c - this patch fixes it. http://peter.korsgaard.com/software/boa.accesscontrol-memleak.patch -- Bye, Peter Korsgaard |
From: Jon N. <jn...@ja...> - 2002-12-16 00:20:26
|
On 15 Dec 2002, Peter Korsgaard wrote: > I have created a small patch for 0.94.14rc8 which corrects the help of > --disable-debug and capitalises the first word of the > enable/disable/with/without options. > > http://peter.korsgaard.com/software/boa.configure.0.94.14rc8.patch This and your next patch applied. Also, the kind folks at PlanetMirror found a logging bug with ranges. The total file size is reported, not the number of bytes written out. I sent them a quick patch for this, and a 1-liner that makes ENOTCONN a on sendfile failure not a loggable-error (same as EPIPE on write(2)). Thanks! -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: Peter K. <ja...@su...> - 2002-12-15 16:41:20
|
Hi, There didn't seem to be any easy way of disabling gunzip support (except if AC_PATH_PROG couln't find it), so I have created a small patch which adds a --disable-gunzip option to configure. http://peter.korsgaard.com/software/boa.gunzip.0.94.14rc8.patch (remember to run autoconf after applying) Oh, and I just noticed that my access control patch was applied to 0.94.14rc8, thanks! -- Bye, Peter Korsgaard |
From: Peter K. <ja...@su...> - 2002-12-15 16:08:30
|
Hi, I have created a small patch for 0.94.14rc8 which corrects the help of --disable-debug and capitalises the first word of the enable/disable/with/without options. http://peter.korsgaard.com/software/boa.configure.0.94.14rc8.patch -- Bye, Peter Korsgaard |
From: . W. M. <0...@pe...> - 2002-12-14 19:02:54
|
On Sat, 14 Dec 2002 11:28:33 -0600 (CST), "Jon Nelson" <jn...@ja...> said: > On Sat, 14 Dec 2002, [ISO-8859-1] Fr=E9d=E9ric L. W. Meunier wrote: >=20 > > I'm at my first attempt to compile Boa on Cygwin and get rid of > > the Windows Apache port. > >=20 > > I used --prefix=3D/usr --enable-access-control --disable-debug > >=20 > > The only tests which failed: > >=20 > > checking for working mmap... no > > checking for tm.tm_gmtoff... no > > checking for tm.tm_zone... no And without these UseLocaltime won't work, right ? I'm getting=20 the boa_indexer times in UTC, and in the logs they look like: 127.0.0.1 - - [14/Dec/2002:16:39:14 +=A6201] I can live with it. > > checking for sockaddr_in.sin_len... no >=20 > Well, without a working mmap, there's not a great deal you can do. What do I lose ? The server appears to work fine. I noticed 2 minor problems, both Cygwin specific. 1-=20 $ /usr/sbin/boa [14/Dec/2002:19:36:20 +0000] No such user: nobody [14/Dec/2002:19:36:20 +0000] No such group: nogroup I'll later see if I can run it with other users. 2- It seems to use more CPU. I tested browsing on localhost:8080. > You might consider setting MAX_FILE_MMAP to 0, or ask on this list. I > don't have access (or desire to work with) a Cygwin platform. > However, Boa is reported to work there. > Hmm. Well, sa_family_t might be too new -- I'll whip up a quick > autoconf test and patch for that. The patch you sent fixed it. Thanks. -- 0@pervalidus.{net, dyndns.org} --=20 http://fastmail.fm - Faster than the air-speed velocity of an unladen european swallow |
From: Jon N. <jn...@ja...> - 2002-12-14 17:41:56
|
Try this for the sa_family_t issue. Index: src/request.c =================================================================== RCS file: /home/jnelson/cvs/boa/src/request.c,v retrieving revision 1.112.2.20 diff -u -r1.112.2.20 request.c --- src/request.c 13 Dec 2002 01:42:34 -0000 1.112.2.20 +++ src/request.c 14 Dec 2002 17:38:07 -0000 @@ -74,6 +74,10 @@ * does some basic initialization and adds it to the ready queue;. */ +#ifndef sa_family_t +typedef unsigned short int sa_family_t; +#endif + void get_request(int server_s) { int fd; /* socket */ ======= On Sat, 14 Dec 2002, [ISO-8859-1] Frédéric L. W. Meunier wrote: > I'm at my first attempt to compile Boa on Cygwin and get rid of > the Windows Apache port. > > I used --prefix=/usr --enable-access-control --disable-debug > > The only tests which failed: > > checking for working mmap... no > checking for tm.tm_gmtoff... no > checking for tm.tm_zone... no > checking for sockaddr_in.sin_len... no > > Now to the problem: > > gcc-2.exe -O2 -pipe -DACCESS_CONTROL -I. -I. -c -o request.o request.c > request.c: In function `get_request': > request.c:87: `sa_family_t' undeclared (first use in this function) > request.c:87: (Each undeclared identifier is reported only once > request.c:87: for each function it appears in.) > request.c:87: parse error before `0xdead' > make[1]: *** [request.o] Error 1 > make[1]: Leaving directory `/cygdrive/g/Linux/boa-0.94.14rc8/src' > make: *** [boa] Error 2 > > -- > 0@pervalidus.{net, dyndns.org} > > -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: Jon N. <jn...@ja...> - 2002-12-14 17:31:18
|
On Sat, 14 Dec 2002, [ISO-8859-1] Frédéric L. W. Meunier wrote: > I'm at my first attempt to compile Boa on Cygwin and get rid of > the Windows Apache port. > > I used --prefix=/usr --enable-access-control --disable-debug > > The only tests which failed: > > checking for working mmap... no > checking for tm.tm_gmtoff... no > checking for tm.tm_zone... no > checking for sockaddr_in.sin_len... no Well, without a working mmap, there's not a great deal you can do. You might consider setting MAX_FILE_MMAP to 0, or ask on this list. I don't have access (or desire to work with) a Cygwin platform. However, Boa is reported to work there. > Now to the problem: > > gcc-2.exe -O2 -pipe -DACCESS_CONTROL -I. -I. -c -o request.o request.c > request.c: In function `get_request': > request.c:87: `sa_family_t' undeclared (first use in this function) > request.c:87: (Each undeclared identifier is reported only once > request.c:87: for each function it appears in.) > request.c:87: parse error before `0xdead' > make[1]: *** [request.o] Error 1 > make[1]: Leaving directory `/cygdrive/g/Linux/boa-0.94.14rc8/src' > make: *** [boa] Error 2 Hmm. Well, sa_family_t might be too new -- I'll whip up a quick autoconf test and patch for that. -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: . W. M. <0...@pe...> - 2002-12-14 16:14:41
|
I'm at my first attempt to compile Boa on Cygwin and get rid of the Windows Apache port. I used --prefix=/usr --enable-access-control --disable-debug The only tests which failed: checking for working mmap... no checking for tm.tm_gmtoff... no checking for tm.tm_zone... no checking for sockaddr_in.sin_len... no Now to the problem: gcc-2.exe -O2 -pipe -DACCESS_CONTROL -I. -I. -c -o request.o request.c request.c: In function `get_request': request.c:87: `sa_family_t' undeclared (first use in this function) request.c:87: (Each undeclared identifier is reported only once request.c:87: for each function it appears in.) request.c:87: parse error before `0xdead' make[1]: *** [request.o] Error 1 make[1]: Leaving directory `/cygdrive/g/Linux/boa-0.94.14rc8/src' make: *** [boa] Error 2 -- 0@pervalidus.{net, dyndns.org} -- http://fastmail.fm - Does exactly what it says on the tin |
From: Jon N. <jn...@ja...> - 2002-12-11 15:29:23
|
A few buglets have been found in the latest rc for 0.94.14 Please see http://www.boa.org/news.html for the details. Note -- thanks to Don Mahurin, I got Boa working with InterMezzo successfully last night. It appears there are still some minor issues to resolve, but if using InterMezzo doesn't stress Boa, I'm not sure what will (other than you *huge* sites). -- Democracy is two wolves and a sheep voting on what to have for dinner. Liberty is two wolves attempting to have a sheep for dinner and finding a well-informed, well-armed sheep. Jon Nelson <jn...@ja...> C and Python Code Gardener |
From: Peter K. <ja...@su...> - 2002-12-10 21:57:24
|
>>>>> "larry" == larry <la...@do...> writes: larry> My recommendation is always to use static index.html files. larry> They can be regenerated on-demand by explicit request, or by larry> cron. True, that's also why I'm trying to make the directory indexing / caching a bit more flexible. In our case we use Boa for our mirrors (for the people who cannot use ftp because they are behind a firewall and so on), and a lot of the directories do not have index.html's. As I see it we have 4 options: - Generate static index.html's for the directories without any after each mirror update - We prefer the mirrors to be as "clean" as possible, so no extra sunsite specific files. - Use the DirMaker directive to have a directory index generated dynamically for each directory request through CGI - The overhead is quite bad. - Use the Builtin directory indexer and caching - Performance is good, but the indexes are not exactly pretty (we would like to add a bit of sunsite info to the indexes) - Generate static dir.dev.inode files (cache) on each mirror update - problems with stale cache as files are updated (Boa afaik returns an error if it cannot create an updated info) The nicest thing would imho be if Boa could cache the output of the DirMaker - so that's what I was looking at. -- Bye, Peter Korsgaard |
From: Peter K. <ja...@su...> - 2002-12-10 06:45:39
|
>>>>> "Jon" == Jon Nelson <jn...@ja...> writes: >> Just a little notice that we have been running v0.94.14rc7 on >> sunsite.dk for our mirrors for the last week without problems! Jon> Oooh, I just love to hear this. ;) >> The configure script failed to detect one of the system functions >> (don't remember which on at the moment), I'll have a look at it >> and create a patch if needed. Jon> I'd love to know which one failed. This is on Solaris, right? Yes, but after looking closer at it I noticed that the reason was that our recently compiled gcc 3.2 seems to use -Werror, and the test program created by configure generates the following warning: conftest.c:10: warning: conflicting types for built-in function `strstr' - it works fine with the old gcc 2.95.3 though. >> I have updated the access control patch to 14rc7 at: >> http://peter.korsgaard.com/software/boa.access-control.0.94.14rc7.patch >> (remember to run autoconf after applying it, and configure with >> --enable-access-control) Jon> Thanks! You're welcome. -- Bye, Peter Korsgaard |
From: <la...@do...> - 2002-12-10 04:20:45
|
On Mon, Dec 09, 2002 at 09:40:49PM +0100, Peter Korsgaard wrote: > > I was looking at doing (a simplified) version of that last weekend for > sunsite.dk, as Boa's CGI approach to directory indexing is quite CPU > heavy on the big directories of our mirrors, and the builtin cacheable > indexer is not that pretty ;) > > i didn't get around to finish it, but I'll have a look at it again > later this week. My recommendation is always to use static index.html files. They can be regenerated on-demand by explicit request, or by cron. - Larry |
From: Elizabeth B. <li...@so...> - 2002-12-09 21:51:12
|
Here is a patch that will run a cgi-script if it is defined as the DirectoryIndex and its' mime-type is CGI_MIME_TYPE. Note that it: * Modifies "struct request" with one pointer that is NULL'd out early on. * If the mime-type is set in the "struct request", then it is used when sending the header, else it is determine by looking at the req->request_uri as before. * The NPH or CGI check has been moved to a function, determine_cgi_type Its not very fancy, however. Any thoughts on this? Elizabeth diff -up3r boa-0.94.14rc7/src/alias.c boa-0.94.14rc7.modified/src/alias.c --- boa-0.94.14rc7/src/alias.c Sun Nov 17 20:26:33 2002 +++ boa-0.94.14rc7.modified/src/alias.c Mon Dec 9 15:34:08 2002 @@ -416,10 +416,7 @@ int translate_uri(request * req) send_r_error(req); return 0; } - if (req->http_version == HTTP09) - req->cgi_type = NPH; - else - req->cgi_type = CGI; + req->cgi_type = determine_cgi_type(req, NULL); return 1; } else if (req->method == M_POST) { /* POST to non-script */ /* it's not a cgi, but we try to POST??? */ @@ -508,12 +505,7 @@ int init_script_alias(request * req, ali "%s:%d - pathname in init_script_alias is: \"%s\" (\"%s\")\n", __FILE__, __LINE__, pathname, pathname + current1->real_len); #endif - if (strncmp("nph-", pathname + current1->real_len, 4) == 0 - || (req->http_version == HTTP09)) - req->cgi_type = NPH; - else - req->cgi_type = CGI; - + req->cgi_type = determine_cgi_type(req, pathname + current1->real_len); /* start at the beginning of the actual uri... (in /cgi-bin/bob, start at the 'b' in bob */ @@ -723,4 +715,20 @@ void dump_alias(void) alias_hashtable[i] = NULL; } } +} + +/* + * determine_cgi_type + * + * Given a request and a script name (which may be NULL), returns the + * approprait cgi_type. + */ + +enum CGI_TYPE +determine_cgi_type(const request * req, const char * script_name) +{ + if((script_name && strncmp("nph-", script_name, 4) == 0) || req->http_version == HTTP09) + return NPH; + else + return CGI; } diff -up3r boa-0.94.14rc7/src/boa.h boa-0.94.14rc7.modified/src/boa.h --- boa-0.94.14rc7/src/boa.h Sun Nov 17 21:04:08 2002 +++ boa-0.94.14rc7.modified/src/boa.h Mon Dec 9 15:27:20 2002 @@ -54,6 +54,7 @@ void add_alias(char *fakename, char *realname, int script); int translate_uri(request * req); void dump_alias(void); +enum CGI_TYPE determine_cgi_type(const request * req, const char * script_name); /* config */ void read_config_files(void); diff -up3r boa-0.94.14rc7/src/get.c boa-0.94.14rc7.modified/src/get.c --- boa-0.94.14rc7/src/get.c Sun Nov 24 17:53:01 2002 +++ boa-0.94.14rc7.modified/src/get.c Mon Dec 9 15:29:21 2002 @@ -420,9 +420,15 @@ int get_dir(request * req, struct stat * data_fd = open(pathname_with_index, O_RDONLY); if (data_fd != -1) { /* user's index file */ - strcpy(req->request_uri, directory_index); /* for mimetype */ - fstat(data_fd, statbuf); - return data_fd; + req->mime_type = get_mime_type(directory_index); + if(strcmp(CGI_MIME_TYPE, req->mime_type) == 0) { + strcpy(req->pathname, pathname_with_index); + req->cgi_type = determine_cgi_type(req, directory_index); + return init_cgi(req); + } else { + fstat(data_fd, statbuf); + return data_fd; + } } if (errno == EACCES) { send_r_forbidden(req); diff -up3r boa-0.94.14rc7/src/globals.h boa-0.94.14rc7.modified/src/globals.h --- boa-0.94.14rc7/src/globals.h Sat Nov 23 09:03:29 2002 +++ boa-0.94.14rc7.modified/src/globals.h Mon Dec 9 15:06:36 2002 @@ -168,6 +168,8 @@ struct request { /* pendi struct mmap_entry *mmap_entry_var; + char * mime_type; + int fd; /* client's socket fd */ time_t time_last; /* time of last succ. op. */ char local_ip_addr[NI_MAXHOST]; /* for virtualhost */ diff -up3r boa-0.94.14rc7/src/response.c boa-0.94.14rc7.modified/src/response.c --- boa-0.94.14rc7/src/response.c Sun Nov 24 17:53:33 2002 +++ boa-0.94.14rc7.modified/src/response.c Mon Dec 9 15:07:22 2002 @@ -49,7 +49,7 @@ char *http_ver_string(enum HTTP_VERSION void print_content_type(request * req) { req_write(req, "Content-Type: "); - req_write(req, get_mime_type(req->request_uri)); + req_write(req, req->mime_type ? req->mime_type : get_mime_type(req->request_uri)); req_write(req, "\r\n"); } |