parent
83b022808a
commit
7bd278c2ff
@ -1,25 +0,0 @@
|
||||
From 433fad370ddd30c43df281b40ff468a842bc1c70 Mon Sep 17 00:00:00 2001
|
||||
From: Adam Conrad <adconrad@ubuntu.com>
|
||||
Date: Thu, 6 Feb 2014 09:13:32 +0100
|
||||
Subject: [PATCH] Fix int/bool confusion on big-endian architectures.
|
||||
|
||||
---
|
||||
qa/libcmis-c/test-document.cxx | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/qa/libcmis-c/test-document.cxx b/qa/libcmis-c/test-document.cxx
|
||||
index ccf2224..eb2c01c 100644
|
||||
--- a/qa/libcmis-c/test-document.cxx
|
||||
+++ b/qa/libcmis-c/test-document.cxx
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
-extern int isOutOfMemory;
|
||||
+extern bool isOutOfMemory;
|
||||
|
||||
namespace
|
||||
{
|
||||
--
|
||||
1.8.5.3
|
||||
|
@ -1,68 +0,0 @@
|
||||
From 1f48b994ac987c20f8da2e4fa9ec0399877655c7 Mon Sep 17 00:00:00 2001
|
||||
From: David Tardon <dtardon@redhat.com>
|
||||
Date: Thu, 4 Sep 2014 16:48:00 +0200
|
||||
Subject: [PATCH] coverity: return const string&
|
||||
|
||||
Otherwise the use in the C wrapper functions is invalid, as the
|
||||
functions return char* from a string object that is destroyed in the
|
||||
function scope.
|
||||
---
|
||||
src/libcmis/oauth2-data.hxx | 12 ++++++------
|
||||
src/libcmis/rendition.hxx | 12 ++++++------
|
||||
2 files changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/libcmis/oauth2-data.hxx b/src/libcmis/oauth2-data.hxx
|
||||
index aa99e2c..000f939 100644
|
||||
--- a/src/libcmis/oauth2-data.hxx
|
||||
+++ b/src/libcmis/oauth2-data.hxx
|
||||
@@ -62,12 +62,12 @@ namespace libcmis
|
||||
|
||||
bool isComplete();
|
||||
|
||||
- std::string getAuthUrl() { return m_authUrl; }
|
||||
- std::string getTokenUrl() { return m_tokenUrl; }
|
||||
- std::string getClientId() { return m_clientId; }
|
||||
- std::string getClientSecret() { return m_clientSecret; }
|
||||
- std::string getScope() { return m_scope; }
|
||||
- std::string getRedirectUri() { return m_redirectUri; }
|
||||
+ const std::string& getAuthUrl() { return m_authUrl; }
|
||||
+ const std::string& getTokenUrl() { return m_tokenUrl; }
|
||||
+ const std::string& getClientId() { return m_clientId; }
|
||||
+ const std::string& getClientSecret() { return m_clientSecret; }
|
||||
+ const std::string& getScope() { return m_scope; }
|
||||
+ const std::string& getRedirectUri() { return m_redirectUri; }
|
||||
};
|
||||
typedef ::boost::shared_ptr< OAuth2Data > OAuth2DataPtr;
|
||||
}
|
||||
diff --git a/src/libcmis/rendition.hxx b/src/libcmis/rendition.hxx
|
||||
index 820b58d..c58b7ac 100644
|
||||
--- a/src/libcmis/rendition.hxx
|
||||
+++ b/src/libcmis/rendition.hxx
|
||||
@@ -65,18 +65,18 @@ namespace libcmis
|
||||
|
||||
bool isThumbnail( ) { return m_kind == "cmis:thumbnail"; }
|
||||
|
||||
- std::string getStreamId( ) const { return m_streamId; }
|
||||
- std::string getMimeType( ) const { return m_mimeType; }
|
||||
- std::string getKind( ) const { return m_kind; }
|
||||
- std::string getUrl( ) const { return m_href; }
|
||||
- std::string getTitle( ) const { return m_title; }
|
||||
+ const std::string& getStreamId( ) const { return m_streamId; }
|
||||
+ const std::string& getMimeType( ) const { return m_mimeType; }
|
||||
+ const std::string& getKind( ) const { return m_kind; }
|
||||
+ const std::string& getUrl( ) const { return m_href; }
|
||||
+ const std::string& getTitle( ) const { return m_title; }
|
||||
|
||||
/** Provides the stream length in bytes or a negative value if missing.
|
||||
*/
|
||||
long getLength( ) const { return m_length; }
|
||||
long getWidth( ) const { return m_width; }
|
||||
long getHeight( ) const { return m_height; }
|
||||
- std::string getRenditionDocumentId( ) { return m_renditionDocumentId; }
|
||||
+ const std::string& getRenditionDocumentId( ) { return m_renditionDocumentId; }
|
||||
|
||||
std::string toString( );
|
||||
};
|
||||
--
|
||||
1.9.3
|
||||
|
@ -1,107 +0,0 @@
|
||||
From 043561716b1c7c23c1576631c5bdca93e6e9ffe5 Mon Sep 17 00:00:00 2001
|
||||
From: David Tardon <dtardon@redhat.com>
|
||||
Date: Fri, 5 Sep 2014 09:53:50 +0200
|
||||
Subject: [PATCH] fix mismatching exceptions
|
||||
|
||||
---
|
||||
src/libcmis/base-session.cxx | 56 +++++++++++++++++++++++++++++++++++---------
|
||||
1 file changed, 45 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/libcmis/base-session.cxx b/src/libcmis/base-session.cxx
|
||||
index 7f6a413..80c53e4 100644
|
||||
--- a/src/libcmis/base-session.cxx
|
||||
+++ b/src/libcmis/base-session.cxx
|
||||
@@ -287,8 +287,15 @@ libcmis::HttpResponsePtr BaseSession::httpGetRequest( string url ) throw ( CurlE
|
||||
// Need to use the refresh token to get a new one.
|
||||
if ( getHttpStatus( ) == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken )
|
||||
{
|
||||
- // Refresh the token
|
||||
- m_oauth2Handler->refresh( );
|
||||
+ try
|
||||
+ {
|
||||
+ // Refresh the token
|
||||
+ m_oauth2Handler->refresh( );
|
||||
+ }
|
||||
+ catch ( const libcmis::Exception& e )
|
||||
+ {
|
||||
+ throw CurlException( e.what() );
|
||||
+ }
|
||||
|
||||
// Resend the query
|
||||
try
|
||||
@@ -370,8 +377,15 @@ libcmis::HttpResponsePtr BaseSession::httpPutRequest( string url, istream& is, v
|
||||
if ( status == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken )
|
||||
{
|
||||
|
||||
- // Refresh the token
|
||||
- m_oauth2Handler->refresh( );
|
||||
+ try
|
||||
+ {
|
||||
+ // Refresh the token
|
||||
+ m_oauth2Handler->refresh( );
|
||||
+ }
|
||||
+ catch ( const libcmis::Exception& e )
|
||||
+ {
|
||||
+ throw CurlException( e.what() );
|
||||
+ }
|
||||
|
||||
// Resend the query
|
||||
try
|
||||
@@ -457,8 +471,15 @@ libcmis::HttpResponsePtr BaseSession::httpPostRequest( const string& url, istrea
|
||||
// Need to use the refresh token to get a new one.
|
||||
if ( status == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken )
|
||||
{
|
||||
- // Refresh the token
|
||||
- m_oauth2Handler->refresh( );
|
||||
+ try
|
||||
+ {
|
||||
+ // Refresh the token
|
||||
+ m_oauth2Handler->refresh( );
|
||||
+ }
|
||||
+ catch ( const libcmis::Exception& e )
|
||||
+ {
|
||||
+ throw CurlException( e.what() );
|
||||
+ }
|
||||
|
||||
// Resend the query
|
||||
try
|
||||
@@ -501,9 +522,16 @@ void BaseSession::httpDeleteRequest( string url ) throw ( CurlException )
|
||||
// Need to use the refresh token to get a new one.
|
||||
if ( getHttpStatus( ) == 401 && !getRefreshToken( ).empty( ) && !m_refreshedToken )
|
||||
{
|
||||
-
|
||||
- // Refresh the token
|
||||
- m_oauth2Handler->refresh( );
|
||||
+ try
|
||||
+ {
|
||||
+ // Refresh the token
|
||||
+ m_oauth2Handler->refresh( );
|
||||
+ }
|
||||
+ catch ( const libcmis::Exception& e )
|
||||
+ {
|
||||
+ throw CurlException( e.what() );
|
||||
+ }
|
||||
+
|
||||
// Resend the query
|
||||
try
|
||||
{
|
||||
@@ -722,8 +750,14 @@ void BaseSession::setOAuth2Data( libcmis::OAuth2DataPtr oauth2 ) throw ( libcmis
|
||||
|
||||
// Try to get the authentication code using the given provider.
|
||||
|
||||
- authCode = m_oauth2Handler->oauth2Authenticate( );
|
||||
-
|
||||
+ try
|
||||
+ {
|
||||
+ authCode = m_oauth2Handler->oauth2Authenticate( );
|
||||
+ }
|
||||
+ catch ( const CurlException& e )
|
||||
+ {
|
||||
+ throw e.getCmisException( );
|
||||
+ }
|
||||
|
||||
// If that didn't work, call the fallback provider from SessionFactory
|
||||
try
|
||||
--
|
||||
1.9.3
|
||||
|
Loading…
Reference in new issue