|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-07-10 13:03 UTC] shane
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
When specifying SMTP host as an IP address in the php3.ini file (e.g. SMTP=192.168.101.1), the gethostbyname() call performed by sendmail.c times out, resulting in very poor performance. A quick hack: If MailHost starts with a numeric character, do not perform the gethostbyname() call (BTW: The results do not appear to be used anyway!) --- c:/user/gh/php-3.0/win32/sendmail.c~ Mon Jun 29 12:02:00 1998 +++ c:/user/gh/php-3.0/win32/sendmail.c Mon Jun 29 12:03:22 1998 @@ -380,9 +380,12 @@ return (FAILED_TO_GET_HOSTNAME); // Resolve the servers IP - GLOBAL(adr) = gethostbyname(GLOBAL(MailHost)); - if (!GLOBAL(adr)) - return (FAILED_TO_RESOLVE_HOST); + if (!isdigit(GLOBAL(MailHost))) + { + GLOBAL(adr) = gethostbyname(GLOBAL(MailHost)[0]); + if (!GLOBAL(adr)) + return (FAILED_TO_RESOLVE_HOST); + } // Connect to server GLOBAL(sock_in).sin_family = AF_INET;