You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Geoffrey Young <ge...@modperlcookbook.org> on 2003/10/01 00:58:47 UTC

Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

> # 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

Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Wed, 1 Oct 2003, Geoffrey Young wrote:

>
> >
> > +1. also please update modperl-docs/src/docs/2.0/api/Apache/Const.pod.
>
> of course.
>
> >
> > Will you please suggest a patch against Randy's patch to use that constant?
>
> it would probably be easier to patch that after it's accepted into core in
> it's final form.  that way Randy keeps ownership of the bulk of it and can
> tweak it until everyone is satisfied.
>
> or, I could just commit it now and Randy can decide which route to go.  I
> think I'll just do that...
>
> --Geoff

That sounds good - the availability of those constants
will make things easier ...

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Wed, 1 Oct 2003, Stas Bekman wrote:

> Randy Kobes wrote:
> > On Wed, 1 Oct 2003, Geoffrey Young wrote:
> >
> >>or, I could just commit it now and Randy can decide which
> >>route to go.  I think I'll just do that...
> >
> > Here's a revised set of tests, using Geoff's implementation
> > of Apache::CRLF. This also addresses a couple of earlier
> > comments of Stas - the files used for comparison are now
> > assumed to be found as t/htdocs/perlio/http.pod and
> > t/htdocs/perlio/http_cycle.png, and also a constant
> > data file name is used (and then cleaned up after the
> > tests are done).
>
> tested OK on linux, +1 to commit with my other comments if
> possible, or commit it as is and we will polish it later.

Thanks very much Stas, and also for the earlier comments on
where to declare things, etc. - much appreciated! I'll
polish this up over the weekend and commit.

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Wed, 1 Oct 2003, Geoffrey Young wrote:
> 
> 
>>or, I could just commit it now and Randy can decide which
>>route to go.  I think I'll just do that...
> 
> 
> Here's a revised set of tests, using Geoff's implementation
> of Apache::CRLF. This also addresses a couple of earlier
> comments of Stas - the files used for comparison are now
> assumed to be found as t/htdocs/perlio/http.pod and
> t/htdocs/perlio/http_cycle.png, and also a constant
> data file name is used (and then cleaned up after the
> tests are done).

tested OK on linux, +1 to commit with my other comments if possible, or commit 
it as is and we will polish it later.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Wed, 1 Oct 2003, Stas Bekman wrote:

