Change 11957 by jhi@alpha on 2001/09/09 13:03:33
Try to look up protocol (by name) only iff it has non-numbers:
nice if the server is in a chrooted environment (no /etc/protocols,
server code using hardcorded protocol numbers like 6 for tcp),
suggested by John Holdsworth <[EMAIL PROTECTED]>.
In other words, if we are given a number, why look it up again
(by number)?
Affected files ...
... //depot/perl/ext/IO/lib/IO/Socket/INET.pm#15 edit
Differences ...
==== //depot/perl/ext/IO/lib/IO/Socket/INET.pm#15 (text) ====
Index: perl/ext/IO/lib/IO/Socket/INET.pm
--- perl/ext/IO/lib/IO/Socket/INET.pm.~1~ Sun Sep 9 07:15:05 2001
+++ perl/ext/IO/lib/IO/Socket/INET.pm Sun Sep 9 07:15:05 2001
@@ -41,11 +41,8 @@
$port = $1
if(defined $addr && $addr =~ s,:([\w\(\)/]+)$,,);
- if(defined $proto) {
- if (@proto = ( $proto =~ m,\D,
- ? getprotobyname($proto)
- : getprotobynumber($proto))
- ) {
+ if(defined $proto && $proto =~ /\D/) {
+ if(@proto = getprotobyname($proto) {
$proto = $proto[2] || undef;
}
else {
End of Patch.