Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 88283 invoked by uid 500); 8 Jun 2001 08:53:36 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 88249 invoked by uid 500); 8 Jun 2001 08:53:35 -0000 Delivered-To: apmail-httpd-proxy-cvs@apache.org Date: 8 Jun 2001 08:53:32 -0000 Message-ID: <20010608085332.88231.qmail@apache.org> From: chuck@apache.org To: httpd-proxy-cvs@apache.org Subject: cvs commit: httpd-proxy/module-1.0 proxy_ftp.c proxy_util.c chuck 01/06/08 01:53:32 Modified: module-1.0 proxy_ftp.c proxy_util.c Log: Changes in 1.3.20 and 1.3.21-dev (3 of 3) Revision Changes Path 1.3 +16 -6 httpd-proxy/module-1.0/proxy_ftp.c Index: proxy_ftp.c =================================================================== RCS file: /home/cvs/httpd-proxy/module-1.0/proxy_ftp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- proxy_ftp.c 2001/06/08 07:39:07 1.2 +++ proxy_ftp.c 2001/06/08 08:53:29 1.3 @@ -1138,9 +1138,16 @@ ap_table_setn(resp_hdrs, "Date", ap_gm_timestr_822(r->pool, r->request_time)); ap_table_setn(resp_hdrs, "Server", ap_get_server_version()); - if (parms[0] == 'd') + if (parms[0] == 'd') { ap_table_setn(resp_hdrs, "Content-Type", "text/html"); +#ifdef CHARSET_EBCDIC + r->ebcdic.conv_out = 1; /* server-generated */ +#endif + } else { +#ifdef CHARSET_EBCDIC + r->ebcdic.conv_out = 0; /* do not convert what we read from the ftp server */ +#endif if (r->content_type != NULL) { ap_table_setn(resp_hdrs, "Content-Type", r->content_type); Explain1("FTP: Content-Type set to %s", r->content_type); @@ -1206,30 +1213,33 @@ ap_bpushfd(data, dsock, dsock); } + ap_hard_timeout("proxy receive", r); + /* send response */ /* write status line and headers to the cache file */ ap_proxy_write_headers(c, ap_pstrcat(p, "HTTP/1.1 ", r->status_line, NULL), resp_hdrs); - + /* Setup the headers for our client from upstreams response-headers */ ap_overlap_tables(r->headers_out, resp_hdrs, AP_OVERLAP_TABLES_SET); /* Add X-Cache header */ ap_table_setn(r->headers_out, "X-Cache", ap_pstrcat(r->pool, "MISS from ", - ap_get_server_name(r), NULL)); + ap_get_server_name(r), NULL)); /* The Content-Type of this response is the upstream one. */ r->content_type = ap_table_get (r->headers_out, "Content-Type"); /* finally output the headers to the client */ ap_send_http_header(r); - - ap_hard_timeout("proxy receive", r); +#ifdef CHARSET_EBCDIC + ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, r->ebcdic.conv_out); +#endif /* send body */ if (!r->header_only) { if (parms[0] != 'd') { /* we need to set this for ap_proxy_send_fb()... */ if (c != NULL) c->cache_completion = 0; - ap_proxy_send_fb(data, r, c, -1, 0); + ap_proxy_send_fb(data, r, c, -1, 0); } else send_dir(data, r, c, cwd); 1.3 +10 -9 httpd-proxy/module-1.0/proxy_util.c Index: proxy_util.c =================================================================== RCS file: /home/cvs/httpd-proxy/module-1.0/proxy_util.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- proxy_util.c 2001/06/08 07:39:10 1.2 +++ proxy_util.c 2001/06/08 08:53:29 1.3 @@ -1312,13 +1312,13 @@ { cache_req *c = (cache_req *)p; - if (key == NULL || value == NULL || value[0] == '\0') - return 1; - if (c->fp != NULL && + if (key == NULL || value == NULL || value[0] == '\0') + return 1; + if (c->fp != NULL && ap_bvputs(c->fp, key, ": ", value, CRLF, NULL) == -1) { ap_log_rerror(APLOG_MARK, APLOG_ERR, c->req, "proxy: error writing header to %s", c->tempfile); - c = ap_proxy_cache_error(c); + c = ap_proxy_cache_error(c); return 0; /* no need to continue, it failed already */ } return 1; /* tell ap_table_do() to continue calling us for more headers */ @@ -1422,10 +1422,10 @@ /* XXX: if you tweak this you should look at is_empty_table() and table_elts() * in ap_alloc.h - * + * * NOTE: this private definition is a duplicate of the one in alloc.c * It's here for ap_proxy_table_replace() to avoid breaking binary compat - */ + */ struct table { /* This has to be first to promote backwards compatibility with * older modules which cast a table * to an array_header *... @@ -1436,10 +1436,11 @@ #ifdef MAKE_TABLE_PROFILE void *creator; #endif -}; +}; -/* overlay one table on another - keys in base will be replaced by keys in overl -ay */ +/* overlay one table on another + * keys in base will be replaced by keys in overlay + */ int ap_proxy_table_replace(table *base, table *overlay) { table_entry *elts = (table_entry *) overlay->a.elts;