summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/ftp/ftp.c4
-rw-r--r--ext/ftp/ftp.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 405843fcdd..f81ae75814 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -768,7 +768,7 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, i
size = 0;
ptr = data->buf;
- while ((ch = php_stream_getc(instream))!=EOF && !php_stream_eof(instream)) {
+ while (!php_stream_eof(instream) && (ch = php_stream_getc(instream))!=EOF) {
/* flush if necessary */
if (FTP_BUFSIZE - size < 2) {
if (my_send(ftp, data->fd, data->buf, size) != size)
@@ -1728,7 +1728,7 @@ ftp_nb_continue_write(ftpbuf_t *ftp)
size = 0;
ptr = ftp->data->buf;
- while ((ch = php_stream_getc(ftp->stream))!=EOF && !php_stream_eof(ftp->stream)) {
+ while (!php_stream_eof(ftp->stream) && (ch = php_stream_getc(ftp->stream))!=EOF) {
if (ch == '\n' && ftp->type == FTPTYPE_ASCII) {
*ptr++ = '\r';
diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h
index d93f028c28..0bcc28ba04 100644
--- a/ext/ftp/ftp.h
+++ b/ext/ftp/ftp.h
@@ -49,8 +49,10 @@ typedef struct databuf
int fd; /* data connection */
ftptype_t type; /* transfer type */
char buf[FTP_BUFSIZE]; /* data buffer */
+#if HAVE_OPENSSL_EXT
SSL *ssl_handle; /* ssl handle */
int ssl_active; /* flag if ssl is active or not */
+#endif
} databuf_t;
typedef struct ftpbuf