sesser          Thu Sep 12 17:52:10 2002 EDT

  Modified files:              
    /php4/ext/standard  fsock.c ftp_fopen_wrapper.c 
    /php4/main  network.c php_network.h 
  Log:
  made new ssl activate function the default.
  
  
Index: php4/ext/standard/fsock.c
diff -u php4/ext/standard/fsock.c:1.102 php4/ext/standard/fsock.c:1.103
--- php4/ext/standard/fsock.c:1.102     Thu Sep  5 10:21:55 2002
+++ php4/ext/standard/fsock.c   Thu Sep 12 17:52:09 2002
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: fsock.c,v 1.102 2002/09/05 14:21:55 hyanantha Exp $ */
+/* $Id: fsock.c,v 1.103 2002/09/12 21:52:09 sesser Exp $ */
 
 /* converted to PHP Streams and moved much code to main/network.c [wez] */
 
@@ -227,10 +227,10 @@
                        int ssl_ret = FAILURE;
                        switch(ssl_flags)       {
                                case php_ssl_v23:
-                                       ssl_ret = 
php_stream_sock_ssl_activate_with_method(stream, 1, SSLv23_client_method() TSRMLS_CC);
+                                       ssl_ret = 
+php_stream_sock_ssl_activate_with_method(stream, 1, SSLv23_client_method(), NULL 
+TSRMLS_CC);
                                        break;
                                case php_ssl_tls:
-                                       ssl_ret = 
php_stream_sock_ssl_activate_with_method(stream, 1, TLSv1_client_method() TSRMLS_CC);
+                                       ssl_ret = 
+php_stream_sock_ssl_activate_with_method(stream, 1, TLSv1_client_method(), NULL 
+TSRMLS_CC);
                                        break;
                                default:
                                        /* unknown ?? */
Index: php4/ext/standard/ftp_fopen_wrapper.c
diff -u php4/ext/standard/ftp_fopen_wrapper.c:1.32 
php4/ext/standard/ftp_fopen_wrapper.c:1.33
--- php4/ext/standard/ftp_fopen_wrapper.c:1.32  Sun Sep  8 18:26:11 2002
+++ php4/ext/standard/ftp_fopen_wrapper.c       Thu Sep 12 17:52:09 2002
@@ -17,7 +17,7 @@
    |          Hartmut Holzgraefe <[EMAIL PROTECTED]>                       |
    +----------------------------------------------------------------------+
  */
-/* $Id: ftp_fopen_wrapper.c,v 1.32 2002/09/08 22:26:11 sesser Exp $ */
+/* $Id: ftp_fopen_wrapper.c,v 1.33 2002/09/12 21:52:09 sesser Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -204,7 +204,7 @@
        }
        
        if (use_ssl) {
-               if (use_ssl && php_stream_sock_ssl_activate_with_method(stream, 1, 
SSLv23_method()) == FAILURE) {
+               if (use_ssl && php_stream_sock_ssl_activate(stream, 1) == FAILURE)     
+ {
                        php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, 
"Unable to activate SSL mode");
                        php_stream_close(stream);
                        stream = NULL;
@@ -415,7 +415,7 @@
        php_stream_notify_progress_init(context, 0, file_size);
 
 #if HAVE_OPENSSL_EXT
-       if (use_ssl_on_data && php_stream_sock_ssl_activate_with_method_ex(datastream, 
1, SSLv23_method(), reuseid) == FAILURE) {
+       if (use_ssl_on_data && php_stream_sock_ssl_activate_with_method(datastream, 1, 
+SSLv23_method(), reuseid) == FAILURE)    {
                php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to 
activate SSL mode");
                php_stream_close(datastream);
                datastream = NULL;
Index: php4/main/network.c
diff -u php4/main/network.c:1.65 php4/main/network.c:1.66
--- php4/main/network.c:1.65    Mon Sep  9 07:23:11 2002
+++ php4/main/network.c Thu Sep 12 17:52:09 2002
@@ -16,7 +16,7 @@
    | Streams work by Wez Furlong <[EMAIL PROTECTED]>                   |
    +----------------------------------------------------------------------+
  */
-/* $Id: network.c,v 1.65 2002/09/09 11:23:11 hyanantha Exp $ */
+/* $Id: network.c,v 1.66 2002/09/12 21:52:09 sesser Exp $ */
 
 /*#define DEBUG_MAIN_NETWORK 1*/
 #define MAX_CHUNKS_PER_READ 10
@@ -602,19 +602,24 @@
 }
 
 #if HAVE_OPENSSL_EXT
-PHPAPI int php_stream_sock_ssl_activate_with_method_ex(php_stream *stream, int 
activate, SSL_METHOD *method, php_stream *control TSRMLS_DC)
+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;
        php_netstream_data_t *psock = NULL;
        SSL_CTX *ctx = NULL;
 
-       if (control) {
-               psock = (php_netstream_data_t*)control->abstract;
-       }
 
        if (!php_stream_is(stream, PHP_STREAM_IS_SOCKET)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"php_stream_sock_ssl_activate_with_method: stream is not a network stream");
                return FAILURE;
+       }
+
+       if (session_stream) {
+               if (!php_stream_is(session_stream, PHP_STREAM_IS_SOCKET)) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, 
+"php_stream_sock_ssl_activate_with_method: session_stream is not a network stream");
+                       return FAILURE;
+               }
+               psock = (php_netstream_data_t*)session_stream->abstract;
        }
        
        if (activate == sock->ssl_active)
Index: php4/main/php_network.h
diff -u php4/main/php_network.h:1.26 php4/main/php_network.h:1.27
--- php4/main/php_network.h:1.26        Sun Sep  8 18:26:11 2002
+++ php4/main/php_network.h     Thu Sep 12 17:52:09 2002
@@ -15,7 +15,7 @@
    | Author: Stig Venaas <[EMAIL PROTECTED]>                              |
    +----------------------------------------------------------------------+
  */
-/* $Id: php_network.h,v 1.26 2002/09/08 22:26:11 sesser Exp $ */
+/* $Id: php_network.h,v 1.27 2002/09/12 21:52:09 sesser Exp $ */
 
 #ifndef _PHP_NETWORK_H
 #define _PHP_NETWORK_H
@@ -148,9 +148,8 @@
 PHPAPI size_t php_stream_sock_set_chunk_size(php_stream *stream, size_t size 
TSRMLS_DC);
 
 #if HAVE_OPENSSL_EXT
-PHPAPI int php_stream_sock_ssl_activate_with_method_ex(php_stream *stream, int 
activate, SSL_METHOD *method, php_stream *control TSRMLS_DC);
-#define php_stream_sock_ssl_activate_with_method(stream, activate, method) 
php_stream_sock_ssl_activate_with_method_ex((stream), (activate), 
SSLv23_client_method(), NULL TSRMLS_CC)
-#define php_stream_sock_ssl_activate(stream, activate) 
php_stream_sock_ssl_activate_with_method((stream), (activate), SSLv23_client_method() 
TSRMLS_CC)
+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)
 
 #endif
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to