Re: [PHP-CVS] svn: /php/php-src/trunk/main/streams/ php_stream_context.h streams.c

2012-02-22 Thread Pierre Joye
hi,

On Tue, Feb 21, 2012 at 11:09 PM, Gustavo Lopes glo...@nebm.ist.utl.pt wrote:

 Perhaps someone's private code used it?


 Sure, it's possible. In that case, they'll have a long time to complain
 since this is only for trunk and PHP 5.5 is years away.

No, php-next begins next year, one year after we began 5.4.

However, where is the discussion about dropping this?

I'm not saying we should keep it but a discussion is a must in this
case, on internals, at least to give a chance to possible users or
other devs to raise their points.

Cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/trunk/main/streams/ php_stream_context.h streams.c

2012-02-21 Thread Gustavo André dos Santos Lopes
cataphract   Tue, 21 Feb 2012 21:55:00 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323416

Log:
- Revert r134029. The streams pooling API was never used in more
  than 8 years and therefore unnecessarily adds complexity.

Changed paths:
U   php/php-src/trunk/main/streams/php_stream_context.h
U   php/php-src/trunk/main/streams/streams.c

Modified: php/php-src/trunk/main/streams/php_stream_context.h
===
--- php/php-src/trunk/main/streams/php_stream_context.h 2012-02-21 20:57:57 UTC 
(rev 323415)
+++ php/php-src/trunk/main/streams/php_stream_context.h 2012-02-21 21:55:00 UTC 
(rev 323416)
@@ -53,7 +53,6 @@
 struct _php_stream_context {
php_stream_notifier *notifier;
zval *options;  /* hash keyed by wrapper family or specific wrapper */
-   zval *links;/* hash keyed by hostent for connection pooling */
int rsrc_id;/* used for auto-cleanup */
 };

@@ -65,13 +64,6 @@
 PHPAPI int php_stream_context_set_option(php_stream_context *context,
const char *wrappername, const char *optionname, zval 
*optionvalue);

-PHPAPI int php_stream_context_get_link(php_stream_context *context,
-   const char *hostent, php_stream **stream);
-PHPAPI int php_stream_context_set_link(php_stream_context *context,
-   const char *hostent, php_stream *stream);
-PHPAPI int php_stream_context_del_link(php_stream_context *context,
-   php_stream *stream);
-
 PHPAPI php_stream_notifier *php_stream_notification_alloc(void);
 PHPAPI void php_stream_notification_free(php_stream_notifier *notifier);
 END_EXTERN_C()

Modified: php/php-src/trunk/main/streams/streams.c
===
--- php/php-src/trunk/main/streams/streams.c2012-02-21 20:57:57 UTC (rev 
323415)
+++ php/php-src/trunk/main/streams/streams.c2012-02-21 21:55:00 UTC (rev 
323416)
@@ -444,11 +444,6 @@
while (zend_list_delete(stream-rsrc_id) == SUCCESS) {}
}

-   /* Remove stream from any context link list */
-   if (stream-context  stream-context-links) {
-   php_stream_context_del_link(stream-context, stream);
-   }
-
if (close_options  PHP_STREAM_FREE_CALL_DTOR) {
if (release_cast  stream-fclose_stdiocast == 
PHP_STREAM_FCLOSE_FOPENCOOKIE) {
/* calling fclose on an fopencookied stream will 
ultimately
@@ -2143,10 +2138,6 @@
php_stream_notification_free(context-notifier);
context-notifier = NULL;
}
-   if (context-links) {
-   zval_ptr_dtor(context-links);
-   context-links = NULL;
-   }
efree(context);
 }

@@ -2209,66 +2200,6 @@
}
return zend_hash_update(Z_ARRVAL_PP(wrapperhash), (char*)optionname, 
strlen(optionname)+1, (void**)copied_val, sizeof(zval *), NULL);
 }
-
-PHPAPI int php_stream_context_get_link(php_stream_context *context,
-const char *hostent, php_stream **stream)
-{
-   php_stream **pstream;
-
-   if (!stream || !hostent || !context || !(context-links)) {
-   return FAILURE;
-   }
-   if (SUCCESS == zend_hash_find(Z_ARRVAL_P(context-links), 
(char*)hostent, strlen(hostent)+1, (void**)pstream)) {
-   *stream = *pstream;
-   return SUCCESS;
-   }
-   return FAILURE;
-}
-
-PHPAPI int php_stream_context_set_link(php_stream_context *context,
-const char *hostent, php_stream *stream)
-{
-   if (!context) {
-   return FAILURE;
-   }
-   if (!context-links) {
-   ALLOC_INIT_ZVAL(context-links);
-   array_init(context-links);
-   }
-   if (!stream) {
-   /* Delete any entry for hostent */
-   return zend_hash_del(Z_ARRVAL_P(context-links), 
(char*)hostent, strlen(hostent)+1);
-   }
-   return zend_hash_update(Z_ARRVAL_P(context-links), (char*)hostent, 
strlen(hostent)+1, (void**)stream, sizeof(php_stream *), NULL);
-}
-
-PHPAPI int php_stream_context_del_link(php_stream_context *context,
-php_stream *stream)
-{
-   php_stream **pstream;
-   char *hostent;
-   int ret = SUCCESS;
-
-   if (!context || !context-links || !stream) {
-   return FAILURE;
-   }
-
-   for(zend_hash_internal_pointer_reset(Z_ARRVAL_P(context-links));
-   SUCCESS == 
zend_hash_get_current_data(Z_ARRVAL_P(context-links), (void**)pstream);
-   zend_hash_move_forward(Z_ARRVAL_P(context-links))) {
-   if (*pstream == stream) {
-   if (SUCCESS == 
zend_hash_get_current_key(Z_ARRVAL_P(context-links), hostent, NULL, 0)) {
-   if (FAILURE == 
zend_hash_del(Z_ARRVAL_P(context-links), (char*)hostent, strlen(hostent)+1)) {
-   ret = FAILURE;

Re: [PHP-CVS] svn: /php/php-src/trunk/main/streams/ php_stream_context.h streams.c

2012-02-21 Thread Christopher Jones



On 02/21/2012 01:55 PM, Gustavo André dos Santos Lopes wrote:

cataphract   Tue, 21 Feb 2012 21:55:00 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323416

Log:
- Revert r134029. The streams pooling API was never used in more
   than 8 years and therefore unnecessarily adds complexity.


Perhaps someone's private code used it?

In any case, since this is a breakage, it should be in UPGRADING and NEWS.

Chris

--
Email: christopher.jo...@oracle.com
Tel:  +1 650 506 8630
Blog:  http://blogs.oracle.com/opal/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] svn: /php/php-src/trunk/main/streams/ php_stream_context.h streams.c

2012-02-21 Thread Gustavo Lopes
On Tue, 21 Feb 2012 23:00:21 +0100, Christopher Jones  
christopher.jo...@oracle.com wrote:





On 02/21/2012 01:55 PM, Gustavo André dos Santos Lopes wrote:

cataphract   Tue, 21 Feb 2012 21:55:00 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323416

Log:
- Revert r134029. The streams pooling API was never used in more
   than 8 years and therefore unnecessarily adds complexity.


Perhaps someone's private code used it?



Sure, it's possible. In that case, they'll have a long time to complain  
since this is only for trunk and PHP 5.5 is years away.


In any case, since this is a breakage, it should be in UPGRADING and  
NEWS.




Thank you for the reminder; I will add it.

--
Gustavo Lopes

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php