From: foobar Date: Fri, 27 Jun 2003 16:41:41 +0000 (+0000) Subject: - HAVE_OPENSSL_EXT is not defined always. X-Git-Tag: php-5.0.0b1~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a7ca909becef523275ac0b7cc8d2f9d5b3eff1d;p=php - HAVE_OPENSSL_EXT is not defined always. --- diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index 911f3c1141..32257a1e73 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -65,7 +65,7 @@ #include #endif -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT #include #endif @@ -179,7 +179,7 @@ ftp_close(ftpbuf_t *ftp) data_close(ftp, ftp->data); } if (ftp->fd != -1) { -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT if (ftp->ssl_active) { SSL_shutdown(ftp->ssl_handle); } @@ -241,14 +241,14 @@ ftp_quit(ftpbuf_t *ftp) int ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC) { -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT SSL_CTX *ctx = NULL; #endif if (ftp == NULL) { return 0; } -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT if (ftp->use_ssl && !ftp->ssl_active) { if (!ftp_putcmd(ftp, "AUTH", "TLS")) { return 0; @@ -1199,7 +1199,7 @@ my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) return -1; } -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT if (ftp->use_ssl && ftp->fd == s && ftp->ssl_active) { sent = SSL_write(ftp->ssl_handle, buf, size); } else if (ftp->use_ssl && ftp->fd != s && ftp->use_ssl_for_data && ftp->data->ssl_active) { @@ -1207,7 +1207,7 @@ my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) } else { #endif sent = send(s, buf, size, 0); -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT } #endif if (sent == -1) { @@ -1247,7 +1247,7 @@ my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) return -1; } -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT if (ftp->use_ssl && ftp->fd == s && ftp->ssl_active) { nr_bytes = SSL_read(ftp->ssl_handle, buf, len); } else if (ftp->use_ssl && ftp->fd != s && ftp->use_ssl_for_data && ftp->data->ssl_active) { @@ -1255,7 +1255,7 @@ my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len) } else { #endif nr_bytes = recv(s, buf, len, 0); -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT } #endif return (nr_bytes); @@ -1475,7 +1475,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC) php_sockaddr_storage addr; socklen_t size; -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT SSL_CTX *ctx; #endif @@ -1493,7 +1493,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC) } data_accepted: -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT /* now enable ssl if we need to */ if (ftp->use_ssl && ftp->use_ssl_for_data) { @@ -1541,7 +1541,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data) return NULL; } if (data->listener != -1) { -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT if (data->ssl_active) { SSL_shutdown(data->ssl_handle); data->ssl_active = 0; @@ -1550,7 +1550,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data) closesocket(data->listener); } if (data->fd != -1) { -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT if (data->ssl_active) { SSL_shutdown(data->ssl_handle); data->ssl_active = 0; diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h index 4ab8c56e4d..0628a0dfcf 100644 --- a/ext/ftp/ftp.h +++ b/ext/ftp/ftp.h @@ -49,7 +49,7 @@ typedef struct databuf php_socket_t fd; /* data connection */ ftptype_t type; /* transfer type */ char buf[FTP_BUFSIZE]; /* data buffer */ -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT SSL *ssl_handle; /* ssl handle */ int ssl_active; /* flag if ssl is active or not */ #endif @@ -78,7 +78,7 @@ typedef struct ftpbuf int lastch; /* last char of previous call */ int direction; /* recv = 0 / send = 1 */ int closestream;/* close or not close stream */ -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT int use_ssl; /* enable(1) or disable(0) ssl */ int use_ssl_for_data; /* en/disable ssl for the dataconnection */ int old_ssl; /* old mode = forced data encryption */ diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index bc546732f6..94a0c8bc5f 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -35,7 +35,7 @@ #endif #endif -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT #include #endif @@ -52,7 +52,7 @@ static int le_ftpbuf; function_entry php_ftp_functions[] = { PHP_FE(ftp_connect, NULL) -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT PHP_FE(ftp_ssl_connect, NULL) #endif PHP_FE(ftp_login, NULL) @@ -171,7 +171,7 @@ PHP_FUNCTION(ftp_connect) /* autoseek for resuming */ ftp->autoseek = FTP_DEFAULT_AUTOSEEK; -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT /* disable ssl */ ftp->use_ssl = 0; #endif @@ -180,7 +180,7 @@ PHP_FUNCTION(ftp_connect) } /* }}} */ -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT /* {{{ proto resource ftp_ssl_connect(string host [, int port [, int timeout)]]) Opens a FTP-SSL stream */ PHP_FUNCTION(ftp_ssl_connect) diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h index b09d24bf00..a8bb36f93a 100644 --- a/ext/ftp/php_ftp.h +++ b/ext/ftp/php_ftp.h @@ -35,7 +35,7 @@ PHP_MINIT_FUNCTION(ftp); PHP_MINFO_FUNCTION(ftp); PHP_FUNCTION(ftp_connect); -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT PHP_FUNCTION(ftp_ssl_connect); #endif PHP_FUNCTION(ftp_login); diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index eaa84b7252..f1f85cb645 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -22,7 +22,7 @@ #ifndef PHP_OPENSSL_H #define PHP_OPENSSL_H /* HAVE_OPENSSL would include SSL MySQL stuff */ -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT extern zend_module_entry openssl_module_entry; #define phpext_openssl_ptr &openssl_module_entry diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in index 4017194ca2..b0e541c7b9 100644 --- a/main/internal_functions.c.in +++ b/main/internal_functions.c.in @@ -28,7 +28,7 @@ #include #include -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT /* zlib typedefs free_func which causes problems if the SSL includes happen * after zlib.h is included */ # include diff --git a/sapi/apache/php_apache_http.h b/sapi/apache/php_apache_http.h index a1b1f6b25a..5cf10407fa 100644 --- a/sapi/apache/php_apache_http.h +++ b/sapi/apache/php_apache_http.h @@ -34,7 +34,7 @@ #include "php_regex.h" #include "php_compat.h" -#if HAVE_OPENSSL_EXT +#ifdef HAVE_OPENSSL_EXT /* zlib typedefs free_func which causes problems if the SSL includes happen * after zlib.h is included */ # include