You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ma...@hyperreal.org on 1998/09/14 18:12:21 UTC

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  Changes    Path
  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 -10    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.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;