]> granicus.if.org Git - php/commitdiff
MFH
authorfoobar <sniper@php.net>
Fri, 27 Jun 2003 16:42:51 +0000 (16:42 +0000)
committerfoobar <sniper@php.net>
Fri, 27 Jun 2003 16:42:51 +0000 (16:42 +0000)
13 files changed:
ext/ftp/ftp.c
ext/ftp/ftp.h
ext/ftp/php_ftp.c
ext/ftp/php_ftp.h
ext/openssl/php_openssl.h
ext/standard/basic_functions.c
ext/standard/fsock.c
ext/standard/ftp_fopen_wrapper.c
ext/standard/http_fopen_wrapper.c
main/internal_functions.c.in
main/network.c
main/php_network.h
sapi/apache/php_apache_http.h

index 34afd72e73833a48cbfbfc11d837e881fe311cf3..c3bf8a4464579a75761485eaf3e8a5dc21189c6e 100644 (file)
@@ -165,7 +165,7 @@ ftp_close(ftpbuf_t *ftp)
        if (ftp->data) 
                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);
                }
@@ -224,13 +224,13 @@ 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;
@@ -1089,7 +1089,7 @@ my_send(ftpbuf_t *ftp, int 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
@@ -1133,7 +1133,7 @@ my_recv(ftpbuf_t *ftp, int 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
@@ -1354,7 +1354,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp)
        php_sockaddr_storage addr;
        socklen_t                       size;
 
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
        SSL_CTX         *ctx;
        TSRMLS_FETCH(); 
 #endif
@@ -1373,7 +1373,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp)
        }
 
 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) {
@@ -1420,7 +1420,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
        if (data == NULL)
                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;
@@ -1429,7 +1429,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;
index 43d7e98827f7e00f519bc56bc12f313f00114192..7ce9f803f4bb105aa71f715f8f5b0498dc6530d5 100644 (file)
@@ -49,7 +49,7 @@ typedef struct databuf
        int             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 */
index b125fa98dba587b4b0ca3f08c42d989b763255bb..d0b06dba9ba3f5059e8c8b39be2e1432bec8169a 100644 (file)
@@ -48,7 +48,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)
@@ -166,7 +166,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
@@ -175,7 +175,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)
index 10c87b7b0ae7d6425592b7e3636f0f5bc6cc97e8..31d2794ac9f39cd14b5fb8b900df9e85b7278e6c 100644 (file)
@@ -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);
index 147fb9b6b82673f7213e824c2f495cd87dd1bbd9..be3cf411661f67255d332993cf623967c50d942f 100644 (file)
@@ -38,7 +38,7 @@
 
 
 /* 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
 
index 141922ad9879e795e6c015fc001d64bc9f3b58af..ba56dce3062f1ecfb2141a7f73b7afe75223df76 100644 (file)
@@ -1055,7 +1055,7 @@ PHP_MINIT_FUNCTION(basic)
 #ifndef PHP_CURL_URL_WRAPPERS
        php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC);
        php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC);
-# if HAVE_OPENSSL_EXT
+# ifdef HAVE_OPENSSL_EXT
        php_register_url_stream_wrapper("https", &php_stream_http_wrapper TSRMLS_CC);
        php_register_url_stream_wrapper("ftps", &php_stream_ftp_wrapper TSRMLS_CC);
 # endif
@@ -1077,7 +1077,7 @@ PHP_MSHUTDOWN_FUNCTION(basic)
 #ifndef PHP_CURL_URL_WRAPPERS
        php_unregister_url_stream_wrapper("http" TSRMLS_CC);
        php_unregister_url_stream_wrapper("ftp" TSRMLS_CC);
-# if HAVE_OPENSSL_EXT
+# ifdef HAVE_OPENSSL_EXT
        php_unregister_url_stream_wrapper("https" TSRMLS_CC);
        php_unregister_url_stream_wrapper("ftps" TSRMLS_CC);
 # endif
index cbae0aee5115ec2d4735053aa0f95189b01d4d5d..b8dadf5c7701826731892eb423b3be30fa956e52 100644 (file)
@@ -217,7 +217,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                                break;
                        }
                }
-#if !HAVE_OPENSSL_EXT
+#ifndef HAVE_OPENSSL_EXT
                if (ssl_flags != php_ssl_none) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "no SSL support in this build");
                }
@@ -234,7 +234,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                        php_stream_context_set(stream, context);
                }
                
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
                if (stream && ssl_flags != php_ssl_none) {
                        int ssl_ret = FAILURE;
                        switch(ssl_flags)       {
index b30d763f3e4d3e84a8115bc2d7aaa6c6b1ec1200..0dc91752e5841ae12df37439039f5bf468c8e707 100644 (file)
@@ -143,7 +143,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
        char *scratch;
        int result;
        int i, use_ssl;
-#if HAVE_OPENSSL_EXT   
+#ifdef HAVE_OPENSSL_EXT        
        int use_ssl_on_data=0;
        php_stream *reuseid=NULL;
 #endif 
@@ -183,7 +183,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
                goto errexit;
        }
 
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
        if (use_ssl)    {
        
                /* send the AUTH TLS request name */
