cvs commit: apache-1.3/src/os/bs2000 os.c
martin 98/02/03 08:55:31 Modified:src/os/bs2000 os.c Log: EBCDIC-Portability: include httpd.h first Revision ChangesPath 1.3 +1 -0 apache-1.3/src/os/bs2000/os.c Index: os.c === RCS file: /home/cvs/apache-1.3/src/os/bs2000/os.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -u -r1.2 -r1.3 --- os.c 1998/01/26 16:46:16 1.2 +++ os.c 1998/02/03 16:55:30 1.3 @@ -56,6 +56,7 @@ * Any inlineable functions should be defined in os-inline.c instead. */ +#include "httpd.h" #include "os.h" /* Check the Content-Type to decide if conversion is needed */
cvs commit: apache-1.3/src/os/bs2000 os.c
martin 98/09/14 09:12:20 Modified:src/modules/proxy proxy_connect.c src/os/bs2000 os.c Log: src/modules/proxy/proxy_connect.c Revision ChangesPath 1.33 +2 -2 apache-1.3/src/modules/proxy/proxy_connect.c Index: proxy_connect.c === RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_connect.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- proxy_connect.c 1998/09/08 21:15:56 1.32 +++ proxy_connect.c 1998/09/14 16:12:14 1.33 @@ -159,10 +159,10 @@ case DEFAULT_SNEWS_PORT: break; default: - return HTTP_SERVICE_UNAVAILABLE; + return HTTP_FORBIDDEN; } } else if(!allowed_port(conf, port)) - return HTTP_SERVICE_UNAVAILABLE; + return HTTP_FORBIDDEN; if (proxyhost) { Explain2("CONNECT to remote proxy %s on port %d", proxyhost, proxyport); 1.9 +15 -10apache-1.3/src/os/bs2000/os.c Index: os.c === RCS file: /export/home/cvs/apache-1.3/src/os/bs2000/os.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- os.c 1998/05/08 09:51:54 1.8 +++ os.c 1998/09/14 16:12:18 1.9 @@ -61,12 +61,14 @@ */ #include "httpd.h" +#include "http_core.h" #include "os.h" /* Check the Content-Type to decide if conversion is needed */ int ap_checkconv(struct request_rec *r) { int convert_to_ascii; +const char *type; /* To make serving of "raw ASCII text" files easy (they serve faster * since they don't have to be converted from EBCDIC), a new @@ -76,21 +78,24 @@ * set a flag that translation is required later on. */ +type = (r->content_type == NULL) ? ap_default_type(r) : r->content_type; + /* If no content type is set then treat it as (ebcdic) text/plain */ -convert_to_ascii = (r->content_type == NULL); +convert_to_ascii = (type == NULL); /* Conversion is applied to text/ files only, if ever. */ -if (r->content_type && - (strncmp(r->content_type, "text/", 5) == 0 - || strncmp(r->content_type, "message/", 8) == 0)) { -if (strncmp(r->content_type, ASCIITEXT_MAGIC_TYPE_PREFIX, -sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1) == 0) -r->content_type = ap_pstrcat(r->pool, "text/", -r->content_type+sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1, NULL); +if (type && (strncasecmp(type, "text/", 5) == 0 || + strncasecmp(type, "message/", 8) == 0)) { + if (strncasecmp(type, ASCIITEXT_MAGIC_TYPE_PREFIX, + sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1) == 0) + r->content_type = ap_pstrcat(r->pool, "text/", + type+sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1, + NULL); else -/* translate EBCDIC to ASCII */ -convert_to_ascii = 1; + /* translate EBCDIC to ASCII */ + convert_to_ascii = 1; } +/* Enable conversion if it's a text document */ ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert_to_ascii); return convert_to_ascii;
cvs commit: apache-1.3/src/os/bs2000 os.c
martin 98/09/14 09:24:52 Modified:src/os/bs2000 os.c Log: Try to fix missing use of DefaultType for EBCDIC conversion decision Revision ChangesPath 1.11 +15 -10apache-1.3/src/os/bs2000/os.c Index: os.c === RCS file: /export/home/cvs/apache-1.3/src/os/bs2000/os.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- os.c 1998/09/14 16:22:24 1.10 +++ os.c 1998/09/14 16:24:51 1.11 @@ -61,12 +61,14 @@ */ #include "httpd.h" +#include "http_core.h" #include "os.h" /* Check the Content-Type to decide if conversion is needed */ int ap_checkconv(struct request_rec *r) { int convert_to_ascii; +const char *type; /* To make serving of "raw ASCII text" files easy (they serve faster * since they don't have to be converted from EBCDIC), a new @@ -76,21 +78,24 @@ * set a flag that translation is required later on. */ +type = (r->content_type == NULL) ? ap_default_type(r) : r->content_type; + /* If no content type is set then treat it as (ebcdic) text/plain */ -convert_to_ascii = (r->content_type == NULL); +convert_to_ascii = (type == NULL); /* Conversion is applied to text/ files only, if ever. */ -if (r->content_type && - (strncmp(r->content_type, "text/", 5) == 0 - || strncmp(r->content_type, "message/", 8) == 0)) { -if (strncmp(r->content_type, ASCIITEXT_MAGIC_TYPE_PREFIX, -sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1) == 0) -r->content_type = ap_pstrcat(r->pool, "text/", -r->content_type+sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1, NULL); +if (type && (strncasecmp(type, "text/", 5) == 0 || + strncasecmp(type, "message/", 8) == 0)) { + if (strncasecmp(type, ASCIITEXT_MAGIC_TYPE_PREFIX, + sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1) == 0) + r->content_type = ap_pstrcat(r->pool, "text/", + type+sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1, + NULL); else -/* translate EBCDIC to ASCII */ -convert_to_ascii = 1; + /* translate EBCDIC to ASCII */ + convert_to_ascii = 1; } +/* Enable conversion if it's a text document */ ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert_to_ascii); return convert_to_ascii;
cvs commit: apache-1.3/src/os/bs2000 os.c
martin 99/12/15 15:18:53 Modified:src/os/bs2000 os.c Log: As long as I still need The Hack (but I'm working on a better solution) fix the multipart/ type to be treated as text. This doesn't help very much because nobody parses the mime type (and sets the conversion) of the individual parts, though. Revision ChangesPath 1.13 +2 -1 apache-1.3/src/os/bs2000/os.c Index: os.c === RCS file: /export/home/cvs/apache-1.3/src/os/bs2000/os.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- os.c 1999/01/01 19:05:28 1.12 +++ os.c 1999/12/15 23:18:43 1.13 @@ -85,7 +85,8 @@ /* Conversion is applied to text/ files only, if ever. */ if (type && (strncasecmp(type, "text/", 5) == 0 || - strncasecmp(type, "message/", 8) == 0)) { + strncasecmp(type, "message/", 8) == 0 || + strncasecmp(type, "multipart/", 10) == 0)) { if (strncasecmp(type, ASCIITEXT_MAGIC_TYPE_PREFIX, sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1) == 0) r->content_type = ap_pstrcat(r->pool, "text/",
Re: cvs commit: apache-1.3/src/os/bs2000 os.c
On 3 Feb 1998 [EMAIL PROTECTED] wrote: > diff -u -u -r1.2 -r1.3 > --- os.c1998/01/26 16:46:16 1.2 > +++ os.c1998/02/03 16:55:30 1.3 > @@ -56,6 +56,7 @@ > * Any inlineable functions should be defined in os-inline.c instead. > */ > > +#include "httpd.h" >#include "os.h" > >/* Check the Content-Type to decide if conversion is needed */ Hi Martin, is this really required? The os/* files should not need to know about Apache. They can then be used in other programs (e.g. htpasswd). If there is something in the os dir that needs to know about httpd.h or any other Apache include file, it should probably be moved to the ap library instead //pcs