Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notice: uv_http_parser_execute(): passed uv_parser resource has already finished. #42

Open
gplanchat opened this issue Mar 7, 2013 · 0 comments

Comments

@gplanchat
Copy link

While I am using the example inthe docs for uv_http_parser_init and uv_http_parser_execute (https://github.com/chobie/php-uv#example-102), with a POST request, I have in some cases a warning and the parsing fails :

Notice: uv_http_parser_execute(): passed uv_parser resource has already finished. in D:\php-env\workspace\php-io\src\test_http_parser.php on line 25

When I execute 10 times the example, the first 2 times works well, the following times it fails :

<?php

for ($i = 0; $i < 10; $i++) {
    $parser = uv_http_parser_init(UV::HTTP_REQUEST);
    $result = [];

    $request = <<<REQUEST_EOF
POST /img/http-parser.png?key=value#frag HTTP/1.1
Host: chobie.net
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20100101 Firefox/12.0
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Referer: http://chobie.net/
Cookie: key=value
Cache-Control: max-age=0
Content-Type: application/x-www-form-urlencoded
Content-Length: 50

licenseID=string&content=string&/paramsXML=string


REQUEST_EOF;

    if (uv_http_parser_execute($parser, $request, $result)) {
        var_dump($result);
    }
}

I am using Windows builds from http://windows.php.net/downloads/pecl/snaps/uv/0.0.1/, with PHP as CLI :

$ php -v
PHP 5.4.11 (cli) (built: Jan 16 2013 20:26:43)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

$ php -i
phpinfo()
PHP Version => 5.4.11

System => Windows NT GREG-PC 6.0 build 6002 (Windows Vista Ultimate Edition Service Pack 2) i586
Build Date => Jan 16 2013 20:22:58
Compiler => MSVC9 (Visual C++ 2008)
Architecture => x86
Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--without-mssql" "--without-pdo-mssql" "--without-pi3web" "--with-pdo-oci=C:\php-s
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => C:\Windows
Loaded Configuration File => C:\Program Files (x86)\PHP\php-5.4\php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20100412
PHP Extension => 20100525
Zend Extension => 220100525
Zend Extension Build => API220100525,TS,VC9
PHP Extension Build => API20100525,TS,VC9
Debug Build => no
Thread Safety => enabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled

Registered PHP Streams => php, file, glob, data, http, ftp, zip, compress.zlib, compress.bzip2, https, ftps, phar
Registered Stream Socket Transports => tcp, udp, ssl, sslv3, sslv2, tls
Registered Stream Filters => convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*, bzip2.*

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

uv
PHP libuv Extension

libuv Support => enabled
Version => 0.0.1
bundled libuv Version => 0.9
bundled http-parser Version => 1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant