summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Esser <sesser@php.net>2002-10-03 12:16:44 +0000
committerStefan Esser <sesser@php.net>2002-10-03 12:16:44 +0000
commit8fae3d7a49e409f99cf2320be718841699becec2 (patch)
tree52b4c508b0ec48cdb97108cc1980efe48c316dca
parentae70a4e458b93add0a408c48b6c96f8e4fecc8e2 (diff)
downloadphp-git-8fae3d7a49e409f99cf2320be718841699becec2.tar.gz
swapped conditions to correct the logic
-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