You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ch...@locus.apache.org on 2000/06/13 03:22:11 UTC
cvs commit: apache-2.0/src/modules/proxy mod_proxy.h proxy_http.c
chuck 00/06/12 18:22:11
Modified: src/modules/proxy mod_proxy.h proxy_http.c
Log:
OK, this builds and is autoconf safe about system headers, until it starts
using APR
Submitted by: Chuck Murcko
Revision Changes Path
1.10 +50 -31 apache-2.0/src/modules/proxy/mod_proxy.h
Index: mod_proxy.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/proxy/mod_proxy.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mod_proxy.h 2000/06/12 21:41:58 1.9
+++ mod_proxy.h 2000/06/13 01:22:09 1.10
@@ -75,13 +75,13 @@
Things to do:
- 1. Make it garbage collect in the background, not while someone is
- waiting for a response!
+ 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.
+ 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 <be...@algroup.co.uk> 30 Mar 96
@@ -103,7 +103,7 @@
*/
-#define TESTING 0
+#define TESTING 0
#undef EXPLAIN
#include "httpd.h"
@@ -113,6 +113,22 @@
#include "explain.h"
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
extern module MODULE_VAR_EXPORT proxy_module;
@@ -121,8 +137,8 @@
enc_path, enc_search, enc_user, enc_fpath, enc_parm
};
-#define HDR_APP (0) /* append header, for proxy_add_header() */
-#define HDR_REP (1) /* replace header, for proxy_add_header() */
+#define HDR_APP (0) /* append header, for proxy_add_header() */
+#define HDR_REP (1) /* replace header, for proxy_add_header() */
#ifdef CHARSET_EBCDIC
#define CRLF "\r\n"
@@ -130,14 +146,14 @@
#define CRLF "\015\012"
#endif /*CHARSET_EBCDIC*/
-#define DEFAULT_FTP_DATA_PORT 20
-#define DEFAULT_FTP_PORT 21
-#define DEFAULT_GOPHER_PORT 70
-#define DEFAULT_NNTP_PORT 119
-#define DEFAULT_WAIS_PORT 210
-#define DEFAULT_HTTPS_PORT 443
-#define DEFAULT_SNEWS_PORT 563
-#define DEFAULT_PROSPERO_PORT 1525 /* WARNING: conflict w/Oracle */
+#define DEFAULT_FTP_DATA_PORT 20
+#define DEFAULT_FTP_PORT 21
+#define DEFAULT_GOPHER_PORT 70
+#define DEFAULT_NNTP_PORT 119
+#define DEFAULT_WAIS_PORT 210
+#define DEFAULT_HTTPS_PORT 443
+#define DEFAULT_SNEWS_PORT 563
+#define DEFAULT_PROSPERO_PORT 1525 /* WARNING: conflict w/Oracle */
#define DEFAULT_CACHE_COMPLETION (0.9)
/* Some WWW schemes and their default ports; this is basically /etc/services */
@@ -148,10 +164,10 @@
/* static information about a remote proxy */
struct proxy_remote {
- const char *scheme; /* the schemes handled by this proxy, or '*' */
- const char *protocol; /* the scheme used to talk to this proxy */
- const char *hostname; /* the hostname of this proxy */
- int port; /* the port for this proxy */
+ const char *scheme; /* the schemes handled by this proxy, or '*' */
+ const char *protocol; /* the scheme used to talk to this proxy */
+ const char *hostname; /* the hostname of this proxy */
+ int port; /* the port for this proxy */
};
struct proxy_alias {
@@ -184,10 +200,9 @@
ap_array_header_t *dirconn;
ap_array_header_t *nocaches;
ap_array_header_t *allowed_connect_ports;
- char *domain; /* domain name to use in absence of
- a domain name in the request */
- int req; /* true if proxy requests are enabled */
- float cache_completion; /* Force cache completion after this point */
+ char *domain; /* domain name to use in absence of a domain name in the request */
+ int req; /* true if proxy requests are enabled */
+ float cache_completion; /* Force cache completion after this point */
enum {
via_off,
via_on,
@@ -195,12 +210,12 @@
via_full
} viaopt; /* how to deal with proxy Via: headers */
size_t recv_buffer_size;
- ap_cache_handle_t *cache;
+ ap_cache_handle_t *cache;
} proxy_server_conf;
typedef struct {
- float cache_completion; /* completion percentage */
- int content_length; /* length of the content */
+ float cache_completion; /* completion percentage */
+ int content_length; /* length of the content */
} proxy_completion;
/* Function prototypes */
@@ -208,7 +223,7 @@
/* proxy_connect.c */
int ap_proxy_connect_handler(request_rec *r, ap_cache_el *c, char *url,
- const char *proxyhost, int proxyport);
+ const char *proxyhost, int proxyport);
/* proxy_ftp.c */
@@ -218,18 +233,18 @@
/* proxy_http.c */
int ap_proxy_http_canon(request_rec *r, char *url, const char *scheme,
- int def_port);
+ int def_port);
int ap_proxy_http_handler(request_rec *r, ap_cache_el *c, char *url,
- const char *proxyhost, int proxyport);
+ const char *proxyhost, int proxyport);
/* proxy_util.c */
int ap_proxy_hex2c(const char *x);
void ap_proxy_c2hex(int ch, char *x);
char *ap_proxy_canonenc(ap_pool_t *p, const char *x, int len, enum enctype t,
- int isenc);
+ int isenc);
char *ap_proxy_canon_netloc(ap_pool_t *p, char **const urlp, char **userp,
- char **passwordp, char **hostp, int *port);
+ char **passwordp, char **hostp, int *port);
const char *ap_proxy_date_canon(ap_pool_t *p, const char *x);
ap_table_t *ap_proxy_read_headers(request_rec *r, char *buffer, int size, BUFF *f);
long int ap_proxy_send_fb(proxy_completion *, BUFF *f, request_rec *r, ap_cache_el *c);
@@ -239,6 +254,10 @@
int ap_proxy_hex2sec(const char *x);
void ap_proxy_sec2hex(int t, char *y);
const char *ap_proxy_host2addr(const char *host, struct hostent *reqhp);
+int ap_proxy_cache_send(request_rec *r, ap_cache_el *c);
+int ap_proxy_cache_should_cache(request_rec *r, ap_table_t *resp_hdrs,
+ const int is_HTTP1);
+int ap_proxy_cache_update(ap_cache_el *c);
void ap_proxy_cache_error(ap_cache_el **r);
int ap_proxyerror(request_rec *r, int statuscode, const char *message);
int ap_proxy_is_ipaddr(struct dirconn_entry *This, ap_pool_t *p);
1.9 +1 -1 apache-2.0/src/modules/proxy/proxy_http.c
Index: proxy_http.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_http.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- proxy_http.c 2000/06/12 21:41:58 1.8
+++ proxy_http.c 2000/06/13 01:22:09 1.9
@@ -456,7 +456,7 @@
ap_bwrite(r->connection->client, buffer, len, &cntr);
if (cachefp && ap_bwrite(cachefp, buffer, len, &cntr) != len) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
- "proxy: error writing extra data to cache", cachefp);
+ "proxy: error writing extra data to cache");
ap_proxy_cache_error(&c);
}
}