You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@hyperreal.org on 1998/12/28 19:16:37 UTC
cvs commit: modperl/t/net/perl request-cookie.pl request-upload.pl
dougm 98/12/28 10:16:35
Modified: src/modules/perl File.xs
t/net/perl request-cookie.pl request-upload.pl
Log:
some more libapr stuff
Revision Changes Path
1.6 +1 -0 modperl/src/modules/perl/File.xs
Index: File.xs
===================================================================
RCS file: /home/cvs/modperl/src/modules/perl/File.xs,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- File.xs 1998/11/13 03:27:51 1.5
+++ File.xs 1998/12/28 18:16:34 1.6
@@ -1,3 +1,4 @@
+
#include "mod_perl.h"
#define ap_fopen(r, name, mode) \
1.3 +27 -3 modperl/t/net/perl/request-cookie.pl
Index: request-cookie.pl
===================================================================
RCS file: /home/cvs/modperl/t/net/perl/request-cookie.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- request-cookie.pl 1998/12/24 20:59:47 1.2
+++ request-cookie.pl 1998/12/28 18:16:35 1.3
@@ -19,8 +19,8 @@
$r->send_http_header('text/plain');
my $i = 0;
-my $tests = 25;
-$tests += 6 if $r->headers_in->get("Cookie");
+my $tests = 31;
+$tests += 7 if $r->headers_in->get("Cookie");
print "1..$tests\n";
@@ -40,11 +40,32 @@
);
++$letter;
$c->bake;
- my @val = $c->value;
+
my $cgi_as_string = $cc->as_string;
my $as_string = $c->as_string;
my $header_out = ($r->err_headers_out->get("Set-Cookie"))[-1];
+ my @val = $c->value;
print "VALUE: @val\n";
+ for my $v ("string", [@val]) {
+ $c->value($v);
+ my @arr = $c->value;
+ my $n = @arr;
+ if (ref $v) {
+ test ++$i, $n == 2;
+ }
+ else {
+ test ++$i, $n == 1;
+ }
+ print " VALUE: @arr ($n)\n";
+ $c->value(\@val); #reset
+ }
+
+ for (1,0) {
+ my $secure = $c->secure;
+ $c->secure($_);
+ print "secure: $secure\n";
+ }
+
print "as_string: `$as_string'\n";
print "header_out: `$header_out'\n";
print "cgi cookie: `$cgi_as_string\n";
@@ -111,6 +132,9 @@
print "ARRAY context (value method):\n";
print " Apache::Cookie:\n";
my %hv = Apache::Cookie->new($r)->parse($string);
+ my %fetch = Apache::Cookie->fetch;
+ test ++$i, keys %hv == keys %fetch;
+
for (sort keys %hv) {
$done{$_} = join ", ", $hv{$_}->value;
print " $_ => $done{$_}\n";
1.4 +15 -2 modperl/t/net/perl/request-upload.pl
Index: request-upload.pl
===================================================================
RCS file: /home/cvs/modperl/t/net/perl/request-upload.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- request-upload.pl 1998/12/24 21:44:31 1.3
+++ request-upload.pl 1998/12/28 18:16:35 1.4
@@ -25,9 +25,15 @@
for (my $upload = $apr->upload; $upload; $upload = $upload->next) {
my $fh = $upload->fh;
my $name = $upload->name;
- unless ($fh and $name) {
- #die "Apache::Upload broken";
+ my $type = $upload->type;
+ print "$name ($type)";
+ if ($fh and $name) {
+ no strict;
+ if (my $no = fileno($name)) {
+ print " fileno => $no";
+ }
}
+ print "\n";
}
my $first = $apr->upload->name;
@@ -37,6 +43,13 @@
my($lines, $bytes);
$lines = $bytes = 0;
+ {
+ no strict;
+ if (fileno($name)) {
+ $fh = *$name{IO};
+ print "COMPAT: $fh\n";
+ }
+ }
while(<$fh>) {
++$lines;
$bytes += length;