cvs commit: apache-1.3/src/modules/standard mod_setenvif.c
coar99/05/19 06:26:10 Modified:.STATUS htdocs/manual/mod mod_setenvif.html src CHANGES src/modules/standard mod_setenvif.c Log: Allow SetEnvIf* to set things according to the protocol of the request. Revision ChangesPath 1.688 +1 -5 apache-1.3/STATUS Index: STATUS === RCS file: /home/cvs/apache-1.3/STATUS,v retrieving revision 1.687 retrieving revision 1.688 diff -u -r1.687 -r1.688 --- STATUS1999/05/17 18:02:51 1.687 +++ STATUS1999/05/19 13:26:03 1.688 @@ -1,5 +1,5 @@ 1.3 STATUS: - Last modified at [$Date: 1999/05/17 18:02:51 $] + Last modified at [$Date: 1999/05/19 13:26:03 $] Release: @@ -132,10 +132,6 @@ * Ronald Tschalär's major update of mod_digest Message-ID: [EMAIL PROTECTED] Status: Big change -- needs review. - -* Ken's patch to add the request protocol to things mod_setenvif can test - Message-ID: [EMAIL PROTECTED] - Status: Ken +1 In progress: 1.6 +6 -1 apache-1.3/htdocs/manual/mod/mod_setenvif.html Index: mod_setenvif.html === RCS file: /home/cvs/apache-1.3/htdocs/manual/mod/mod_setenvif.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- mod_setenvif.html 1998/05/28 14:06:54 1.5 +++ mod_setenvif.html 1999/05/19 13:26:06 1.6 @@ -260,7 +260,8 @@ A HREF=directive-dict.html#Compatibility REL=Help - STRONGCompatibility:/STRONG/A Apache 1.3 and above + STRONGCompatibility:/STRONG/A Apache 1.3 and above; the + Request_Protocol keyword is only available with 1.3.7 and later /P P The SAMPSetEnvIf/SAMP directive defines environment variables @@ -284,6 +285,10 @@ /LI LISAMPRequest_Method/SAMP - the name of the method being used (SAMPGET/SAMP, SAMPPOST/SAMP, EMet cetera/EM) + /LI + LISAMPRequest_Protocol/SAMP - the name and version of the protocol +with which the request was made (EMe.g./EM, HTTP/0.9, HTTP/1.1, +EMetc./EM) /LI LISAMPRequest_URI/SAMP - the portion of the URL following the scheme and host portion 1.1360+4 -0 apache-1.3/src/CHANGES Index: CHANGES === RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1359 retrieving revision 1.1360 diff -u -r1.1359 -r1.1360 --- CHANGES 1999/05/17 08:00:02 1.1359 +++ CHANGES 1999/05/19 13:26:07 1.1360 @@ -1,5 +1,9 @@ Changes with Apache 1.3.7 + *) Add 'Request_Protocol' special keyword to mod_setenvif so that + environment variables can be set according to the protocol version + (e.g., HTTP/0.9 or HTTP/1.1) of the request. [Ken Coar] + *) Add DSO support for OpenStep (Mach 4.2) platform. [Ralf S. Engelschall, Rex Dieter [EMAIL PROTECTED]] PR#3997 1.27 +8 -1 apache-1.3/src/modules/standard/mod_setenvif.c Index: mod_setenvif.c === RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_setenvif.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- mod_setenvif.c1999/01/01 19:05:13 1.26 +++ mod_setenvif.c1999/05/19 13:26:09 1.27 @@ -125,7 +125,8 @@ SPECIAL_REMOTE_HOST, SPECIAL_REMOTE_USER, SPECIAL_REQUEST_URI, -SPECIAL_REQUEST_METHOD +SPECIAL_REQUEST_METHOD, +SPECIAL_REQUEST_PROTOCOL }; typedef struct { char *name; /* header name */ @@ -241,6 +242,9 @@ else if (!strcasecmp(fname, request_method)) { new-special_type = SPECIAL_REQUEST_METHOD; } + else if (!strcasecmp(fname, request_protocol)) { + new-special_type = SPECIAL_REQUEST_PROTOCOL; + } else { new-special_type = SPECIAL_NOT; } @@ -354,6 +358,9 @@ break; case SPECIAL_REQUEST_METHOD: val = r-method; + break; + case SPECIAL_REQUEST_PROTOCOL: + val = r-protocol; break; case SPECIAL_NOT: val = ap_table_get(r-headers_in, b-name);
cvs commit: apache-apr/apr/network_io/unix poll.c
rbb 99/05/19 08:17:18 Modified:include apr_network_io.h apr/network_io/unix poll.c Log: Fixed some msitakes in ap_poll logic and added some more accessor functions. Revision ChangesPath 1.19 +2 -0 apache-apr/include/apr_network_io.h Index: apr_network_io.h === RCS file: /home/cvs/apache-apr/include/apr_network_io.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- apr_network_io.h 1999/05/12 19:46:14 1.18 +++ apr_network_io.h 1999/05/19 15:17:16 1.19 @@ -114,6 +114,8 @@ ap_pollfd_t *ap_setup_poll(ap_context_t *, ap_int32_t); ap_int32_t ap_poll(ap_context_t *, ap_pollfd_t *, ap_int32_t, ap_int32_t); void ap_add_poll_socket(ap_context_t *, ap_pollfd_t *, ap_socket_t *, ap_int16_t, ap_int32_t); +ap_int16_t ap_get_revents(ap_context_t *, ap_pollfd_t *, ap_int32_t); + /* accessor functions */ #ifdef __cplusplus 1.5 +27 -2 apache-apr/apr/network_io/unix/poll.c Index: poll.c === RCS file: /home/cvs/apache-apr/apr/network_io/unix/poll.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- poll.c1999/05/12 19:46:17 1.4 +++ poll.c1999/05/19 15:17:17 1.5 @@ -87,6 +87,26 @@ return rv; } +ap_int16_t get_revent(ap_int16_t event) +{ +ap_int16_t rv = 0; + +if (event POLLIN) +rv |= APR_POLLIN; +if (event POLLPRI) +rv |= APR_POLLPRI; +if (event POLLOUT) +rv |= APR_POLLOUT; +if (event POLLERR) +rv |= APR_POLLERR; +if (event POLLHUP) +rv |= APR_POLLHUP; +if (event POLLNVAL) +rv |= APR_POLLNVAL; + +return rv; +} + void ap_add_poll_socket(ap_context_t *cont, struct pollfd_t *aprset, struct socket_t *sock, ap_int16_t event, ap_int32_t pos) @@ -108,11 +128,16 @@ pollset[i].events = aprset[i].events; } -rv = poll(pollset, nsds, timeout); +rv = poll(pollset, nsds, timeout * 1000); for (i = 0; i nsds; i++) { -pollset[i].revents = aprset[i].revents; +aprset[i].revents = get_revent(pollset[i].revents); } return rv; +} + +ap_int16_t ap_get_revents(ap_context_t *cont, struct pollfd_t *aprset, ap_int32_t pos) +{ +return aprset[pos].revents; }
cvs commit: apache-apr/apr/test Makefile.in ab_apr.c
rbb 99/05/19 09:37:58 Modified:apr/test Makefile.in ab_apr.c Log: Bring ab_apr back to working state with the current apr layer. Revision ChangesPath 1.5 +5 -0 apache-apr/apr/test/Makefile.in Index: Makefile.in === RCS file: /home/cvs/apache-apr/apr/test/Makefile.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Makefile.in 1999/05/17 13:11:51 1.4 +++ Makefile.in 1999/05/19 16:37:56 1.5 @@ -17,12 +17,14 @@ testproc \ testsock \ testthread \ + ab \ testtime OBJS= testfile.o \ testproc.o \ testsock.o \ testthread.o \ + ab_apr.o \ testtime.o .c.o: @@ -32,6 +34,9 @@ testfile: testfile.o $(CC) $(CFLAGS) testfile.o -o testfile $(LDFLAGS) + +ab: ab_apr.o + $(CC) $(CFLAGS) ab_apr.o -o ab $(LDFLAGS) testproc: testproc.o $(CC) $(CFLAGS) testproc.o -o testproc $(LDFLAGS) 1.7 +35 -21apache-apr/apr/test/ab_apr.c Index: ab_apr.c === RCS file: /home/cvs/apache-apr/apr/test/ab_apr.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ab_apr.c 1999/05/18 12:19:36 1.6 +++ ab_apr.c 1999/05/19 16:37:56 1.7 @@ -478,21 +478,29 @@ c-cbx = 0; c-gotheader = 0; -if ((c-aprsock = ap_create_tcp_socket(cntxt)) == NULL) +if ((c-aprsock = ap_create_tcp_socket(cntxt)) == NULL) { err(Socket:); +} +if (ap_setport(cntxt, c-aprsock, port) == APR_FAILURE) { +err(Port:); +} nonblock(c-aprsock); gettimeofday(c-start, 0); -if (ap_connect(cntxt, c-aprsock, hostname)) { -return; -} -else { -/*we don't have to close the socket. If we have an error this bad, - ap_connect will destroy it for us. */ -err_conn++; -if (bad++ 10) { -err(\nTest aborted after 10 failures\n\n); +if (ap_connect(cntxt, c-aprsock, hostname) == APR_FAILURE) { +if (errno == EINPROGRESS) { +c-state = STATE_CONNECTING; +ap_add_poll_socket(cntxt, readbits, c-aprsock, APR_POLLOUT, c-socknum); +return; } -start_connect(c); +else { +/* we don't have to close the socket. If we have an error this bad, + ap_connect will destroy it for us. */ +err_conn++; +if (bad++ 10) { +err(\nTest aborted after 10 failures\n\n); +} +start_connect(c); +} } printf(Writing request...\n); /* connected first time */ @@ -692,8 +700,9 @@ static void test(void) { -struct timeval timeout, now; - +struct timeval now; +time_t timeout; +ap_int16_t rv; int i; if (!use_html) { @@ -749,8 +758,10 @@ gettimeofday(start, 0); /* initialise lots of requests */ -for (i = 0; i concurrency; i++) +for (i = 0; i concurrency; i++) { +con[i].socknum = i; start_connect(con[i]); +} while (done requests) { ap_int32_t n; @@ -761,10 +772,9 @@ requests = done; /* so stats are correct */ } /* Timeout of 30 seconds. */ -timeout.tv_sec = 30; -timeout.tv_usec = 0; +timeout = 30; -n = ap_poll(cntxt, readbits, concurrency, timeout); +n = ap_poll(cntxt, readbits, concurrency, timeout); if (!n) { err(\nServer timed out\n\n); @@ -773,16 +783,18 @@ err(select); for (i = 0; i concurrency; i++) { -ap_pollfd_t *s = readbits[con[i].socknum]; -if ( == APR_SUCCESS) { +printf(rv == %d\n, rv); +rv = ap_get_revents(cntxt, readbits, con[i].socknum); +printf(rv == %d\n, rv); +if ((rv APR_POLLERR) || (rv APR_POLLNVAL) || (rv APR_POLLHUP)) { bad++; err_except++; start_connect(con[i]); continue; } -if (ap_sd_isset(s, sel_read) == APR_SUCCESS) +if ((rv APR_POLLIN) || (rv APR_POLLPRI)) read_connection(con[i]); -if (ap_sd_isset(s, sel_write) == APR_SUCCESS) +if (rv APR_POLLOUT) write_request(con[i]); } } @@ -905,6 +917,8 @@ tablestring = ; trstring = ; tdstring = bgcolor=white; + +cntxt = ap_initialize(NULL); optind = 1; while ((c = getopt(argc, argv, n:c:t:T:p:v:kVhwx:y:z:)) 0) {