|
|
e448ba |
From 3ea92e49821638be039be7085659af160a6d4ebf Mon Sep 17 00:00:00 2001
|
|
|
e448ba |
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdo@users.sourceforge.net>
|
|
|
e448ba |
Date: Mon, 22 Apr 2013 15:45:26 +0200
|
|
|
e448ba |
Subject: [PATCH 3/3] Init protocols should be done right after resetting curl
|
|
|
e448ba |
handle (cherry picked from commit e75bd2548101b8681edf13ea085d62634b7668cf)
|
|
|
e448ba |
|
|
|
e448ba |
Conflicts:
|
|
|
e448ba |
src/libcmis/base-session.cxx
|
|
|
e448ba |
---
|
|
|
e448ba |
src/libcmis/base-session.cxx | 7 ++++---
|
|
|
e448ba |
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
e448ba |
|
|
|
e448ba |
diff --git a/src/libcmis/base-session.cxx b/src/libcmis/base-session.cxx
|
|
|
e448ba |
index 9d08edc..478d0de 100644
|
|
|
e448ba |
--- a/src/libcmis/base-session.cxx
|
|
|
e448ba |
+++ b/src/libcmis/base-session.cxx
|
|
|
e448ba |
@@ -123,7 +123,6 @@ BaseSession::BaseSession( string atomPubUrl, string repositoryId, string usernam
|
|
|
e448ba |
{
|
|
|
e448ba |
curl_global_init( CURL_GLOBAL_ALL );
|
|
|
e448ba |
m_curlHandle = curl_easy_init( );
|
|
|
e448ba |
- initProtocols();
|
|
|
e448ba |
}
|
|
|
e448ba |
|
|
|
e448ba |
BaseSession::BaseSession( const BaseSession& copy ) :
|
|
|
e448ba |
@@ -143,7 +142,6 @@ BaseSession::BaseSession( const BaseSession& copy ) :
|
|
|
e448ba |
// Not sure how sharing curl handles is safe.
|
|
|
e448ba |
curl_global_init( CURL_GLOBAL_ALL );
|
|
|
e448ba |
m_curlHandle = curl_easy_init( );
|
|
|
e448ba |
- initProtocols();
|
|
|
e448ba |
}
|
|
|
e448ba |
|
|
|
e448ba |
BaseSession& BaseSession::operator=( const BaseSession& copy )
|
|
|
e448ba |
@@ -163,7 +161,6 @@ BaseSession& BaseSession::operator=( const BaseSession& copy )
|
|
|
e448ba |
// Not sure how sharing curl handles is safe.
|
|
|
e448ba |
curl_global_init( CURL_GLOBAL_ALL );
|
|
|
e448ba |
m_curlHandle = curl_easy_init( );
|
|
|
e448ba |
- initProtocols();
|
|
|
e448ba |
|
|
|
e448ba |
return *this;
|
|
|
e448ba |
}
|
|
|
e448ba |
@@ -223,6 +220,7 @@ libcmis::HttpResponsePtr BaseSession::httpGetRequest( string url ) throw ( CurlE
|
|
|
e448ba |
{
|
|
|
e448ba |
// Reset the handle for the request
|
|
|
e448ba |
curl_easy_reset( m_curlHandle );
|
|
|
e448ba |
+ initProtocols( );
|
|
|
e448ba |
|
|
|
e448ba |
libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) );
|
|
|
e448ba |
|
|
|
e448ba |
@@ -255,6 +253,7 @@ libcmis::HttpResponsePtr BaseSession::httpPutRequest( string url, istream& is, v
|
|
|
e448ba |
{
|
|
|
e448ba |
// Reset the handle for the request
|
|
|
e448ba |
curl_easy_reset( m_curlHandle );
|
|
|
e448ba |
+ initProtocols( );
|
|
|
e448ba |
|
|
|
e448ba |
libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) );
|
|
|
e448ba |
|
|
|
e448ba |
@@ -320,6 +319,7 @@ libcmis::HttpResponsePtr BaseSession::httpPostRequest( string url, istringstream
|
|
|
e448ba |
{
|
|
|
e448ba |
// Reset the handle for the request
|
|
|
e448ba |
curl_easy_reset( m_curlHandle );
|
|
|
e448ba |
+ initProtocols( );
|
|
|
e448ba |
|
|
|
e448ba |
libcmis::HttpResponsePtr response( new libcmis::HttpResponse( ) );
|
|
|
e448ba |
|
|
|
e448ba |
@@ -385,6 +385,7 @@ void BaseSession::httpDeleteRequest( string url ) throw ( CurlException )
|
|
|
e448ba |
{
|
|
|
e448ba |
// Reset the handle for the request
|
|
|
e448ba |
curl_easy_reset( m_curlHandle );
|
|
|
e448ba |
+ initProtocols( );
|
|
|
e448ba |
|
|
|
e448ba |
curl_easy_setopt( m_curlHandle, CURLOPT_CUSTOMREQUEST, "DELETE" );
|
|
|
e448ba |
httpRunRequest( url );
|
|
|
e448ba |
--
|
|
|
e448ba |
1.8.1.4
|
|
|
e448ba |
|