php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30699 Have gethostbyname return error information in additional variables
Submitted: 2004-11-06 11:21 UTC Modified: 2014-12-30 10:41 UTC
From: techtonik@php.net Assigned:
Status: No Feedback Package: Network related
PHP Version: * OS: Irrelevant
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
42 + 37 = ?
Subscribe to this entry?

 
 [2004-11-06 11:21 UTC] techtonik@php.net
Description:
------------
It will be helpful to make gethostbyname return error status in additional variables like fsockopen does for example in int &errno, string &errstr.

Now gethostbyname returns a string containing the unmodified hostname on failure, but rather often it is desirable to know why the operation failed and output standart system text error message without inventing own ones. That way you can search information on internet with a higher probability to find an answer in case of errors.

It should not be too difficult to implement since WSAGetLastError() from WinSock2 returns generic error code and here you can find error code descriptions. 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/windows_sockets_error_codes_2.asp

Expected result:
----------------
string gethostbyname ( string hostname[, int &errno [, string &errstr]] )

Actual result:
--------------
string gethostbyname ( string hostname )

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-21 20:25 UTC] levim@php.net
-Summary: make gethostbyname return error status in additional variables +Summary: Have gethostbyname return error information in additional variables -Status: Open +Status: Feedback -Package: Feature/Change Request +Package: Network related -PHP Version: 4.3.9 +PHP Version: *
 [2014-04-21 20:25 UTC] levim@php.net
At a glance I was unable to find any update to this; is this something you are still interested in?
 [2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC