httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <hart...@ooo.lanl.gov>
Subject Re: change LF to CRLF ?
Date Mon, 20 Mar 1995 14:03:42 GMT
> 
> Sure.  If anyone submits a patch for it, and it isn't horribly broken
> in some obvious way, it'll have my vote.

The only files that seem to be affected are http_log.c, http_mime.c
and stream.c

However,I think that stream.c is thumping all the CRLFs into LFs  :-(
David - can you fix that please. I couldn't work out what 
needed to be changed - commenting out the overwriting of CR with LF
didn't work.


patches for http_log.c and http_mime.c follow. David, when you fix
stream.c, you can attach these two diffs and upload, or forward
me the diff for stream.c




*** http_log.c.orig	Mon Mar 20 13:27:25 1995
--- http_log.c	Mon Mar 20 13:30:57 1995
***************
*** 115,121 ****
  }
  
  void begin_http_header(FILE *fd, char *msg) {
!     fprintf(fd,"%s %s%c",SERVER_PROTOCOL,msg,LF);
      dump_default_header(fd);
  }
  
--- 115,121 ----
  }
  
  void begin_http_header(FILE *fd, char *msg) {
!     fprintf(fd,"%s %s%c%c",SERVER_PROTOCOL,msg,CR,LF);
      dump_default_header(fd);
  }
  
***************
*** 122,128 ****
  void error_head(FILE *fd, char *err) {
      if(!assbackwards) {
          begin_http_header(fd,err);
!         fprintf(fd,"Content-type: text/html%c%c",LF,LF);
      }
      if(!header_only) {
          fprintf(fd,"<HEAD><TITLE>%s</TITLE></HEAD>%c",err,LF);
--- 122,128 ----
  void error_head(FILE *fd, char *err) {
      if(!assbackwards) {
          begin_http_header(fd,err);
!         fprintf(fd,"Content-type: text/html%c%c%c%c",CR,LF,CR,LF);
      }
      if(!header_only) {
          fprintf(fd,"<HEAD><TITLE>%s</TITLE></HEAD>%c",err,LF);
***************
*** 143,151 ****
          status = 302;
          if(!assbackwards) {
              begin_http_header(fd,"302 Found");
!             fprintf(fd,"Location: %s%c",err_string,LF);
!             fprintf(fd,"Content-type: text/html%c",LF);
!             fputc(LF,fd);
          }
          if(header_only) break;
          title_html(fd,"Document moved");
--- 143,151 ----
          status = 302;
          if(!assbackwards) {
              begin_http_header(fd,"302 Found");
!             fprintf(fd,"Location: %s%c%c",err_string,CR,LF);
!             fprintf(fd,"Content-type: text/html%c%c",CR,LF);
!             fputc(CR,fd); fputc(LF,fd);
          }
          if(header_only) break;
          title_html(fd,"Document moved");
***************
*** 155,161 ****
        case USE_LOCAL_COPY:
          status = USE_LOCAL_COPY;
          begin_http_header(fd,"304 Not modified");
!         fputc(LF,fd);
          header_only = 1;
          break;
        case AUTH_REQUIRED:
--- 155,161 ----
        case USE_LOCAL_COPY:
          status = USE_LOCAL_COPY;
          begin_http_header(fd,"304 Not modified");
!         fputc(CR,fd); fputc(LF,fd);
          header_only = 1;
          break;
        case AUTH_REQUIRED:
***************
*** 162,169 ****
          status = 401;
          if(!assbackwards) {
              begin_http_header(fd,"401 Unauthorized");
!             fprintf(fd,"Content-type: text/html%c",LF);
!             fprintf(fd,"WWW-Authenticate: %s%c%c",err_string,LF,LF);
          }
          if(header_only) break;
          title_html(fd,"Authorization Required");
--- 162,169 ----
          status = 401;
          if(!assbackwards) {
              begin_http_header(fd,"401 Unauthorized");
!             fprintf(fd,"Content-type: text/html%c%c",CR,LF);
!             fprintf(fd,"WWW-Authenticate: %s%c%c%c%c",err_string,CR,LF,CR,LF);
          }
          if(header_only) break;
          title_html(fd,"Authorization Required");


*** http_mime.c.orig	Mon Mar 20 13:27:25 1995
--- http_mime.c	Mon Mar 20 13:32:26 1995
***************
*** 424,431 ****
  
  
  void dump_default_header(FILE *fd) {
!     fprintf(fd,"Date: %s%c",gm_timestr_822(time(NULL)),LF);
!     fprintf(fd,"Server: %s%c",SERVER_VERSION,LF);
  }
  
  void send_http_header(FILE *fd) {
--- 424,431 ----
  
  
  void dump_default_header(FILE *fd) {
!     fprintf(fd,"Date: %s%c%c",gm_timestr_822(time(NULL)),CR,LF);
!     fprintf(fd,"Server: %s%c%c",SERVER_VERSION,CR,LF);
  }
  
  void send_http_header(FILE *fd) {
***************
*** 441,456 ****
      }            
      begin_http_header(fd,status_line);
      if(content_type[0])
!         fprintf(fd,"Content-type: %s%c",content_type,LF);
      if(last_modified[0])
!         fprintf(fd,"Last-modified: %s%c",last_modified,LF);
      if(content_length >= 0) 
!         fprintf(fd,"Content-length: %d%c",content_length,LF);
      if(location[0])
!         fprintf(fd,"Location: %s%c",location,LF);
      if(content_encoding[0])
!         fprintf(fd,"Content-encoding: %s%c",content_encoding,LF);
      if(out_headers)
          fprintf(fd,"%s",out_headers);
!     fprintf(fd,"%c",LF);
  }
--- 441,456 ----
      }            
      begin_http_header(fd,status_line);
      if(content_type[0])
!         fprintf(fd,"Content-type: %s%c%c",content_type,CR,LF);
      if(last_modified[0])
!         fprintf(fd,"Last-modified: %s%c%c",last_modified,CR,LF);
      if(content_length >= 0) 
!         fprintf(fd,"Content-length: %d%c%c",content_length,CR,LF);
      if(location[0])
!         fprintf(fd,"Location: %s%c%c",location,CR,LF);
      if(content_encoding[0])
!         fprintf(fd,"Content-encoding: %s%c%c",content_encoding,CR,LF);
      if(out_headers)
          fprintf(fd,"%s",out_headers);
!     fprintf(fd,"%c%c",CR,LF);
  }

Mime
View raw message