Private/caolan/improvements#75
Merged
Merged
Conversation
HttpSession held m_oauth2Handler as a raw OAuth2Handler* and the copy constructor and operator= both did a shallow copy of the pointer. Two HttpSession instances ended up sharing one handler, which the destructor then deleted. Switch m_oauth2Handler to std::unique_ptr<OAuth2Handler> and copy through a new constructo that points to the new owning session. Drop the old (unused) plain copy constructor and assigment.
Add a test for this.
Add parseResponseNoNamespaceTest to exercise this
https://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/rest/files/checkfileinfo/checkfileinfo-response See: CheckFileInfo Response properties BaseFileName: The string name of the file, including extension, without a path. Used for display in user interface (UI), and determining the extension of the file.
Replace the bare new char[]/delete[] with a std::vector<char> so the buffer is freed on every exit path.
Add the missing xmlFreeDoc call before each early return.
Both functions can return NULL
Set three libcurl options at the top of each httpRunRequest, via a shared libcmis::applyTransferLimits: - CURLOPT_MAXFILESIZE_LARGE = 1 GiB. Well above any realistic editable document; the largest legitimate LibreOffice case we know of is a few hundreds of MiB. - CURLOPT_LOW_SPEED_LIMIT = 1 byte/s - CURLOPT_LOW_SPEED_TIME = 30s. Matches Collabora Online's net.connection_timeout_secs default which is the same no-progress-for-30s of Poco.
The xmlBuffer holds an explicit length via xmlBufferLength so use it.
…token
OAuth2Handler::fetchTokens and ::refresh end with
m_access = jresp[ "access_token" ].toString( );
Per RFC 6749 section 5.2, every token-endpoint failure response is a
JSON object with an "error" field and an optional "error_description".
After assigning m_access, check whether it is empty and, if so, throw
libcmis::Exception with those two fields included in the message.
Behaviour change is limited to error reporting: every caller that
previously got an empty m_access already failed on the next request,
just with a less useful exception.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.