From:             pierre-marie dot mouliere at arc-intl dot com
Operating system: HP-UX B.11.23 (Itanium IA64)
PHP version:      5.1.5
PHP Bug Type:     Sockets related
Bug description:  Problem when opening a socket with fsockopen() 

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 bug report at http://bugs.php.net/?id=38568&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38568&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38568&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38568&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38568&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=38568&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38568&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38568&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38568&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38568&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38568&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=38568&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=38568&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38568&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38568&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38568&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38568&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38568&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38568&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38568&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38568&r=mysqlcfg

Reply via email to