X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_requestpool_object.c;h=e01e26d21db5f8066a0119572b48c69fd3628664;hp=53233429cfcaa5b44e0cc760c9976c45534c3fe6;hb=5aa47bb3226e35928025f06f0b550582f69608bd;hpb=19cad54672b6babfac2b7c9c64c415c9a24b888a diff --git a/http_requestpool_object.c b/http_requestpool_object.c index 5323342..e01e26d 100644 --- a/http_requestpool_object.c +++ b/http_requestpool_object.c @@ -116,7 +116,7 @@ zend_object_value _http_requestpool_object_new(zend_class_entry *ce TSRMLS_DC) zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0); zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)); - ov.handle = zend_objects_store_put(o, (zend_objects_store_dtor_t) zend_objects_destroy_object, http_requestpool_object_free, NULL TSRMLS_CC); + ov.handle = putObject(http_requestpool_object, o); ov.handlers = &http_requestpool_object_handlers; return ov; @@ -159,7 +159,7 @@ void _http_requestpool_object_free(zend_object *object TSRMLS_DC) * $pool->send(); * foreach($pool as $request) { * printf("%s is %s (%d)\n", - * $request->getResponseInfo('effective_url'), + * $request->getUrl(), * $request->getResponseCode() ? 'alive' : 'not alive', * $request->getResponseCode() * ); @@ -330,6 +330,8 @@ PHP_METHOD(HttpRequestPool, socketRead) /* implements Iterator */ /* {{{ proto bool HttpRequestPool::valid() + * + * Implements Iterator::valid(). */ PHP_METHOD(HttpRequestPool, valid) { @@ -343,6 +345,8 @@ PHP_METHOD(HttpRequestPool, valid) /* }}} */ /* {{{ proto HttpRequest HttpRequestPool::current() + * + * Implements Iterator::current(). */ PHP_METHOD(HttpRequestPool, current) { @@ -355,8 +359,8 @@ PHP_METHOD(HttpRequestPool, current) getObject(http_requestpool_object, obj); if (obj->iterator.pos < zend_llist_count(&obj->pool.handles)) { - for ( current = zend_llist_get_first_ex(&obj->pool.handles, &lpos); - current && obj->iterator.pos != pos++; + for ( current = zend_llist_get_first_ex(&obj->pool.handles, &lpos); + current && obj->iterator.pos != pos++; current = zend_llist_get_next_ex(&obj->pool.handles, &lpos)); if (current) { RETURN_OBJECT(*current); @@ -368,6 +372,8 @@ PHP_METHOD(HttpRequestPool, current) /* }}} */ /* {{{ proto long HttpRequestPool::key() + * + * Implements Iterator::key(). */ PHP_METHOD(HttpRequestPool, key) { @@ -381,6 +387,8 @@ PHP_METHOD(HttpRequestPool, key) /* }}} */ /* {{{ proto void HttpRequestPool::next() + * + * Implements Iterator::next(). */ PHP_METHOD(HttpRequestPool, next) { @@ -392,6 +400,8 @@ PHP_METHOD(HttpRequestPool, next) /* }}} */ /* {{{ proto void HttpRequestPool::rewind() + * + * Implements Iterator::rewind(). */ PHP_METHOD(HttpRequestPool, rewind) {