mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Merge branch 'master' into fix-intermittent-crash-due-to-GC-finalisation
This commit is contained in:
commit
70b08abf73
3 changed files with 17 additions and 0 deletions
2
.github/actions/spelling/allow.txt
vendored
2
.github/actions/spelling/allow.txt
vendored
|
|
@ -383,6 +383,8 @@ pkolmann
|
|||
podman
|
||||
pollfd
|
||||
pollfds
|
||||
postfields
|
||||
postfieldsize
|
||||
postun
|
||||
prefork
|
||||
preinit
|
||||
|
|
|
|||
|
|
@ -503,6 +503,20 @@ class CurlEngine {
|
|||
http.onSend = data => uploadFile.rawRead(data).length;
|
||||
http.contentLength = offsetSize;
|
||||
}
|
||||
|
||||
void setZeroContentLength() {
|
||||
// Explicit HTTP semantics
|
||||
http.contentLength = 0;
|
||||
addRequestHeader("Content-Length", to!string(0));
|
||||
|
||||
// Force libcurl POST-with-empty-body semantics
|
||||
// This prevents libcurl from attempting to read from stdin when performing a POST with no payload.
|
||||
http.handle.set(CurlOption.postfields, "");
|
||||
http.handle.set(CurlOption.postfieldsize, 0L);
|
||||
|
||||
// Defensive: ensure we are NOT in upload/read-callback mode
|
||||
http.handle.set(CurlOption.upload, 0);
|
||||
}
|
||||
|
||||
CurlResponse execute() {
|
||||
scope(exit) {
|
||||
|
|
|
|||
|
|
@ -1474,6 +1474,7 @@ class OneDriveApi {
|
|||
bool validateJSONResponse = false;
|
||||
oneDriveErrorHandlerWrapper((CurlResponse response) {
|
||||
connect(HTTP.Method.post, url, false, response, requestHeaders);
|
||||
curlEngine.setZeroContentLength();
|
||||
return curlEngine.execute();
|
||||
}, validateJSONResponse, callingFunction, lineno);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue