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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
7 + 10 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 19:01:33 2024 UTC