cvs commit: apache/src/modules/proxy mod_proxy.h proxy_cache.c proxy_ftp.c proxy_http.c
fielding97/08/15 10:08:58 Modified:src Tag: APACHE_1_2_X CHANGES http_protocol.c src/modules/proxy Tag: APACHE_1_2_X mod_proxy.h proxy_cache.c proxy_ftp.c proxy_http.c Log: Force proxy to always respond as HTTP/1.0, which it was failing to do for errors and cached responses. Revision ChangesPath No revision No revision 1.286.2.46 +3 -0 apache/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.286.2.45 retrieving revision 1.286.2.46 diff -u -r1.286.2.45 -r1.286.2.46 --- CHANGES 1997/08/12 11:58:58 1.286.2.45 +++ CHANGES 1997/08/15 17:08:50 1.286.2.46 @@ -1,6 +1,9 @@ Changes with Apache 1.2.3 + *) Force proxy to always respond as HTTP/1.0, which it was failing to + do for errors and cached responses. [Roy Fielding] + Changes with Apache 1.2.2 [not released] *) Fixed another long-standing bug in sub_req_lookup_file where it would 1.126.2.6 +9 -2 apache/src/http_protocol.c Index: http_protocol.c === RCS file: /export/home/cvs/apache/src/http_protocol.c,v retrieving revision 1.126.2.5 retrieving revision 1.126.2.6 diff -u -r1.126.2.5 -r1.126.2.6 --- http_protocol.c 1997/07/31 08:19:48 1.126.2.5 +++ http_protocol.c 1997/08/15 17:08:51 1.126.2.6 @@ -1044,9 +1044,16 @@ if (!r->status_line) r->status_line = status_lines[index_of_response(r->status)]; -if (r->proto_num == 1000 - && table_get(r->subprocess_env,"force-response-1.0")) +/* mod_proxy is only HTTP/1.0, so avoid sending HTTP/1.1 error response; + * kluge around broken browsers when indicated by force-response-1.0 + */ +if (r->proxyreq + || (r->proto_num == 1000 + && table_get(r->subprocess_env,"force-response-1.0"))) { + protocol = "HTTP/1.0"; + r->connection->keepalive = -1; +} else protocol = SERVER_PROTOCOL; No revision No revision 1.11.2.1 +1 -1 apache/src/modules/proxy/mod_proxy.h Index: mod_proxy.h === RCS file: /export/home/cvs/apache/src/modules/proxy/mod_proxy.h,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -r1.11 -r1.11.2.1 --- mod_proxy.h 1997/04/16 00:13:05 1.11 +++ mod_proxy.h 1997/08/15 17:08:54 1.11.2.1 @@ -225,7 +225,7 @@ int proxy_cache_check(request_rec *r, char *url, struct cache_conf *conf, struct cache_req **cr); int proxy_cache_update(struct cache_req *c, array_header *resp_hdrs, -const char *protocol, int nocache); +const int is_HTTP1, int nocache); void proxy_garbage_coll(request_rec *r); /* proxy_connect.c */ 1.13.2.1 +2 -3 apache/src/modules/proxy/proxy_cache.c Index: proxy_cache.c === RCS file: /export/home/cvs/apache/src/modules/proxy/proxy_cache.c,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -u -r1.13 -r1.13.2.1 --- proxy_cache.c 1997/05/29 15:16:01 1.13 +++ proxy_cache.c 1997/08/15 17:08:55 1.13.2.1 @@ -581,7 +581,7 @@ */ int proxy_cache_update(struct cache_req *c, array_header *resp_hdrs, - const char *protocol, int nocache) + const int is_HTTP1, int nocache) { request_rec *r=c->req; char *p; @@ -632,8 +632,7 @@ if ((r->status != 200 && r->status != 301 && r->status != 304) || (expire != NULL && expc == BAD_DATE) || (r->status == 304 && c->fp == NULL) || - (r->status == 200 && lmods == NULL && - strncmp(protocol, "HTTP/1.", 7) == 0) || + (r->status == 200 && lmods == NULL && is_HTTP1) || r->header_only || table_get(r->headers_in, "Authorization") != NULL || nocache) 1.21.2.1 +1 -1 apache/src/modules/proxy/proxy_ftp.c Index: proxy_ftp.c === RCS file: /export/home/cvs/apache/src/modules/proxy/proxy_ftp.c,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -u -r1.21 -r1.21.2.1 --- proxy_ftp.c 1997/04/22 03:29:37 1.21 +++ proxy_ftp.c 1997/08/15 17:08:55 1.21.2.1 @@ -908,7 +908,7 @@ nocache = 1; } -i = proxy_cache_update(c, resp_hdrs, "FTP", nocache); +i = proxy_cache_update(c, resp_hdrs, 0, nocache); if (i != DECLINED) { 1.17.2.2 +12 -14apache/src/modules/proxy/proxy_http.c Index: proxy_http.c ===
cvs commit: apache/src/modules/proxy mod_proxy.h
chuck 97/04/15 17:13:06 Modified:src/modules/proxy mod_proxy.h Log: Clean up TODO list; fix mailing address. Revision ChangesPath 1.11 +2 -4 apache/src/modules/proxy/mod_proxy.h Index: mod_proxy.h === RCS file: /export/home/cvs/apache/src/modules/proxy/mod_proxy.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C3 -r1.10 -r1.11 *** mod_proxy.h 1997/04/11 05:10:50 1.10 --- mod_proxy.h 1997/04/16 00:13:05 1.11 *** *** 88,98 4. Use a cache expiry database for more efficient GC (Jeremy Wohl) ! 5. Handle multiple IPs for doconnect() ! 6. Bulletproof GC against SIGALRM ! ! Chuck Murcko <[EMAIL PROTECTED]> 1 Oct 96 */ --- 88,96 4. Use a cache expiry database for more efficient GC (Jeremy Wohl) ! 5. Bulletproof GC against SIGALRM ! Chuck Murcko <[EMAIL PROTECTED]> 15 April 1997 */
cvs commit: apache/src/modules/proxy mod_proxy.h proxy_cache.c proxy_ftp.c proxy_http.c proxy_util.c
fielding97/03/20 10:40:18 Modified:src CHANGES src/modules/proxy mod_proxy.h proxy_cache.c proxy_ftp.c proxy_http.c proxy_util.c Log: In the proxy, if the cache filesystem was full, garbage_coll() was never called, and thus the filesystem would remain full indefinitely. We now also remove incomplete cache files left if the origin server didn't send a Content-Length header and either the client has aborted transfer or bwrite() to client has failed. Submitted by: Petr Lampa Reviewed by: Chuck Murcko, Roy Fielding Revision ChangesPath 1.207 +6 -0 apache/src/CHANGES Index: CHANGES === RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.206 retrieving revision 1.207 diff -C3 -r1.206 -r1.207 *** CHANGES 1997/03/20 18:03:33 1.206 --- CHANGES 1997/03/20 18:40:11 1.207 *** *** 1,5 --- 1,11 Changes with Apache 1.2b8 + *) In the proxy, if the cache filesystem was full, garbage_coll() was + never called, and thus the filesystem would remain full indefinitely. + We now also remove incomplete cache files left if the origin server + didn't send a Content-Length header and either the client has aborted + transfer or bwrite() to client has failed. [Petr Lampa] + *) Fixed the handling of module and script-added header fields. Improved the interface for sending header fields and reduced the duplication of code between sending okay responses and errors. 1.9 +1 -0 apache/src/modules/proxy/mod_proxy.h Index: mod_proxy.h === RCS file: /export/home/cvs/apache/src/modules/proxy/mod_proxy.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C3 -r1.8 -r1.9 *** mod_proxy.h 1997/03/02 05:05:22 1.8 --- mod_proxy.h 1997/03/20 18:40:14 1.9 *** *** 228,233 --- 228,234 struct cache_req **cr); int proxy_cache_update(struct cache_req *c, array_header *resp_hdrs, const char *protocol, int nocache); + void proxy_garbage_coll(request_rec *r); /* proxy_connect.c */ 1.10 +6 -2 apache/src/modules/proxy/proxy_cache.c Index: proxy_cache.c === RCS file: /export/home/cvs/apache/src/modules/proxy/proxy_cache.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C3 -r1.9 -r1.10 *** proxy_cache.c 1997/01/20 04:28:32 1.9 --- proxy_cache.c 1997/03/20 18:40:15 1.10 *** *** 88,94 static int sub_garbage_coll(request_rec *r,array_header *files, const char *cachedir,const char *cachesubdir); ! static void garbage_coll(request_rec *r) { const char *cachedir; void *sconf = r->server->module_config; --- 88,94 static int sub_garbage_coll(request_rec *r,array_header *files, const char *cachedir,const char *cachesubdir); ! void proxy_garbage_coll(request_rec *r) { const char *cachedir; void *sconf = r->server->module_config; *** *** 835,840 --- 835,845 return; } } else + if (c->req->connection->aborted) { + pclosef(c->req->pool, c->fp->fd); /* no need to flush */ + unlink(c->tempfile); + return; + } else { /* update content-length of file */ char buff[9]; *** *** 909,914 "proxy: error deleting temp file",s); #endif - garbage_coll(c->req); } --- 914,918 1.12 +2 -0 apache/src/modules/proxy/proxy_ftp.c Index: proxy_ftp.c === RCS file: /export/home/cvs/apache/src/modules/proxy/proxy_ftp.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C3 -r1.11 -r1.12 *** proxy_ftp.c 1997/02/24 05:37:54 1.11 --- proxy_ftp.c 1997/03/20 18:40:15 1.12 *** *** 878,883 --- 878,885 pclosef(pool, dsock); pclosef(pool, sock); + proxy_garbage_coll(r); + return OK; } 1.15 +1 -0 apache/src/modules/proxy/proxy_http.c Index: proxy_http.c === RCS file: /export/home/cvs/apache/src/modules/proxy/proxy_http.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C3 -r1.14 -r1.15 *** proxy_http.c 1997/02/20 05:16:25 1.14 --- proxy_http.c 1997/03/20 18:40:15 1.15 *** *** 395,400 --- 395,401
cvs commit: apache/src/modules/proxy mod_proxy.h
chuck 96/12/24 12:22:46 Modified:src/modules/proxy mod_proxy.h Log: Revise TBD list. Revision ChangesPath 1.5 +8 -13 apache/src/modules/proxy/mod_proxy.h Index: mod_proxy.h === RCS file: /export/home/cvs/apache/src/modules/proxy/mod_proxy.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C3 -r1.4 -r1.5 *** mod_proxy.h 1996/10/27 18:29:56 1.4 --- mod_proxy.h 1996/12/24 20:22:45 1.5 *** *** 78,105 More things to do: ! 0. Code cleanup ! 1. add 230 response output and PASV mode for ftp now that it works 2. Add gopher & WAIS ! 3. Various other fixups to insure no NULL strings parsed, etc. ! ! 4. NoProxy directive for excluding sites to proxy ! ! 5. Imply NoCache * if cache directory is not configured, to enable proxy !without cache (and avoid SIGSEGV) ! 6. Use protocol handler struct a la Apache module handlers (Dirk van Gulik) ! 7. Use a cache expiry database for more efficient GC (Jeremy Wohl) ! 8. Handle multiple IPs for doconnect() ! 9. Bulletproof GC against SIGALRM ! 10. Make HTTPS and SNEWS ports configurable from a list Chuck Murcko <[EMAIL PROTECTED]> 1 Oct 96 --- 78,100 More things to do: ! 0. Code cleanup (ongoing) ! 1. add 230 response output for ftp now that it works 2. Add gopher & WAIS ! 3. NoProxy directive for excluding sites to proxy ! 4. Use protocol handler struct a la Apache module handlers (Dirk van Gulik) ! 5. Use a cache expiry database for more efficient GC (Jeremy Wohl) ! 6. Handle multiple IPs for doconnect() ! 7. Bulletproof GC against SIGALRM ! 8. Make HTTPS and SNEWS ports configurable from a list Chuck Murcko <[EMAIL PROTECTED]> 1 Oct 96
cvs commit: apache/src/modules/proxy mod_proxy.h proxy_cache.c proxy_connect.c proxy_ftp.c proxy_http.c proxy_util.c Makefile mod_proxy.c
chuck 96/10/01 00:11:48 Modified:src/modules/proxy Makefile mod_proxy.c Added: src/modules/proxy mod_proxy.h proxy_cache.c proxy_connect.c proxy_ftp.c proxy_http.c proxy_util.c Log: Phase II - The Great Proxy Reorganization Layout with protocol abstraction, daemon gc in mind. Revision ChangesPath 1.3 +15 -11apache/src/modules/proxy/Makefile Index: Makefile === RCS file: /export/home/cvs/apache/src/modules/proxy/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C3 -r1.2 -r1.3 *** Makefile 1996/09/29 13:58:55 1.2 --- Makefile 1996/10/01 07:11:41 1.3 *** *** 50,56 # # Makefile for the Apache proxy library # ! # $Id: Makefile,v 1.2 1996/09/29 13:58:55 chuck Exp $ # SHELL = /bin/sh --- 50,56 # # Makefile for the Apache proxy library # ! # $Id: Makefile,v 1.3 1996/10/01 07:11:41 chuck Exp $ # SHELL = /bin/sh *** *** 59,70 LIB=libproxy.a ! # define -DEXPLAIN if you want verbose debugging output CFLAGS=-I. -I$(INCDIR) $(AUX_CFLAGS) # Internal stuff, should not need changing. ! OBJS=mod_proxy.o ! PROXYSRC=mod_proxy.c default:$(LIB) --- 59,73 LIB=libproxy.a ! # AUX_CFLAGS comes from higher level Makefile CFLAGS=-I. -I$(INCDIR) $(AUX_CFLAGS) # Internal stuff, should not need changing. ! OBJS=mod_proxy.o proxy_cache.o proxy_connect.o proxy_ftp.o proxy_http.o \ ! proxy_util.o ! ! PROXYSRC=mod_proxy.c proxy_cache.c proxy_connect.c proxy_ftp.c proxy_http.c \ ! proxy_util.c default:$(LIB) *** *** 74,86 $(RANLIB) $@ # dependencies ! mod_proxy.o: $(INCDIR)/http_log.h ! mod_proxy.o: $(INCDIR)/http_main.h ! mod_proxy.o: $(INCDIR)/http_protocol.h ! mod_proxy.o: $(INCDIR)/http_config.h ! mod_proxy.o: $(INCDIR)/httpd.h ! mod_proxy.o: $(INCDIR)/md5.h ! mod_proxy.o: $(INCDIR)/explain.h # various forms of cleanup tidy: --- 77,90 $(RANLIB) $@ # dependencies ! mod_proxy.o proxy_cache.o proxy_connect.o proxy_ftp.o proxy_http.o \ ! proxy_util.o: mod_proxy.h ! mod_proxy.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h ! proxy_cache.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h $(INCDIR)/md5.h ! proxy_connect.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h ! proxy_ftp.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h ! proxy_http.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h ! proxy_util.o: $(INCDIR)/httpd.h $(INCDIR)/http_config.h $(INCDIR)/md5.h # various forms of cleanup tidy: 1.3 +51 -3052 apache/src/modules/proxy/mod_proxy.c Index: mod_proxy.c === RCS file: /export/home/cvs/apache/src/modules/proxy/mod_proxy.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C3 -r1.2 -r1.3 *** mod_proxy.c 1996/09/29 14:10:58 1.2 --- mod_proxy.c 1996/10/01 07:11:42 1.3 *** *** 50,197 * */ ! /* $Id: mod_proxy.c,v 1.2 1996/09/29 14:10:58 chuck Exp $ */ ! /* ! Note that the Explain() stuff is not yet complete. ! Also note numerous FIXMEs and CHECKMEs which should be eliminated. ! ! If TESTING is set, then garbage collection doesn't delete ... probably a good ! idea when hacking. ! ! This code is still experimental! ! ! Things to do: ! ! 1. Make it garbage collect in the background, not while someone is waiting for ! a response! ! ! 2. Check the logic thoroughly. ! ! 3. Empty directories are only removed the next time round (but this does avoid ! two passes). Consider doing them the first time round. ! ! Ben Laurie <[EMAIL PROTECTED]> 30 Mar 96 ! ! More things to do: ! ! 0. Massive code cleanup & break into multiple files; link as a lib ! ! 1. add PASV mode for ftp now that it works ! ! 2. Add gopher & WAIS ! ! 3. Various other fixups to insure no NULL strings parsed, etc. ! ! 4. NoProxy directive for excluding sites to proxy ! ! 5. Imply NoCache * if cache directory is not configured, to enable proxy !without cache (and avoid SIGSEGV) ! ! 6. Implement protocol handler struct a la Apache module handlers ! ! 7. Use a cache expiry database for more efficient GC ! ! 8. Handle multiple IPs for doconnect() ! ! 9. Bulletproof GC against SIGALRM ! ! Chuck Murcko <[EMAIL PROTECTED]> 28 Sep 96 ! ! */ ! ! #define TESTING 0 ! #undef EXPLAIN ! ! #include "httpd.h" ! #include "http_config.h" ! #include "http_log.h" ! #include "http_main.h" ! #include "http_protocol.h" ! ! #include "md5.h" ! ! #include ! ! #include "explain.h" !