This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b3d46e
)
inet_aton() should do DNS lookup only if arg isn't a dotted-quad
author
Gurusamy Sarathy
<gsar@cpan.org>
Fri, 10 Jul 1998 20:19:18 +0000
(20:19 +0000)
committer
Gurusamy Sarathy
<gsar@cpan.org>
Fri, 10 Jul 1998 20:19:18 +0000
(20:19 +0000)
(suggested by Philippe.Simonet@swisscom.com)
p4raw-id: //depot/perl@1402
ext/Socket/Socket.xs
patch
|
blob
|
blame
|
history
diff --git
a/ext/Socket/Socket.xs
b/ext/Socket/Socket.xs
index
82ed442
..
cefcb24
100644
(file)
--- a/
ext/Socket/Socket.xs
+++ b/
ext/Socket/Socket.xs
@@
-711,13
+711,11
@@
inet_aton(host)
{
struct in_addr ip_address;
struct hostent * phe;
- int ok;
+ int ok
= inet_aton(host, &ip_address)
;
- if (
phe = gethostbyname(host
)) {
+ if (
!ok && (phe = gethostbyname(host)
)) {
Copy( phe->h_addr, &ip_address, phe->h_length, char );
ok = 1;
- } else {
- ok = inet_aton(host, &ip_address);
}
ST(0) = sv_newmortal();