mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
- Update protos for socket_read() and socket_write().
- Set last_error in socket_write().
This commit is contained in:
parent
ae5bc7c0f6
commit
07efbff856
1 changed files with 3 additions and 3 deletions
|
@ -696,7 +696,7 @@ PHP_FUNCTION(socket_close)
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ proto int socket_write(resource socket, string buf[, int length])
|
/* {{{ proto int socket_write(resource socket, string buf[, int length])
|
||||||
Writes the buffer to the file descriptor fd, length is optional */
|
Writes the buffer to the socket resource, length is optional */
|
||||||
PHP_FUNCTION(socket_write)
|
PHP_FUNCTION(socket_write)
|
||||||
{
|
{
|
||||||
zval *arg1;
|
zval *arg1;
|
||||||
|
@ -720,7 +720,7 @@ PHP_FUNCTION(socket_write)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
php_sock->error = errno;
|
SOCKETS_G(last_error) = php_sock->error = errno;
|
||||||
php_error(E_WARNING, "%s() unable to write to socket %d [%d]: %s", get_active_function_name(TSRMLS_C), php_sock->bsd_socket, errno, php_strerror(errno));
|
php_error(E_WARNING, "%s() unable to write to socket %d [%d]: %s", get_active_function_name(TSRMLS_C), php_sock->bsd_socket, errno, php_strerror(errno));
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -732,7 +732,7 @@ PHP_FUNCTION(socket_write)
|
||||||
typedef int (*read_func)(int, void *, int);
|
typedef int (*read_func)(int, void *, int);
|
||||||
|
|
||||||
/* {{{ proto string socket_read(resource socket, int length [, int type])
|
/* {{{ proto string socket_read(resource socket, int length [, int type])
|
||||||
Reads length bytes from socket */
|
Reads a maximum of length bytes from socket */
|
||||||
PHP_FUNCTION(socket_read)
|
PHP_FUNCTION(socket_read)
|
||||||
{
|
{
|
||||||
zval *arg1;
|
zval *arg1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue