ID:               39068
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dmitrysp at yandex dot ru
-Status:           Open
+Status:           Bogus
 Bug Type:         Sockets related
 Operating System: Windows XP
 PHP Version:      5.1.6
 New Comment:

Windows limitations are by no means PHP bugs.



Previous Comments:
------------------------------------------------------------------------

[2006-10-06 17:56:46] dmitrysp at yandex dot ru

Description:
------------
PHP on Windows can't write more 8192 bytes in nonblock mode socket (on
Linux or in blocked mode - no problems). And stream_set_write_buffer()
not work - buffer all time is only 8Kb.

About error 10035 in *.h files:

The network operation would block.
#define WINSOCK_WSAEWOULDBLOCK           0x00002733L

A non-blocking socket operation could not be completed immediately.
#define WSAEWOULDBLOCK                   10035L

Reproduce code:
---------------
<?
    error_reporting(E_ALL);
    $f=fsockopen("www.php.net",80);
    var_dump(stream_set_write_buffer($f,50000));// no effects, always
-1 on any size
    stream_set_blocking($f,0);
    $post=str_repeat('b',9000); // 7000 - work, 8192 or more not work
    $str="POST / HTTP/1.0\r\n".
         "HOST: www.php.net\r\n".
         "Content-Type: application/x-www-form-urlencoded\r\n".
         "Content-Length: ".strlen($post)."\r\n\r\n$post";
    echo "fputs():\r\n".substr($str,0,1000)."\r\n";
    fputs($f,$str);
      // Notice: fputs(): send of 917 bytes failed with errno=10035
&#1054;&#1087;&#1077;&#1088;&#1072;&#1094;&#1080;&#1103; 
      // &#1085;&#1072;
&#1085;&#1077;&#1079;&#1072;&#1073;&#1083;&#1086;&#1082;&#1080;&#1088;&#1086;&#1074;&#1072;&#1085;&#1085;&#1086;&#1084;
&#1089;&#1086;&#1082;&#1077;&#1090;&#1077; &#1085;&#1077;
&#1084;&#1086;&#1078;&#1077;&#1090; &#1073;&#1099;&#1090;&#1100;
&#1079;&#1072;&#1074;&#1077;&#1088;&#1096;&#1077;&#1085;&#1072;
&#1085;&#1077;&#1084;&#1077;&#1076;&#1083;&#1077;&#1085;&#1085;&#1086;.
    while (!feof($f)) {
        echo fread($f,100000);
        sleep(1);
    }
?>

Expected result:
----------------
I want use fputs() with big http-request and use nonblock fsockopen ;-)

Actual result:
--------------
fputs($f,$str); without notice and sockets bug on 8Kb buffer


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39068&edit=1

Reply via email to