/* {{{ ftp_get
*/
int
-ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos)
+ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC)
{
databuf_t *data = NULL;
char *ptr;
int lastch;
size_t rcvd;
char arg[11];
- TSRMLS_FETCH();
if (ftp == NULL) {
return 0;
/* {{{ ftp_put
*/
int
-ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos)
+ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC)
{
databuf_t *data = NULL;
int size;
char *ptr;
int ch;
char arg[11];
- TSRMLS_FETCH();
if (ftp == NULL) {
return 0;
ftp->lastch = 0;
ftp->nb = 1;
- return (ftp_nb_continue_read(ftp));
+ return (ftp_nb_continue_read(ftp TSRMLS_CC));
bail:
data_close(ftp, data);
/* {{{ ftp_nb_continue_read
*/
int
-ftp_nb_continue_read(ftpbuf_t *ftp)
+ftp_nb_continue_read(ftpbuf_t *ftp TSRMLS_DC)
{
databuf_t *data = NULL;
char *ptr;
int lastch;
size_t rcvd;
ftptype_t type;
- TSRMLS_FETCH();
data = ftp->data;
ftp->lastch = 0;
ftp->nb = 1;
- return (ftp_nb_continue_write(ftp));
+ return (ftp_nb_continue_write(ftp TSRMLS_CC));
bail:
data_close(ftp, data);
/* {{{ ftp_nb_continue_write
*/
int
-ftp_nb_continue_write(ftpbuf_t *ftp)
+ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC)
{
int size;
char *ptr;
int ch;
- TSRMLS_FETCH();
/* check if we can write more data */
if (!data_writeable(ftp, ftp->data->fd)) {
/* retrieves a file and saves its contents to outfp
* returns true on success, false on error
*/
-int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path,
- ftptype_t type, int resumepos);
+int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC);
/* stores the data from a file, socket, or process as a file on the remote server
* returns true on success, false on error
*/
-int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos);
+int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC);
/* returns the size of the given file, or -1 on error */
int ftp_size(ftpbuf_t *ftp, const char *path);
/* continues a previous nb_(f)get command
*/
-int ftp_nb_continue_read(ftpbuf_t *ftp);
+int ftp_nb_continue_read(ftpbuf_t *ftp TSRMLS_DC);
/* continues a previous nb_(f)put command
*/
-int ftp_nb_continue_write(ftpbuf_t *ftp);
+int ftp_nb_continue_write(ftpbuf_t *ftp TSRMLS_DC);
#endif
}
}
- if (!ftp_get(ftp, stream, file, xtype, resumepos)) {
+ if (!ftp_get(ftp, stream, file, xtype, resumepos TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
RETURN_FALSE;
}
- if (!ftp_get(ftp, outstream, remote, xtype, resumepos)) {
+ if (!ftp_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) {
php_stream_close(outstream);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
if (ftp->direction) {
- ret=ftp_nb_continue_write(ftp);
+ ret=ftp_nb_continue_write(ftp TSRMLS_CC);
} else {
- ret=ftp_nb_continue_read(ftp);
+ ret=ftp_nb_continue_read(ftp TSRMLS_CC);
}
if (ret != PHP_FTP_MOREDATA && ftp->closestream) {
}
}
- if (!ftp_put(ftp, remote, stream, xtype, startpos)) {
+ if (!ftp_put(ftp, remote, stream, xtype, startpos TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
}
}
- if (!ftp_put(ftp, remote, instream, xtype, startpos)) {
+ if (!ftp_put(ftp, remote, instream, xtype, startpos TSRMLS_CC)) {
php_stream_close(instream);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;