@@ -434,7 +434,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
        php_stream_context_set(datastream, context);
        php_stream_notify_progress_init(context, 0, file_size);
 
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
        if (use_ssl_on_data && php_stream_sock_ssl_activate_with_method(datastream, 1, SSLv23_method(), reuseid TSRMLS_CC) == FAILURE)  {
                php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode");
                php_stream_close(datastream);
index 0a4d7f5682cc73c8581926eb116f4ccc51eae9e9..75ca9c60ff95cbc2223eeabe89d82a476135f597 100644 (file)
@@ -145,7 +145,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path,
 
        php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
        
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
        if (use_ssl)    {
 
                if (context) {
index 4903d6c4bb052fe5089a6c56d99a441712227182..280218409b853cd56cc51b093d5a63a67ad860ef 100644 (file)
@@ -29,7 +29,7 @@
 #include <stdlib.h>
 #include <stdio.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 <openssl/ssl.h>
index 2bc20ef826db58e837d32a6a2794b4367114a973..243851171f6c17725b81e49d38a6cfc8a859ac42 100644 (file)
@@ -98,7 +98,7 @@ int inet_aton(const char *, struct in_addr *);
 
 #include "ext/standard/file.h"
 
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
 static int handle_ssl_error(php_stream *stream, int nr_bytes TSRMLS_DC);
 #endif
 
@@ -700,7 +700,7 @@ PHPAPI php_stream *_php_stream_sock_open_unix(const char *path, int pathlen, con
 #endif
 }
 
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
 PHPAPI int php_stream_sock_ssl_activate_with_method(php_stream *stream, int activate, SSL_METHOD *method, php_stream *session_stream TSRMLS_DC)
 {
        php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
@@ -813,7 +813,7 @@ PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC)
       return ret;
 }
 
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
 
 static void php_ERR_error_string_n(int code, char *buf, size_t size)
 {
@@ -914,7 +914,7 @@ static size_t php_sockop_write(php_stream *stream, const char *buf, size_t count
        php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
        int didwrite;
        
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
        if (sock->ssl_active) {
                int retry = 1;
 
@@ -997,7 +997,7 @@ static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS
        php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
        int nr_bytes = 0;
 
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
        if (sock->ssl_active) {
                int retry = 1;
 
@@ -1057,7 +1057,7 @@ static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC)
 #endif
 
        if (close_handle) {
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
                if (sock->ssl_active) {
                        SSL_shutdown(sock->ssl_handle);
                        sock->ssl_active = 0;
@@ -1156,7 +1156,7 @@ int _php_network_is_stream_alive(php_stream *stream)
        if (select(fd+1, &rfds, NULL, NULL, &tv) > 0) {
 
                if (FD_ISSET(fd, &rfds)) {
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
                        if (sock->ssl_active) {
                                int n;
                        
@@ -1205,7 +1205,7 @@ static int php_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
 
        switch(castas)  {
                case PHP_STREAM_AS_STDIO:
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
                        if (sock->ssl_active) {
                                return FAILURE;
                        }
@@ -1220,7 +1220,7 @@ static int php_sockop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
                        return SUCCESS;
                case PHP_STREAM_AS_FD:
                case PHP_STREAM_AS_SOCKETD:
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
                        if (sock->ssl_active) {
                                return FAILURE;
                        }
index 0eb09cf4082ddcc68885e56953fe900bbf6f6218..65646ab50a04012a4368d25cbd02cccf59c87a4f 100644 (file)
@@ -74,7 +74,7 @@ PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize);
 #include <sys/time.h>
 #endif
 
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
 #include <openssl/ssl.h>
 #endif
 
@@ -124,7 +124,7 @@ struct _php_netstream_data_t        {
        char is_blocked;
        struct timeval timeout;
        char timeout_event;
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
        /* openssl specific bits here */
        SSL *ssl_handle;
        int ssl_active;
@@ -158,7 +158,7 @@ PHPAPI php_stream *_php_stream_sock_open_unix(const char *path, int pathlen, con
 /* private API; don't use in extensions */
 int _php_network_is_stream_alive(php_stream *stream);
 
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
 PHPAPI int php_stream_sock_ssl_activate_with_method(php_stream *stream, int activate, SSL_METHOD *method, php_stream *session_stream TSRMLS_DC);
 #define php_stream_sock_ssl_activate(stream, activate) php_stream_sock_ssl_activate_with_method((stream), (activate), SSLv23_client_method(), NULL TSRMLS_CC)
 
index f3909efb772a96632fdc3382943f6fde56415d3d..73b157a6433c64578e874319412240ed786d3154 100644 (file)
@@ -13,7 +13,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 <openssl/ssl.h>