httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p.@sweng.stortek.com
Subject Re: OS/390 Translation
Date Fri, 03 Dec 1999 22:55:23 GMT
In a recent note, Martin Kraemer said:

> Date: Fri, 3 Dec 1999 18:11:26 +0100
> 
> But changing '\012' to '\n' and '\015' to '\r' everywhere would break
> on ASCII based systems where  ('\n' != '\012') or ('\r' != '\015')
> (when it's an ASCII system, there's no implied additional conversion
> step which could fix the different representations. On EBCDIC, we
> have this translation step).
> 
How about something like the attached (submitted for discussion,
not for consideration as a patch).  It would eliminate the
need for the "strictly" kludge.

-- gil
-- 
StorageTek
INFORMATION made POWERFUL
===================================================================
diff -bru orig/apache-1.3/src/include/httpd.h apache-1.3/src/include/httpd.h
--- orig/apache-1.3/src/include/httpd.h	Thu Oct 21 19:14:41 1999
+++ apache-1.3/src/include/httpd.h	Fri Dec  3 15:20:22 1999
@@ -599,6 +599,7 @@
 #ifndef CHARSET_EBCDIC
 #define LF 10
 #define CR 13
+#define CRLF "\015\012"
 #else /* CHARSET_EBCDIC */
 #include "ebcdic.h"
 /* OSD_POSIX uses the EBCDIC charset. The transition ASCII->EBCDIC is done in
@@ -610,6 +611,7 @@
  */
 #define CR '\r'
 #define LF '\n'
+#define CRLF "\r\n"
 #endif /* CHARSET_EBCDIC */
 
 /* Possible values for request_rec.read_body (set by handling module):
diff -bru orig/apache-1.3/src/main/http_protocol.c apache-1.3/src/main/http_protocol.c
--- orig/apache-1.3/src/main/http_protocol.c	Fri Nov  5 10:13:55 1999
+++ apache-1.3/src/main/http_protocol.c	Fri Dec  3 15:16:05 1999
@@ -216,7 +216,7 @@
     if (!**r_range) {
         if (r->byterange > 1) {
             if (realreq)
-                ap_rvputs(r, "\015\012--", r->boundary, "--\015\012", NULL);
+                ap_rvputs(r, CRLF"--", r->boundary, "--"CRLF, NULL);
             else
                 *tlength += 4 + strlen(r->boundary) + 4;
         }
@@ -236,8 +236,8 @@
         ap_snprintf(ts, sizeof(ts), "%ld-%ld/%ld", range_start, range_end,
                     r->clength);
         if (realreq)
-            ap_rvputs(r, "\015\012--", r->boundary, "\015\012Content-type: ",
-                   ct, "\015\012Content-range: bytes ", ts, "\015\012\015\012",
+            ap_rvputs(r, CRLF"--", r->boundary, CRLF"Content-type: ",
+                   ct, CRLF"Content-range: bytes ", ts, CRLF""CRLF,
                    NULL);
         else
             *tlength += 4 + strlen(r->boundary) + 16 + strlen(ct) + 23 +

[ etc... ]

Mime
View raw message