summaryrefslogtreecommitdiff
path: root/main/streams/xp_socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/streams/xp_socket.c')
-rw-r--r--main/streams/xp_socket.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index 7427a794b4..983f403c9d 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -55,10 +55,10 @@ php_stream_ops php_stream_unixdg_socket_ops;
#endif
-static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC);
+static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam);
/* {{{ Generic socket stream operations */
-static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
+static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
int didwrite;
@@ -102,7 +102,7 @@ retry:
} while (err == EINTR);
}
estr = php_socket_strerror(err, NULL, 0);
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of " ZEND_LONG_FMT " bytes failed with errno=%ld %s",
+ php_error_docref(NULL, E_NOTICE, "send of " ZEND_LONG_FMT " bytes failed with errno=%ld %s",
(zend_long)count, err, estr);
efree(estr);
}
@@ -118,7 +118,7 @@ retry:
return didwrite;
}
-static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock TSRMLS_DC)
+static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock)
{
int retval;
struct timeval *ptimeout;
@@ -148,7 +148,7 @@ static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data
}
}
-static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
+static size_t php_sockop_read(php_stream *stream, char *buf, size_t count)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
ssize_t nr_bytes = 0;
@@ -158,7 +158,7 @@ static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS
}
if (sock->is_blocked) {
- php_sock_stream_wait_for_data(stream, sock TSRMLS_CC);
+ php_sock_stream_wait_for_data(stream, sock);
if (sock->timeout_event)
return 0;
}
@@ -179,7 +179,7 @@ static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS
}
-static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC)
+static int php_sockop_close(php_stream *stream, int close_handle)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
#ifdef PHP_WIN32
@@ -222,7 +222,7 @@ static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC)
return 0;
}
-static int php_sockop_flush(php_stream *stream TSRMLS_DC)
+static int php_sockop_flush(php_stream *stream)
{
#if 0
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
@@ -231,7 +231,7 @@ static int php_sockop_flush(php_stream *stream TSRMLS_DC)
return 0;
}
-static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
+static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb)
{
#if ZEND_WIN32
return 0;
@@ -273,7 +273,7 @@ static inline int sock_recvfrom(php_netstream_data_t *sock, char *buf, size_t bu
ret = recvfrom(sock->socket, buf, XP_SOCK_BUF_SIZE(buflen), flags, (struct sockaddr*)&sa, &sl);
ret = (ret == SOCK_CONN_ERR) ? -1 : ret;
php_network_populate_name_from_sockaddr((struct sockaddr*)&sa, sl,
- textaddr, addr, addrlen TSRMLS_CC);
+ textaddr, addr, addrlen);
} else {
ret = recv(sock->socket, buf, XP_SOCK_BUF_SIZE(buflen), flags);
ret = (ret == SOCK_CONN_ERR) ? -1 : ret;
@@ -282,7 +282,7 @@ static inline int sock_recvfrom(php_netstream_data_t *sock, char *buf, size_t bu
return ret;
}
-static int php_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC)
+static int php_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam)
{
int oldmode, flags;
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
@@ -323,7 +323,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
case PHP_STREAM_OPTION_BLOCKING:
oldmode = sock->is_blocked;
- if (SUCCESS == php_set_sock_blocking(sock->socket, value TSRMLS_CC)) {
+ if (SUCCESS == php_set_sock_blocking(sock->socket, value)) {
sock->is_blocked = value;
return oldmode;
}
@@ -373,10 +373,10 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
xparam->inputs.buf, xparam->inputs.buflen,
flags,
xparam->inputs.addr,
- xparam->inputs.addrlen TSRMLS_CC);
+ xparam->inputs.addrlen);
if (xparam->outputs.returncode == -1) {
char *err = php_socket_strerror(php_socket_errno(), NULL, 0);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ php_error_docref(NULL, E_WARNING,
"%s\n", err);
efree(err);
}
@@ -427,7 +427,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
}
}
-static int php_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
+static int php_sockop_cast(php_stream *stream, int castas, void **ret)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
@@ -518,7 +518,7 @@ php_stream_ops php_stream_unixdg_socket_ops = {
/* network socket operations */
#ifdef AF_UNIX
-static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr TSRMLS_DC)
+static inline int parse_unix_address(php_stream_xport_param *xparam, struct sockaddr_un *unix_addr)
{
memset(unix_addr, 0, sizeof(*unix_addr));
unix_addr->sun_family = AF_UNIX;
@@ -532,7 +532,7 @@ static inline int parse_unix_address(php_stream_xport_param *xparam, struct sock
* BUT, to get into this branch of code, the name is too long,
* so we don't care. */
xparam->inputs.namelen = sizeof(unix_addr->sun_path) - 1;
- php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+ php_error_docref(NULL, E_NOTICE,
"socket path exceeded the maximum allowed length of %lu bytes "
"and was truncated", (unsigned long)sizeof(unix_addr->sun_path));
}
@@ -543,7 +543,7 @@ static inline int parse_unix_address(php_stream_xport_param *xparam, struct sock
}
#endif
-static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *portno, int get_err, zend_string **err TSRMLS_DC)
+static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *portno, int get_err, zend_string **err)
{
char *colon;
char *host = NULL;
@@ -582,13 +582,13 @@ static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *po
return host;
}
-static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno TSRMLS_DC)
+static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno)
{
- return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC);
+ return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_errortext, &xparam->outputs.error_text);
}
static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *sock,
- php_stream_xport_param *xparam TSRMLS_DC)
+ php_stream_xport_param *xparam)
{
char *host = NULL;
int portno, err;
@@ -610,14 +610,14 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
return -1;
}
- parse_unix_address(xparam, &unix_addr TSRMLS_CC);
+ parse_unix_address(xparam, &unix_addr);
return bind(sock->socket, (const struct sockaddr *)&unix_addr,
(socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen);
}
#endif
- host = parse_ip_address(xparam, &portno TSRMLS_CC);
+ host = parse_ip_address(xparam, &portno);
if (host == NULL) {
return -1;
@@ -626,7 +626,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
#ifdef SO_REUSEPORT
if (PHP_STREAM_CONTEXT(stream)
&& (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_reuseport")) != NULL
- && zend_is_true(tmpzval TSRMLS_CC)
+ && zend_is_true(tmpzval)
) {
sockopts |= STREAM_SOCKOP_SO_REUSEPORT;
}
@@ -636,7 +636,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
if (stream->ops == &php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */
&& PHP_STREAM_CONTEXT(stream)
&& (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_broadcast")) != NULL
- && zend_is_true(tmpzval TSRMLS_CC)
+ && zend_is_true(tmpzval)
) {
sockopts |= STREAM_SOCKOP_SO_BROADCAST;
}
@@ -657,7 +657,7 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *
}
static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_t *sock,
- php_stream_xport_param *xparam TSRMLS_DC)
+ php_stream_xport_param *xparam)
{
char *host = NULL, *bindto = NULL;
int portno, bindport = 0;
@@ -679,7 +679,7 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_
return -1;
}
- parse_unix_address(xparam, &unix_addr TSRMLS_CC);
+ parse_unix_address(xparam, &unix_addr);
ret = php_network_connect_socket(sock->socket,
(const struct sockaddr *)&unix_addr, (socklen_t) XtOffsetOf(struct sockaddr_un, sun_path) + xparam->inputs.namelen,
@@ -693,7 +693,7 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_
}
#endif
- host = parse_ip_address(xparam, &portno TSRMLS_CC);
+ host = parse_ip_address(xparam, &portno);
if (host == NULL) {
return -1;
@@ -707,14 +707,14 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_
efree(host);
return -1;
}
- bindto = parse_ip_address_ex(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC);
+ bindto = parse_ip_address_ex(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text);
}
#ifdef SO_BROADCAST
if (stream->ops == &php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */
&& PHP_STREAM_CONTEXT(stream)
&& (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_broadcast")) != NULL
- && zend_is_true(tmpzval TSRMLS_CC)
+ && zend_is_true(tmpzval)
) {
sockopts |= STREAM_SOCKOP_SO_BROADCAST;
}
@@ -758,7 +758,7 @@ out:
}
static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t *sock,
- php_stream_xport_param *xparam STREAMS_DC TSRMLS_DC)
+ php_stream_xport_param *xparam STREAMS_DC)
{
int clisock;
@@ -798,7 +798,7 @@ static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t
return xparam->outputs.client == NULL ? -1 : 0;
}
-static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC)
+static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
php_stream_xport_param *xparam;
@@ -810,23 +810,23 @@ static int php_tcp_sockop_set_option(php_stream *stream, int option, int value,
switch(xparam->op) {
case STREAM_XPORT_OP_CONNECT:
case STREAM_XPORT_OP_CONNECT_ASYNC:
- xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam TSRMLS_CC);
+ xparam->outputs.returncode = php_tcp_sockop_connect(stream, sock, xparam);
return PHP_STREAM_OPTION_RETURN_OK;
case STREAM_XPORT_OP_BIND:
- xparam->outputs.returncode = php_tcp_sockop_bind(stream, sock, xparam TSRMLS_CC);
+ xparam->outputs.returncode = php_tcp_sockop_bind(stream, sock, xparam);
return PHP_STREAM_OPTION_RETURN_OK;
case STREAM_XPORT_OP_ACCEPT:
- xparam->outputs.returncode = php_tcp_sockop_accept(stream, sock, xparam STREAMS_CC TSRMLS_CC);
+ xparam->outputs.returncode = php_tcp_sockop_accept(stream, sock, xparam STREAMS_CC);
return PHP_STREAM_OPTION_RETURN_OK;
default:
/* fall through */
;
}
}
- return php_sockop_set_option(stream, option, value, ptrparam TSRMLS_CC);
+ return php_sockop_set_option(stream, option, value, ptrparam);
}
@@ -834,7 +834,7 @@ PHPAPI php_stream *php_stream_generic_socket_factory(const char *proto, size_t p
const char *resourcename, size_t resourcenamelen,
const char *persistent_id, int options, int flags,
struct timeval *timeout,
- php_stream_context *context STREAMS_DC TSRMLS_DC)
+ php_stream_context *context STREAMS_DC)
{
php_stream *stream = NULL;
php_netstream_data_t *sock;