> Randy Kobes wrote:
[ .. ]
> Cool. The following are just style comments.
>
> > +    # test reading and writing text and binary files
> > +    {
> > +        local $/;
>
> Randy, can you please put local $/; just before it's
> needed? Otherwise it's too far away from its usage and it
> may affect other things if the test is expanded in the
> future. The best practice IMHO is:
>
>             {
>                local $/;
>                ... <$fh>
>             }
>
> in every place you need it. this makes the code easier to read.

Good idea - I'll do that ...

>
> > +        my ($rfh, $wfh, $pfh);
>
> why these are defined outside and not where they are opened?
>
>     open my $rfh, "<:APR", $in, $r->pool
>
> etc.

Done ...

>
> > +        for my $file ('http.pod', 'http_cycle.png') {
> > +            my $in = catfile $dir, $file;
> > +            my $out = catfile $dir, "$file.out";
> > +            open $rfh, "<:APR", $in, $r->pool
> > +                or die "Cannot open $in for reading: $!";
> > +            binmode($rfh);  # not necessary
>
> if it's not necessary, why do we need it?

I'll drop the comment - it is too cryptic. But basically,
putting in a binmode($apr_fh) doesn't affect anything - you
can put it in, or leave it out, both for binary and text
files (even on Win32). Where having it in makes a difference
(but this doesn't matter to a user) is if PERLIO_K_RAW
was left out of apr_perlio.c. If it was, then all the
tests would pass without the binmode($apr_fh) calls, but
some will fail with a binmode($apr_fh).

[ .. ]
> I'd enclose the following code of its own block showing
> that it's an independent sub-test. you won't need to
> predeclare lexicals vars above. This practice makes easier
> to debug subtests where you can comment out blocks without
> affecting the rest of the test. see apr/pool.pm for such
> an example.
>
> > +        my $scratch = catfile $dir, 'scratch.dat';
[ .. ]
I'll do that.

Thanks again, Stas.

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Wed, 1 Oct 2003, Geoffrey Young wrote:
> 
> 
>>or, I could just commit it now and Randy can decide which
>>route to go.  I think I'll just do that...
> 
> 
> Here's a revised set of tests, using Geoff's implementation
> of Apache::CRLF. This also addresses a couple of earlier
> comments of Stas - the files used for comparison are now
> assumed to be found as t/htdocs/perlio/http.pod and
> t/htdocs/perlio/http_cycle.png, and also a constant
> data file name is used (and then cleaned up after the
> tests are done).

Cool. The following are just style comments.

> +    # test reading and writing text and binary files
> +    {
> +        local $/;

Randy, can you please put local $/; just before it's needed? Otherwise it's 
too far away from its usage and it may affect other things if the test is 
expanded in the future. The best practice IMHO is:

            {
               local $/;
               ... <$fh>
            }

in every place you need it. this makes the code easier to read.

> +        my ($rfh, $wfh, $pfh);

why these are defined outside and not where they are opened?

    open my $rfh, "<:APR", $in, $r->pool

etc.

> +        for my $file ('http.pod', 'http_cycle.png') {
> +            my $in = catfile $dir, $file;
> +            my $out = catfile $dir, "$file.out";
> +            open $rfh, "<:APR", $in, $r->pool
> +                or die "Cannot open $in for reading: $!";
> +            binmode($rfh);  # not necessary

if it's not necessary, why do we need it?

> +            my $apr_content = <$rfh>;
> +            close $rfh;
> +            open $pfh, "<", $in
> +                or die "Cannot open $in for reading: $!";
> +            binmode($pfh);
> +            my $perl_content = <$pfh>;
> +            close $pfh;
> +            ok t_cmp(length $perl_content,
> +                     length $apr_content,
> +                     "testing data size of $file");
> +
> +            open $wfh, ">:APR", $out, $r->pool
> +                or die "Cannot open $out for writing: $!";
> +            print $wfh $apr_content;
> +            close $wfh;
> +            ok t_cmp(-s $in,
> +                     -s $out,
> +                     "testing file size of $file");
> +            unlink $out;
> +        }

I'd enclose the following code of its own block showing that it's an 
independent sub-test. you won't need to predeclare lexicals vars above. This 
practice makes easier to debug subtests where you can comment out blocks 
without affecting the rest of the test. see apr/pool.pm for such an example.

> +        my $scratch = catfile $dir, 'scratch.dat';
> +        my $text;
> +        my $count = 2000;
> +        open $wfh, ">:crlf", $scratch
> +            or die "Cannot open $scratch for writing: $!";
> +        print $wfh 'a' . ((('a' x 14) . "\n") x $count);
> +        close $wfh;
> +        open $rfh, "<:APR", $scratch, $r->pool
> +            or die "Cannot open $scratch for reading: $!";
> +        $text = <$rfh>;
> +        close $rfh;
> +        ok t_cmp($count,
> +                 count_chars($text, Apache::CRLF),
> +                 'testing for presence of \015\012');
> +        ok t_cmp($count,
> +                 count_chars($text, "\n"),
> +                 'testing for presence of \n');
> +
> +        open $wfh, ">:APR", $scratch, $r->pool
> +            or die "Cannot open $scratch for writing: $!";
> +        binmode($wfh);  # not necessary
> +        print $wfh 'a' . ((('a' x 14) . Apache::CRLF) x $count);
> +        close $wfh;
> +        open $rfh, "<:APR", $scratch, $r->pool
> +            or die "Cannot open $scratch for reading: $!";
> +        $text = <$rfh>;
> +        close $rfh;
> +        ok t_cmp($count,
> +                 count_chars($text, Apache::CRLF),
> +                 'testing for presence of \015\012');
> +        ok t_cmp($count,
> +                 count_chars($text, "\n"),
> +                 'testing for presence of \n');
> +        open $rfh, "<:crlf", $scratch
> +            or die "Cannot open $scratch for reading: $!";
> +        $text = <$rfh>;
> +        close $rfh;
> +        ok t_cmp(0,
> +                 count_chars($text, Apache::CRLF),
> +                 'testing for presence of \015\012');
> +        ok t_cmp($count,
> +                 count_chars($text, "\n"),
> +                 'testing for presence of \n');
> +
> +        my $utf8 = "\x{042F} \x{0432}\x{0430}\x{0441} \x{043B}\x{044E}";
> +        open $wfh, ">:APR", $scratch, $r->pool
> +            or die "Cannot open $scratch for writing: $!";
> +        binmode($wfh, ':utf8');
> +        print $wfh $utf8;
> +        close $wfh;
> +        open $rfh, "<:APR", $scratch, $r->pool
> +            or die "Cannot open $scratch for reading: $!";
> +        binmode($rfh, ':utf8');
> +        $text = <$rfh>;
> +        close $rfh;
> +        ok t_cmp($utf8,
> +                 $text,
> +                 'utf8 binmode test');
> +        unlink $scratch;
> +    }
> 
>      # XXX: need tests
>      # - for stdin/out/err as they are handled specially
> @@ -232,6 +323,13 @@
>      # cleanup: t_mkdir will remove the whole tree including the file
> 
>      Apache::OK;
> +}
> +
> +sub count_chars {
> +    my($text, $chars) = @_;
> +    my $seen = 0;
> +    $seen++ while $text =~ /$chars/g;
> +    return $seen;
>  }
> 
>  1;
> 
> ===============================================================
> 


-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Wed, 1 Oct 2003, Stas Bekman wrote:

> Randy Kobes wrote:
> > On Thu, 2 Oct 2003, Randy Kobes wrote:
> >
> >
> >>Here's a revised set of tests, using Geoff's implementation
> >>of Apache::CRLF. This also addresses a couple of earlier
> >>comments of Stas - the files used for comparison are now
> >>assumed to be found as t/htdocs/perlio/http.pod and
> >>t/htdocs/perlio/http_cycle.png.
> >
> > [ ... ]
> > Sorry - I forgot - httpd.pod and http_cycle.png are in
> > the mp2 cvs sources under docs/user/handlers/. If these
> > files are OK to use, I'll add them to t/htdocs/perlio/
> > in cvs. This will mean adding perlio/ to cvs, if that's
> > an issue?
>
> adding t/htdocs/perlio to cvs is fine.
>
> adding http.pod and http_cycle.png is not such a good
> idea. The problem is that someone will try to read/use
> them for other reasons and chances are that both will be
> very out of date 6 months from now. Therefore if you can
> use a file with your favorite poetry or prose for .pod
> (call it .txt then) and small png of a flower that would
> be much much better. Also it'd be nice to add not too big
> files, as the source distribution is already quite big and
> growing. Of course this is different if a big input is
> needed for the test. You can use
> http://www.google.ca/imghp to find images if you don't
> have your own ;)

Hi Stas,
   That's a good idea - thanks, I'll do that ... I don't
think large files add anything to the tests, so I'll go
with the small ones.

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> On Thu, 2 Oct 2003, Randy Kobes wrote:
> 
> 
>>Here's a revised set of tests, using Geoff's implementation
>>of Apache::CRLF. This also addresses a couple of earlier
>>comments of Stas - the files used for comparison are now
>>assumed to be found as t/htdocs/perlio/http.pod and
>>t/htdocs/perlio/http_cycle.png.
> 
> [ ... ]
> Sorry - I forgot - httpd.pod and http_cycle.png are in
> the mp2 cvs sources under docs/user/handlers/. If these
> files are OK to use, I'll add them to t/htdocs/perlio/
> in cvs. This will mean adding perlio/ to cvs, if that's
> an issue?

adding t/htdocs/perlio to cvs is fine.

adding http.pod and http_cycle.png is not such a good idea. The problem is 
that someone will try to read/use them for other reasons and chances are that 
both will be very out of date 6 months from now. Therefore if you can use a 
file with your favorite poetry or prose for .pod (call it .txt then) and small 
png of a flower that would be much much better. Also it'd be nice to add not 
too big files, as the source distribution is already quite big and growing. Of 
course this is different if a big input is needed for the test. You can use 
http://www.google.ca/imghp to find images if you don't have your own ;)

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Thu, 2 Oct 2003, Randy Kobes wrote:

> Here's a revised set of tests, using Geoff's implementation
> of Apache::CRLF. This also addresses a couple of earlier
> comments of Stas - the files used for comparison are now
> assumed to be found as t/htdocs/perlio/http.pod and
> t/htdocs/perlio/http_cycle.png.
[ ... ]
Sorry - I forgot - httpd.pod and http_cycle.png are in
the mp2 cvs sources under docs/user/handlers/. If these
files are OK to use, I'll add them to t/htdocs/perlio/
in cvs. This will mean adding perlio/ to cvs, if that's
an issue?

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Wed, 1 Oct 2003, Geoffrey Young wrote:

> or, I could just commit it now and Randy can decide which
> route to go.  I think I'll just do that...

Here's a revised set of tests, using Geoff's implementation
of Apache::CRLF. This also addresses a couple of earlier
comments of Stas - the files used for comparison are now
assumed to be found as t/htdocs/perlio/http.pod and
t/htdocs/perlio/http_cycle.png, and also a constant
data file name is used (and then cleaned up after the
tests are done).
========================================================
Index: t/response/TestAPR/perlio.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/perlio.pm,v
retrieving revision 1.25
diff -u -r1.25 perlio.pm
--- t/response/TestAPR/perlio.pm	19 Sep 2003 19:54:37 -0000	1.25
+++ t/response/TestAPR/perlio.pm	2 Oct 2003 05:17:07 -0000
@@ -13,7 +13,7 @@
 use Fcntl ();
 use File::Spec::Functions qw(catfile);

-use Apache::Const -compile => 'OK';
+use Apache::Const -compile => qw(OK CRLF);

 #XXX: APR::LARGE_FILES_CONFLICT constant?
 #XXX: you can set to zero if largefile support is not enabled in Perl
@@ -28,7 +28,7 @@
 sub handler {
     my $r = shift;

-    my $tests = 11;
+    my $tests = 22;
     $tests += 3 unless LARGE_FILES_CONFLICT;
     $tests += 1 unless APR_WIN32_FILE_DUP_BUG;

@@ -221,6 +221,97 @@

     }

+    # test reading and writing text and binary files
+    {
+        local $/;
+        my ($rfh, $wfh, $pfh);
+        for my $file ('http.pod', 'http_cycle.png') {
+            my $in = catfile $dir, $file;
+            my $out = catfile $dir, "$file.out";
+            open $rfh, "<:APR", $in, $r->pool
+                or die "Cannot open $in for reading: $!";
+            binmode($rfh);  # not necessary
+            my $apr_content = <$rfh>;
+            close $rfh;
+            open $pfh, "<", $in
+                or die "Cannot open $in for reading: $!";
+            binmode($pfh);
+            my $perl_content = <$pfh>;
+            close $pfh;
+            ok t_cmp(length $perl_content,
+                     length $apr_content,
+                     "testing data size of $file");
+
+            open $wfh, ">:APR", $out, $r->pool
+                or die "Cannot open $out for writing: $!";
+            print $wfh $apr_content;
+            close $wfh;
+            ok t_cmp(-s $in,
+                     -s $out,
+                     "testing file size of $file");
+            unlink $out;
+        }
+
+        my $scratch = catfile $dir, 'scratch.dat';
+        my $text;
+        my $count = 2000;
+        open $wfh, ">:crlf", $scratch
+            or die "Cannot open $scratch for writing: $!";
+        print $wfh 'a' . ((('a' x 14) . "\n") x $count);
+        close $wfh;
+        open $rfh, "<:APR", $scratch, $r->pool
+            or die "Cannot open $scratch for reading: $!";
+        $text = <$rfh>;
+        close $rfh;
+        ok t_cmp($count,
+                 count_chars($text, Apache::CRLF),
+                 'testing for presence of \015\012');
+        ok t_cmp($count,
+                 count_chars($text, "\n"),
+                 'testing for presence of \n');
+
+        open $wfh, ">:APR", $scratch, $r->pool
+            or die "Cannot open $scratch for writing: $!";
+        binmode($wfh);  # not necessary
+        print $wfh 'a' . ((('a' x 14) . Apache::CRLF) x $count);
+        close $wfh;
+        open $rfh, "<:APR", $scratch, $r->pool
+            or die "Cannot open $scratch for reading: $!";
+        $text = <$rfh>;
+        close $rfh;
+        ok t_cmp($count,
+                 count_chars($text, Apache::CRLF),
+                 'testing for presence of \015\012');
+        ok t_cmp($count,
+                 count_chars($text, "\n"),
+                 'testing for presence of \n');
+        open $rfh, "<:crlf", $scratch
+            or die "Cannot open $scratch for reading: $!";
+        $text = <$rfh>;
+        close $rfh;
+        ok t_cmp(0,
+                 count_chars($text, Apache::CRLF),
+                 'testing for presence of \015\012');
+        ok t_cmp($count,
+                 count_chars($text, "\n"),
+                 'testing for presence of \n');
+
+        my $utf8 = "\x{042F} \x{0432}\x{0430}\x{0441} \x{043B}\x{044E}";
+        open $wfh, ">:APR", $scratch, $r->pool
+            or die "Cannot open $scratch for writing: $!";
+        binmode($wfh, ':utf8');
+        print $wfh $utf8;
+        close $wfh;
+        open $rfh, "<:APR", $scratch, $r->pool
+            or die "Cannot open $scratch for reading: $!";
+        binmode($rfh, ':utf8');
+        $text = <$rfh>;
+        close $rfh;
+        ok t_cmp($utf8,
+                 $text,
+                 'utf8 binmode test');
+        unlink $scratch;
+    }

     # XXX: need tests
     # - for stdin/out/err as they are handled specially
@@ -232,6 +323,13 @@
     # cleanup: t_mkdir will remove the whole tree including the file

     Apache::OK;
+}
+
+sub count_chars {
+    my($text, $chars) = @_;
+    my $seen = 0;
+    $seen++ while $text =~ /$chars/g;
+    return $seen;
 }

 1;

