HTTP_END_ARGS;
HTTP_EMPTY_ARGS(send, 0);
-HTTP_EMPTY_ARGS(socketSend, 0);
+HTTP_EMPTY_ARGS(socketPerform, 0);
HTTP_EMPTY_ARGS(socketSelect, 0);
-HTTP_EMPTY_ARGS(socketRead, 0);
HTTP_EMPTY_ARGS(valid, 0);
HTTP_EMPTY_ARGS(current, 1);
HTTP_REQPOOL_ME(send, ZEND_ACC_PUBLIC)
HTTP_REQPOOL_ME(reset, ZEND_ACC_PUBLIC)
- HTTP_REQPOOL_ME(socketSend, ZEND_ACC_PROTECTED)
+ HTTP_REQPOOL_ME(socketPerform, ZEND_ACC_PROTECTED)
HTTP_REQPOOL_ME(socketSelect, ZEND_ACC_PROTECTED)
- HTTP_REQPOOL_ME(socketRead, ZEND_ACC_PROTECTED)
/* implements Interator */
HTTP_REQPOOL_ME(valid, ZEND_ACC_PUBLIC)
* Usage:
* <pre>
* <?php
- * while ($pool->socketSend()) {
+ * while ($pool->socketPerform()) {
* do_something_else();
* if (!$pool->socketSelect()) {
* die('Socket error');
* }
* }
- * $pool->socketRead();
* ?>
* </pre>
*/
-PHP_METHOD(HttpRequestPool, socketSend)
+PHP_METHOD(HttpRequestPool, socketPerform)
{
getObject(http_requestpool_object, obj);
NO_ARGS;
- RETURN_BOOL(0 < http_request_pool_perform(&obj->pool));
+ if (0 < http_request_pool_perform(&obj->pool)) {
+ RETURN_TRUE;
+ } else {
+ zend_llist_apply(&obj->pool.handles, (llist_apply_func_t) http_request_pool_responsehandler TSRMLS_CC);
+ RETURN_FALSE;
+ }
}
/* }}} */
/* {{{ proto protected bool HttpRequestPool::socketSelect()
*
- * See HttpRequestPool::socketSend().
+ * See HttpRequestPool::socketPerform().
*/
PHP_METHOD(HttpRequestPool, socketSelect)
{
}
/* }}} */
-/* {{{ proto protected void HttpRequestPool::socketRead()
- *
- * See HttpRequestPool::socketSend().
- */
-PHP_METHOD(HttpRequestPool, socketRead)
-{
- getObject(http_requestpool_object, obj);
-
- NO_ARGS;
-
- zend_llist_apply(&obj->pool.handles, (llist_apply_func_t) http_request_pool_responsehandler TSRMLS_CC);
-}
-/* }}} */
-
/* implements Iterator */
/* {{{ proto bool HttpRequestPool::valid()
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
-<!-- $Revision: 1.35 $ -->
+<!-- $Revision: 1.36 $ -->
<package version="1.0">
<name>pecl_http</name>
<summary>Extended HTTP support</summary>
+ Added constants HttpMessage::NONE, Http_Message::REQUEST, HttpMessage::RESPONSE
+ Added Content-Length header if HttpResponse sends full plain entity
+ Added ZendEngine workaround for internal class' static properties (HttpResponse)
++ Added HttpRequestPool::socketPerform()
- Removed http_split_response()
- Removed AuthBasic hooks
- Removed HttpResponse::sendHeader(), HttpResponse::sendStatus()
- Removed HttpRequest::unset*() methods, now handled through set*() with empty parameter
+- Removed HttpRequestPool::socketRead(), HttpRequestPool::socketSend()
* Fixed initialization and cleanup of module globals
* Fixed builds and tests without libcurl
PHP_METHOD(HttpRequestPool, detach);
PHP_METHOD(HttpRequestPool, send);
PHP_METHOD(HttpRequestPool, reset);
-PHP_METHOD(HttpRequestPool, socketSend);
+PHP_METHOD(HttpRequestPool, socketPerform);
PHP_METHOD(HttpRequestPool, socketSelect);
-PHP_METHOD(HttpRequestPool, socketRead);
PHP_METHOD(HttpRequestPool, valid);
PHP_METHOD(HttpRequestPool, current);
PHP_METHOD(HttpRequestPool, key);