php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #490 Win32 sendmail is very slow when specifying SMTP host as IP address
Submitted: 1998-06-29 09:10 UTC Modified: 1998-07-10 13:03 UTC
From: tma at gatehouse dot dk Assigned:
Status: Closed Package: Performance problem
PHP Version: 3.0 Final Release OS: WinNT 4.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tma at gatehouse dot dk
New email:
PHP Version: OS:

 

 [1998-06-29 09:10 UTC] tma at gatehouse dot dk
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;


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-10 13:03 UTC] shane
This unused code section was removed in 3.0.1
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 10 09:01:25 2020 UTC