===============================================================

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> 
> +1. also please update modperl-docs/src/docs/2.0/api/Apache/Const.pod.

of course.

> 
> Will you please suggest a patch against Randy's patch to use that constant?

it would probably be easier to patch that after it's accepted into core in 
it's final form.  that way Randy keeps ownership of the bulk of it and can 
tweak it until everyone is satisfied.

or, I could just commit it now and Randy can decide which route to go.  I 
think I'll just do that...

--Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> 
>> # 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.

+1. also please update modperl-docs/src/docs/2.0/api/Apache/Const.pod.

Will you please suggest a patch against Randy's patch to use that constant?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


RE : RE : [mp2] PERLIO_K_RAW in apr_perlio.c

Posted by Ayhan Ulusoy <ay...@drexel.edu>.
Yupp. It is probably better to stick close to the way httpd does things.

Besides, that VMS behaviour must be a real buggy one if it is the way
that snippet suggests  :)

Cheers,

Ayhan


-----Message d'origine-----
De : Geoffrey Young [mailto:geoff@modperlcookbook.org] 
Envoyé : mercredi 1 octobre 2003 00:59
À : Ayhan Ulusoy
Cc : dev@perl.apache.org
Objet : Re: RE : [mp2] PERLIO_K_RAW in apr_perlio.c


> # 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



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org