Add ARM files
[dh-make-perl] / dev / arm / libnet-ssleay-perl / libnet-ssleay-perl-1.35 / debian / libnet-ssleay-perl / usr / lib / perl5 / auto / Net / SSLeay / tcp_read_until.al
1 # NOTE: Derived from blib/lib/Net/SSLeay.pm.
2 # Changes made here will be lost when autosplit is run again.
3 # See AutoSplit.pm.
4 package Net::SSLeay;
5
6 #line 2054 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/tcp_read_until.al)"
7 sub tcp_read_until {
8     my ($delim, $max_length) = @_;
9     local $[;
10
11     # guess the delim string if missing
12     if ( ! defined $delim ) {           
13       if ( defined $/ && length $/  ) { $delim = $/ }
14       else { $delim = "\n" }      # Note: \n,$/ value depends on the platform
15     }
16     my $len_delim = length $delim;
17
18     my ($n,$got);
19     my $reply = '';
20     
21     while (!defined $max_length || length $reply < $max_length) {
22         $n = sysread(SSLCAT_S, $got, 1);  # one by one
23         warn "tcp_read_until: $!" if !defined $n;
24         debug_read(\$reply, \$got) if $trace>1;
25         last if !$n;  # EOF
26         $reply .= $got;
27         last if $len_delim
28             && substr($reply, blength($reply)-$len_delim) eq $delim;
29     }
30     return $reply;
31 }
32
33 # end of Net::SSLeay::tcp_read_until
34 1;