diff options
| author | Felipe Pena <felipe@php.net> | 2008-07-15 11:20:06 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2008-07-15 11:20:06 +0000 |
| commit | 0bccc60ec2db01de1b9ca4a9fcdd051bd4975939 (patch) | |
| tree | a5e5feced89dabc9d4ef0832ed01b83fa4de9f18 | |
| parent | 9f0c8398d6ac446aa8c451c17c394ed80a01181c (diff) | |
| download | php-git-0bccc60ec2db01de1b9ca4a9fcdd051bd4975939.tar.gz | |
- Reverted fix for #44197 (unsuitable for minor versions)
| -rw-r--r-- | ext/sockets/sockets.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index bd1d74be58..70214a2bc4 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -584,10 +584,7 @@ static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC) / zval **dest_element; php_socket *php_sock; HashTable *new_hash; - char *key; int num = 0; - ulong num_key; - uint key_len; if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0; @@ -602,14 +599,8 @@ static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC) / if (PHP_SAFE_FD_ISSET(php_sock->bsd_socket, fds)) { /* Add fd to new array */ - switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(sock_array), &key, &key_len, &num_key, 0, NULL)) { - case HASH_KEY_IS_STRING: - zend_hash_add(new_hash, key, key_len, (void *)element, sizeof(zval *), (void **)&dest_element); - break; - case HASH_KEY_IS_LONG: - zend_hash_index_update(new_hash, num_key, (void *)element, sizeof(zval *), (void **)&dest_element); - break; - } + zend_hash_next_index_insert(new_hash, (void *)element, sizeof(zval *), (void **)&dest_element); + if (dest_element) zval_add_ref(dest_element); } num++; |
