1 # NOTE: Derived from blib/lib/Net/SSLeay.pm.
2 # Changes made here will be lost when autosplit is run again.
6 #line 2054 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/tcp_read_until.al)"
8 my ($delim, $max_length) = @_;
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
16 my $len_delim = length $delim;
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;
28 && substr($reply, blength($reply)-$len_delim) eq $delim;
33 # end of Net::SSLeay::tcp_read_until