sniper Fri Jun 27 12:42:51 2003 EDT
Modified files: (Branch: PHP_4_3)
/php-src/ext/ftp ftp.c ftp.h php_ftp.c php_ftp.h
/php-src/ext/openssl php_openssl.h
/php-src/ext/standard basic_functions.c fsock.c ftp_fopen_wrapper.c
http_fopen_wrapper.c
/php-src/main internal_functions.c.in network.c php_network.h
/php-src/sapi/apache php_apache_http.h
Log:
MFH
Index: php-src/ext/ftp/ftp.c
diff -u php-src/ext/ftp/ftp.c:1.68.2.7 php-src/ext/ftp/ftp.c:1.68.2.8
--- php-src/ext/ftp/ftp.c:1.68.2.7 Mon May 19 09:27:05 2003
+++ php-src/ext/ftp/ftp.c Fri Jun 27 12:42:50 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ftp.c,v 1.68.2.7 2003/05/19 13:27:05 moriyoshi Exp $ */
+/* $Id: ftp.c,v 1.68.2.8 2003/06/27 16:42:50 sniper Exp $ */
#include "php.h"
@@ -165,7 +165,7 @@
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 @@
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 @@
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 @@
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 @@
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_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 @@
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 @@
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: php-src/ext/ftp/ftp.h
diff -u php-src/ext/ftp/ftp.h:1.30.2.2 php-src/ext/ftp/ftp.h:1.30.2.3
--- php-src/ext/ftp/ftp.h:1.30.2.2 Mon Jan 6 22:53:56 2003
+++ php-src/ext/ftp/ftp.h Fri Jun 27 12:42:50 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ftp.h,v 1.30.2.2 2003/01/07 03:53:56 iliaa Exp $ */
+/* $Id: ftp.h,v 1.30.2.3 2003/06/27 16:42:50 sniper Exp $ */
#ifndef FTP_H
#define FTP_H
@@ -49,7 +49,7 @@
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 @@
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: php-src/ext/ftp/php_ftp.c
diff -u php-src/ext/ftp/php_ftp.c:1.74.2.8 php-src/ext/ftp/php_ftp.c:1.74.2.9
--- php-src/ext/ftp/php_ftp.c:1.74.2.8 Sat May 17 00:20:12 2003
+++ php-src/ext/ftp/php_ftp.c Fri Jun 27 12:42:50 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ftp.c,v 1.74.2.8 2003/05/17 04:20:12 pollita Exp $ */
+/* $Id: php_ftp.c,v 1.74.2.9 2003/06/27 16:42:50 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -48,7 +48,7 @@
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 @@
/* 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 @@
}
/* }}} */
-#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: php-src/ext/ftp/php_ftp.h
diff -u php-src/ext/ftp/php_ftp.h:1.21.2.1 php-src/ext/ftp/php_ftp.h:1.21.2.2
--- php-src/ext/ftp/php_ftp.h:1.21.2.1 Tue Dec 31 11:34:35 2002
+++ php-src/ext/ftp/php_ftp.h Fri Jun 27 12:42:50 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ftp.h,v 1.21.2.1 2002/12/31 16:34:35 sebastian Exp $ */
+/* $Id: php_ftp.h,v 1.21.2.2 2003/06/27 16:42:50 sniper Exp $ */
#ifndef _INCLUDED_FTP_H
#define _INCLUDED_FTP_H
@@ -35,7 +35,7 @@
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: php-src/ext/openssl/php_openssl.h
diff -u php-src/ext/openssl/php_openssl.h:1.10.8.4
php-src/ext/openssl/php_openssl.h:1.10.8.5
--- php-src/ext/openssl/php_openssl.h:1.10.8.4 Thu May 1 06:44:17 2003
+++ php-src/ext/openssl/php_openssl.h Fri Jun 27 12:42:50 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_openssl.h,v 1.10.8.4 2003/05/01 10:44:17 wez Exp $ */
+/* $Id: php_openssl.h,v 1.10.8.5 2003/06/27 16:42:50 sniper Exp $ */
#ifndef PHP_OPENSSL_H
#define PHP_OPENSSL_H
@@ -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: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.543.2.18
php-src/ext/standard/basic_functions.c:1.543.2.19
--- php-src/ext/standard/basic_functions.c:1.543.2.18 Fri May 30 21:37:43 2003
+++ php-src/ext/standard/basic_functions.c Fri Jun 27 12:42:51 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.543.2.18 2003/05/31 01:37:43 sniper Exp $ */
+/* $Id: basic_functions.c,v 1.543.2.19 2003/06/27 16:42:51 sniper Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -1055,7 +1055,7 @@
#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 @@
#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: php-src/ext/standard/fsock.c
diff -u php-src/ext/standard/fsock.c:1.106.2.7 php-src/ext/standard/fsock.c:1.106.2.8
--- php-src/ext/standard/fsock.c:1.106.2.7 Mon May 19 20:21:57 2003
+++ php-src/ext/standard/fsock.c Fri Jun 27 12:42:51 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fsock.c,v 1.106.2.7 2003/05/20 00:21:57 wez Exp $ */
+/* $Id: fsock.c,v 1.106.2.8 2003/06/27 16:42:51 sniper Exp $ */
/* converted to PHP Streams and moved much code to main/network.c [wez] */
@@ -217,7 +217,7 @@
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 @@
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: php-src/ext/standard/ftp_fopen_wrapper.c
diff -u php-src/ext/standard/ftp_fopen_wrapper.c:1.38.2.4
php-src/ext/standard/ftp_fopen_wrapper.c:1.38.2.5
--- php-src/ext/standard/ftp_fopen_wrapper.c:1.38.2.4 Mon Feb 24 23:20:44 2003
+++ php-src/ext/standard/ftp_fopen_wrapper.c Fri Jun 27 12:42:51 2003
@@ -17,7 +17,7 @@
| Hartmut Holzgraefe <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: ftp_fopen_wrapper.c,v 1.38.2.4 2003/02/25 04:20:44 iliaa Exp $ */
+/* $Id: ftp_fopen_wrapper.c,v 1.38.2.5 2003/06/27 16:42:51 sniper Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -143,7 +143,7 @@
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 @@
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_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: php-src/ext/standard/http_fopen_wrapper.c
diff -u php-src/ext/standard/http_fopen_wrapper.c:1.53.2.12
php-src/ext/standard/http_fopen_wrapper.c:1.53.2.13
--- php-src/ext/standard/http_fopen_wrapper.c:1.53.2.12 Tue May 6 07:04:42 2003
+++ php-src/ext/standard/http_fopen_wrapper.c Fri Jun 27 12:42:51 2003
@@ -18,7 +18,7 @@
| Wez Furlong <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: http_fopen_wrapper.c,v 1.53.2.12 2003/05/06 11:04:42 sas Exp $ */
+/* $Id: http_fopen_wrapper.c,v 1.53.2.13 2003/06/27 16:42:51 sniper Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -145,7 +145,7 @@
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: php-src/main/internal_functions.c.in
diff -u php-src/main/internal_functions.c.in:1.22
php-src/main/internal_functions.c.in:1.22.4.1
--- php-src/main/internal_functions.c.in:1.22 Fri Mar 15 16:03:07 2002
+++ php-src/main/internal_functions.c.in Fri Jun 27 12:42:51 2003
@@ -18,7 +18,7 @@
*/
-/* $Id: internal_functions.c.in,v 1.22 2002/03/15 21:03:07 wez Exp $ */
+/* $Id: internal_functions.c.in,v 1.22.4.1 2003/06/27 16:42:51 sniper Exp $ */
#include "php.h"
#include "php_main.h"
@@ -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: php-src/main/network.c
diff -u php-src/main/network.c:1.83.2.17 php-src/main/network.c:1.83.2.18
--- php-src/main/network.c:1.83.2.17 Sun Jun 22 06:07:20 2003
+++ php-src/main/network.c Fri Jun 27 12:42:51 2003
@@ -16,7 +16,7 @@
| Streams work by Wez Furlong <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: network.c,v 1.83.2.17 2003/06/22 10:07:20 wez Exp $ */
+/* $Id: network.c,v 1.83.2.18 2003/06/27 16:42:51 sniper Exp $ */
/*#define DEBUG_MAIN_NETWORK 1*/
@@ -98,7 +98,7 @@
#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 @@
#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 @@
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 @@
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 @@
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 @@
#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 @@
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 @@
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 @@
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: php-src/main/php_network.h
diff -u php-src/main/php_network.h:1.37.2.2 php-src/main/php_network.h:1.37.2.3
--- php-src/main/php_network.h:1.37.2.2 Mon May 12 19:44:48 2003
+++ php-src/main/php_network.h Fri Jun 27 12:42:51 2003
@@ -15,7 +15,7 @@
| Author: Stig Venaas <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_network.h,v 1.37.2.2 2003/05/12 23:44:48 wez Exp $ */
+/* $Id: php_network.h,v 1.37.2.3 2003/06/27 16:42:51 sniper Exp $ */
#ifndef _PHP_NETWORK_H
#define _PHP_NETWORK_H
@@ -74,7 +74,7 @@
#include <sys/time.h>
#endif
-#if HAVE_OPENSSL_EXT
+#ifdef HAVE_OPENSSL_EXT
#include <openssl/ssl.h>
#endif
@@ -124,7 +124,7 @@
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 @@
/* 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: php-src/sapi/apache/php_apache_http.h
diff -u php-src/sapi/apache/php_apache_http.h:1.4
php-src/sapi/apache/php_apache_http.h:1.4.2.1
--- php-src/sapi/apache/php_apache_http.h:1.4 Mon Oct 7 20:13:56 2002
+++ php-src/sapi/apache/php_apache_http.h Fri Jun 27 12:42:51 2003
@@ -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>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php