#38568 [Opn->Fbk]: Problem when opening a socket with fsockopen()
| From: | tony2001@php.net | Date: | Thu, 24 Aug 2006 08:03:53 +0000 |
| Subject: | #38568 [Opn->Fbk]: Problem when opening a socket with fsockopen() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-101232@lists.php.net to get a copy of this message | ||
ID: 38568
Updated by: tony2001@php.net
Reported By: pierre-marie dot mouliere at arc-intl dot com
-Status: Open
+Status: Feedback
Bug Type: Sockets related
Operating System: HP-UX B.11.23 (Itanium IA64)
PHP Version: 5.1.5
New Comment:
>We use also PHP for windows and on HPUX 32 Bits and we
>have no problem. The problem in only on new 64 Bits HPUX.
I guess the problem is not _on_ 64bit HPUX, but _in_ 64bit HPUX. Did
you try to look into their docs/bugs/contact support etc?
I've serious doubts we're going to commit patches changing behaviour on
all systems because of a broken 64bit HPUX.
Previous Comments:
------------------------------------------------------------------------
[2006-08-24 05:54:52] pierre-marie dot mouliere at arc-intl dot com
Hello Tony,
We try to use the new package. The result is exactly the same. the
network.c files doesn't change except a static const declare. So, I'm
not surprised that we have the same result.
We use also PHP for windows and on HPUX 32 Bits and we have no problem.
The problem in only on new 64 Bits HPUX.
Best regards
Pierre Marie
------------------------------------------------------------------------
[2006-08-23 16:38:00] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-08-23 16:21:52] pierre-marie dot mouliere at arc-intl dot com
Hello,
It's difficult to give more information.
The php source code to test is
<?php
$sk = fsockopen("dev2.emea.dmai.net",80);
echo "socket = " . $sk;
?>
May be the problem in only on HPUX. We found a solution to fixed it.
It's running and for us it's OK now. But we prefer to include our
sources change of network.c in the global release. If not, we need to
change source code at each releases.
Best regards
Pierre Marie MOULIERE
------------------------------------------------------------------------
[2006-08-23 15:50:10] tony2001@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2006-08-23 15:04:53] pierre-marie dot mouliere at arc-intl dot com
Description:
------------
Symptom :
When opening a socket with fsockopen() the following error occurs :
fsockopen(): unable to connect to x.x.x.net:80 (Operation now in
progress) in testsocket.php
We locate the problem in the source code
Problem is in network.c, in 'main' directory, near line 328
Function getsockopt() returns code EINPROGRESS in 'error' field. So
function exits with ret = -1 (third line from end here), although
EINPROGRESS is not really an error.
We have implemented the following workaround (3 lines) between /* Start
changes */ and /* End changes */ and it's fixed
Reproduce code:
---------------
----------------------------------------------------------
ok:
if (!asynchronous) {
/* back to blocking mode */
RESTORE_SOCKET_BLOCKING_MODE(sockfd, orig_flags);
}
/* Start changes */
if (error == EINPROGRESS) {
error = 0;
}
/* End changes */
if (error_code) {
*error_code = error;
}
if (error && error_string) {
*error_string = php_socket_strerror(error, NULL, 0);
ret = -1;
}
return ret;
----------------------------------------------------------
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38568&edit=1