Skip to content

Private/caolan/improvements#75

Merged
caolanm merged 16 commits into
masterfrom
private/caolan/improvements
May 20, 2026
Merged

Private/caolan/improvements#75
caolanm merged 16 commits into
masterfrom
private/caolan/improvements

Conversation

@caolanm
Copy link
Copy Markdown
Contributor

@caolanm caolanm commented May 18, 2026

No description provided.

caolanm added 16 commits May 18, 2026 10:32
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 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.
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.
@caolanm caolanm merged commit ed6f1ec into master May 20, 2026
3 checks passed
@caolanm caolanm deleted the private/caolan/improvements branch May 20, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant