dougm 01/11/16 11:11:23
Modified: perl-framework/Apache-Test/lib/Apache TestRequest.pm
Log:
add a getline() function that returns the same results when given an
IO::Socket::INET or Net::SSL object
Revision Changes Path
1.55 +23 -0
httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm
Index: TestRequest.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- TestRequest.pm 2001/11/15 22:20:46 1.54
+++ TestRequest.pm 2001/11/16 19:11:23 1.55
@@ -173,6 +173,29 @@
}
}
+#Net::SSL::getline is nothing like IO::Handle::getline
+#could care less about performance here, just need a getline()
+#that returns the same results with or without ssl
+my %getline = (
+ 'Net::SSL' => sub {
+ my $self = shift;
+ my $buf = '';
+ my $c = '';
+ do {
+ $self->read($c, 1);
+ $buf .= $c;
+ } until ($c eq "\n");
+ $buf;
+ },
+);
+
+sub getline {
+ my $sock = shift;
+ my $class = ref $sock;
+ my $method = $getline{$class} || 'getline';
+ $sock->$method();
+}
+
sub prepare {
user_agent();