/* {{{ ftp_open
*/
ftpbuf_t*
-ftp_open(const char *host, short port, long timeout_sec)
+ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC)
{
ftpbuf_t *ftp;
int size;
tv.tv_sec = timeout_sec;
tv.tv_usec = 0;
- ftp->fd = php_hostconnect(host, (unsigned short) (port ? port : 21), SOCK_STREAM, &tv);
+ ftp->fd = php_hostconnect(host, (unsigned short) (port ? port : 21), SOCK_STREAM, &tv TSRMLS_CC);
if (ftp->fd == -1) {
goto bail;
}
/* open a FTP connection, returns ftpbuf (NULL on error)
* port is the ftp port in network byte order, or 0 for the default
*/
-ftpbuf_t* ftp_open(const char *host, short port, long timeout_sec);
+ftpbuf_t* ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC);
/* quits from the ftp session (it still needs to be closed)
* return true on success, false on error
}
/* connect */
- ftp = ftp_open(host, (short)port, timeout_sec);
+ ftp = ftp_open(host, (short)port, timeout_sec TSRMLS_CC);
if (ftp == NULL) {
RETURN_FALSE;
}
/* {{{ php_network_getaddresses
* Returns number of addresses, 0 for none/error
*/
-static int php_network_getaddresses(const char *host, struct sockaddr ***sal)
+static int php_network_getaddresses(const char *host, struct sockaddr ***sal TSRMLS_DC)
{
struct sockaddr **sap;
int n;
* port, returns the created socket on success, else returns -1.
* timeout gives timeout in seconds, 0 means blocking mode.
*/
-int php_hostconnect(const char *host, unsigned short port, int socktype, struct timeval *timeout)
+int php_hostconnect(const char *host, unsigned short port, int socktype, struct timeval *timeout TSRMLS_DC)
{
int n, repeatto, s;
struct sockaddr **sal, **psal;
int err;
#endif
- n = php_network_getaddresses(host, &sal);
+ n = php_network_getaddresses(host, &sal TSRMLS_CC);
if (n == 0)
return -1;
{
int socket;
- socket = php_hostconnect(host, port, socktype, timeout);
+ socket = php_hostconnect(host, port, socktype, timeout TSRMLS_CC);
if (socket == -1)
return NULL;
#endif
-int php_hostconnect(const char *host, unsigned short port, int socktype, struct timeval *timeout);
+int php_hostconnect(const char *host, unsigned short port, int socktype, struct timeval *timeout TSRMLS_DC);
PHPAPI int php_connect_nonb(int sockfd, const struct sockaddr *addr, socklen_t addrlen, struct timeval *timeout);
#ifdef PHP_WIN32