]> granicus.if.org Git - php/commitdiff
Cleanup
authorDmitry Stogov <dmitry@zend.com>
Tue, 7 Apr 2015 11:19:12 +0000 (14:19 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 7 Apr 2015 11:19:12 +0000 (14:19 +0300)
ext/hash/hash.c
ext/ldap/ldap.c
main/streams/streams.c

index d9c3a892d918c9cd2b94076d1daa6cd3806a34ae..3a15fc6fcc6e87ffe2313b995428afacac2d58cf 100644 (file)
@@ -531,14 +531,6 @@ PHP_FUNCTION(hash_final)
        digest->val[digest_len] = 0;
        efree(hash->context);
        hash->context = NULL;
-
-       //???
-       //??? /* zend_list_REAL_delete() */
-       //??? if (zend_hash_index_find(&EG(regular_list), Z_RESVAL_P(zhash), (void *) &le)==SUCCESS) {
-       //???   /* This is a hack to avoid letting the resource hide elsewhere (like in separated vars)
-       //???           FETCH_RESOURCE is intelligent enough to handle dealing with any issues this causes */
-       //???   le->refcount = 1;
-       //??? } /* FAILURE is not an option */
        zend_list_close(Z_RES_P(zhash));
 
        if (raw_output) {
index 6ad3a936005748c5207fdf0c2a59a65d066cc0f9..c64b13bab56de6e994d0c266d609040e6b6fc0b0 100644 (file)
@@ -1975,7 +1975,8 @@ PHP_FUNCTION(ldap_sort)
                RETURN_FALSE;
        }
 
-       if ((le = zend_hash_index_find_ptr(&EG(regular_list), Z_RES_HANDLE_P(result))) == NULL || le->type != le_result) {
+       le = Z_RES_P(result);
+       if (le->type != le_result) {
                php_error_docref(NULL, E_WARNING, "Supplied resource is not a valid ldap result resource");
                RETURN_FALSE;
        }
index 0e95544fc14761169038dd8496c9e8d886dca639..886fc1da289076bae9ed5b4c2bc3525c9fc7b3f7 100644 (file)
@@ -65,15 +65,6 @@ PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void)
        return &url_stream_wrappers_hash;
 }
 
-static int _php_stream_release_context(zval *zv, void *pContext)
-{
-       zend_resource *le = Z_RES_P(zv);
-       if (le->ptr == pContext) {
-               return --GC_REFCOUNT(le) == 0;
-       }
-       return 0;
-}
-
 static int forget_persistent_resource_id_numbers(zval *el)
 {
        php_stream *stream;
@@ -91,11 +82,8 @@ fprintf(stderr, "forget_persistent: %s:%p\n", stream->ops->label, stream);
 
        stream->res = NULL;
 
-       if (PHP_STREAM_CONTEXT(stream)) {
-               zend_hash_apply_with_argument(&EG(regular_list),
-                               _php_stream_release_context,
-                               PHP_STREAM_CONTEXT(stream));
-               stream->ctx = NULL;
+       if (stream->ctx) {
+               zend_list_delete(stream->ctx);
        }
 
        return 0;
@@ -336,7 +324,7 @@ fprintf(stderr, "stream_alloc: %s:%p persistent=%s\n", ops->label, ret, persiste
 
 PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options) /* {{{ */
 {
-       return _php_stream_free(stream_enclosed,
+       return php_stream_free(stream_enclosed,
                close_options | PHP_STREAM_FREE_IGNORE_ENCLOSING);
 }
 /* }}} */
@@ -418,7 +406,7 @@ PHPAPI int _php_stream_free(php_stream *stream, int close_options) /* {{{ */
                /* we force PHP_STREAM_CALL_DTOR because that's from where the
                 * enclosing stream can free this stream. We remove rsrc_dtor because
                 * we want the enclosing stream to be deleted from the resource list */
-               return _php_stream_free(enclosing_stream,
+               return php_stream_free(enclosing_stream,
                        (close_options | PHP_STREAM_FREE_CALL_DTOR) & ~PHP_STREAM_FREE_RSRC_DTOR);
        }