Author: nandika
Date: Tue Sep  7 07:50:09 2010
New Revision: 993263

URL: http://svn.apache.org/viewvc?rev=993263&view=rev
Log:
ssl issue fixed

Modified:
    
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/http_client.c
    
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/http_sender.c
    
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_stream.c
    
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_stream.h
    
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_utils.c

Modified: 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/http_client.c
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/http_client.c?rev=993263&r1=993262&r2=993263&view=diff
==============================================================================
--- 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/http_client.c
 (original)
+++ 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/http_client.c
 Tue Sep  7 07:50:09 2010
@@ -120,7 +120,15 @@ axis2_http_client_free(
     }
     if(-1 != http_client->sockfd)
     {
-        axutil_network_handler_close_socket(env, http_client->sockfd);
+#ifdef AXIS2_SSL_ENABLED
+               if(http_client->data_stream->stream_type == AXIS2_STREAM_SOCKET)
+               {
+                       axutil_network_handler_close_socket(env, 
http_client->sockfd);
+                       /** ssl streams of type AXIS2_STREAM_BASIC  will be 
handled by SSL_shutdown(); */
+               }
+#else
+               axutil_network_handler_close_socket(env, http_client->sockfd);
+#endif
         http_client->sockfd = -1;
     }
 

Modified: 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/http_sender.c
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/http_sender.c?rev=993263&r1=993262&r2=993263&view=diff
==============================================================================
--- 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/http_sender.c
 (original)
+++ 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/http_sender.c
 Tue Sep  7 07:50:09 2010
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
+#include <axutil_stream.h>
 #include <axis2_http_sender.h>
 #include <axutil_string.h>
 #include <axis2_http_transport.h>
@@ -36,6 +36,7 @@
 #include <axis2_util.h>
 #include <axiom_soap.h>
 #include <axutil_version.h>
+#include "ssl/ssl_stream.h"
 
 #ifdef AXIS2_LIBCURL_ENABLED
 #include "libcurl/axis2_libcurl.h"
@@ -43,6 +44,8 @@
 #define CLIENT_NONCE_LENGTH 8
 #endif
 
+
+
 struct axis2_http_sender
 {
     axis2_char_t *http_version;
@@ -1594,7 +1597,14 @@ axis2_http_sender_process_response(
         response, env));
     property = axutil_property_create(env);
     axutil_property_set_scope(property, env, AXIS2_SCOPE_REQUEST);
-    axutil_property_set_free_func(property, env, axutil_stream_free_void_arg);
+#ifdef AXIS2_SSL_ENABLED
+       if(in_stream->stream_type == AXIS2_STREAM_SOCKET)
+               axutil_property_set_free_func(property, env, 
axutil_stream_free_void_arg);
+       else /** SSL Streams are AXIS2_STREAM_BASIC */
+               axutil_property_set_free_func(property, env, 
axis2_ssl_stream_free);
+#else
+   axutil_property_set_free_func(property, env, axutil_stream_free_void_arg);
+#endif
     axutil_property_set_value(property, env, in_stream);
     axis2_msg_ctx_set_property(msg_ctx, env, AXIS2_TRANSPORT_IN, property);
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
"Exit:axis2_http_sender_process_response");

Modified: 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_stream.c
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_stream.c?rev=993263&r1=993262&r2=993263&view=diff
==============================================================================
--- 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_stream.c
 (original)
+++ 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_stream.c
 Tue Sep  7 07:50:09 2010
@@ -38,10 +38,6 @@ struct ssl_stream_impl
 
 #define AXIS2_INTF_TO_IMPL(stream) ((ssl_stream_impl_t *)(stream))
 
-void AXIS2_CALL axis2_ssl_stream_free(
-    axutil_stream_t * stream,
-    const axutil_env_t * env);
-
 axutil_stream_type_t AXIS2_CALL axis2_ssl_stream_get_type(
     axutil_stream_t * stream,
     const axutil_env_t * env);
@@ -118,11 +114,11 @@ axutil_stream_create_ssl(
 
 void AXIS2_CALL
 axis2_ssl_stream_free(
-    axutil_stream_t * stream,
+    void * streamv,
     const axutil_env_t * env)
 {
     ssl_stream_impl_t *stream_impl = NULL;
-
+    axutil_stream_t* stream = (axutil_stream_t*)streamv;
     stream_impl = AXIS2_INTF_TO_IMPL(stream);
     axis2_ssl_utils_cleanup_ssl(env, stream_impl->ctx, stream_impl->ssl);
     AXIS2_FREE(env->allocator, stream_impl);

Modified: 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_stream.h
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_stream.h?rev=993263&r1=993262&r2=993263&view=diff
==============================================================================
--- 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_stream.h
 (original)
+++ 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_stream.h
 Tue Sep  7 07:50:09 2010
@@ -41,6 +41,11 @@ extern "C"
         axis2_char_t * key_file,
         axis2_char_t * ssl_pp);
 
+       void AXIS2_CALL
+       axis2_ssl_stream_free(
+               void *stream, 
+               const axutil_env_t *env);
+
     /** @} */
 
 #ifdef __cplusplus

Modified: 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_utils.c
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_utils.c?rev=993263&r1=993262&r2=993263&view=diff
==============================================================================
--- 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_utils.c
 (original)
+++ 
axis/axis2/c/core/branches/c/1.7.x/1.7.0/c/src/core/transport/http/sender/ssl/ssl_utils.c
 Tue Sep  7 07:50:09 2010
@@ -215,7 +215,10 @@ axis2_ssl_utils_cleanup_ssl(
 
     if (ssl)
     {
-        SSL_shutdown(ssl);
+        if(SSL_shutdown(ssl)==0)
+               {
+                       SSL_free(ssl);
+               }
     }
     if (ctx)
     {


Reply via email to