# Define the CRLF sequence. I can't use a simple "\r\n" because the
meaning
# of "\n" is different on different OS's (sometimes it generates CRLF,
sometimes LF
# and sometimes CR). The most popular VMS web server
# doesn't accept CRLF -- instead it wants a LR. EBCDIC machines don't
# use ASCII, so \015\012 means something different. I find this all # really annoying.

randy and I have discussed this before, IIRC...


while apache itself makes the distinction between ascii and ebcdic, it does not distinguish between vms and the rest of ascii land.

I say we punt just follow the lead of httpd, exporting their constants.

patch attached.  I'll clean up the test tomorrow if people like the idea.
--Geoff
Index: lib/Apache/ParseSource.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/lib/Apache/ParseSource.pm,v
retrieving revision 1.43
diff -u -r1.43 ParseSource.pm
--- lib/Apache/ParseSource.pm   12 May 2003 13:00:15 -0000      1.43
+++ lib/Apache/ParseSource.pm   30 Sep 2003 22:54:09 -0000
@@ -160,6 +160,7 @@
         types      => [qw{DIR_MAGIC_TYPE}],
         override   => [qw{OR_ ACCESS_CONF RSRC_CONF}],
         log        => [qw(APLOG_)],
+        platform   => [qw{CRLF CR LF}],
     },
     APR => {
         table     => [qw{APR_OVERLAP_TABLES_}],
Index: lib/ModPerl/Code.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/lib/ModPerl/Code.pm,v
retrieving revision 1.106
diff -u -r1.106 Code.pm
--- lib/ModPerl/Code.pm 21 Sep 2003 03:06:17 -0000      1.106
+++ lib/ModPerl/Code.pm 30 Sep 2003 22:54:11 -0000
@@ -828,7 +828,9 @@
           if (strEQ(name, "$name")) {
 EOF
 
-            if ($name eq 'DECLINE_CMD' || $name eq 'DIR_MAGIC_TYPE') {
+            if ($name eq 'DECLINE_CMD' || 
+                $name eq 'DIR_MAGIC_TYPE' ||
+                $name eq 'CRLF') {
                 print $c_fh <<EOF;
               return newSVpv($alias{$name}, 0);
 EOF
Index: t/apache/constants.t
===================================================================
RCS file: /home/cvspublic/modperl-2.0/t/apache/constants.t,v
retrieving revision 1.6
diff -u -r1.6 constants.t
--- t/apache/constants.t        12 May 2003 13:00:15 -0000      1.6
+++ t/apache/constants.t        30 Sep 2003 22:54:11 -0000
@@ -6,10 +6,10 @@
 
 use Apache2 ();
 use Apache::Const -compile => qw(DECLINED :http :common TAKE23 &OPT_EXECCGI
-                                 DECLINE_CMD DIR_MAGIC_TYPE);
+                                 DECLINE_CMD DIR_MAGIC_TYPE CRLF);
 use Apache::Const; #defaults to :common
 
-plan tests => 15;
+plan tests => 16;
 
 ok REDIRECT == 302;
 ok AUTH_REQUIRED == 401;
@@ -20,6 +20,9 @@
 ok Apache::OPT_EXECCGI;
 ok Apache::DECLINE_CMD eq "\x07\x08";
 ok Apache::DIR_MAGIC_TYPE eq "httpd/unix-directory";
+# will fail on EBCDIC
+# kudos to mod_perl if someone actually reports it
+ok Apache::CRLF eq "\015\012";
 
 ok ! defined &M_GET;
 Apache::Const->import('M_GET');
Index: xs/tables/current/Apache/ConstantsTable.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm,v
retrieving revision 1.28
diff -u -r1.28 ConstantsTable.pm
--- xs/tables/current/Apache/ConstantsTable.pm  12 May 2003 13:00:15 -0000      1.28
+++ xs/tables/current/Apache/ConstantsTable.pm  30 Sep 2003 22:54:11 -0000
@@ -146,6 +146,11 @@
     'config' => [
       'DECLINE_CMD'
     ],
+    'platform' => [
+      'CRLF',
+      'CR',
+      'LF'
+    ],
     'types' => [
       'DIR_MAGIC_TYPE'
     ],

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to