Close post-upload and admission race gaps
Treat fallback result fetch and body failures as uncertain Doodstream commits, and coordinate interval timing with slot acquisition so upload starts remain spaced without occupying another host's global slot during the wait.
This commit is contained in:
@@ -640,15 +640,26 @@ class DoodstreamUploader {
|
||||
if (formAction) {
|
||||
_debugLog(`Fallback: following form action ${safeEndpoint(formAction[1]) || 'unknown endpoint'}`);
|
||||
const formData = new URLSearchParams(hiddenFields);
|
||||
const followRes = await this._fetch(formAction[1], {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Referer': BASE_URL + '/'
|
||||
},
|
||||
body: formData.toString()
|
||||
});
|
||||
const followText = await followRes.text();
|
||||
let followText;
|
||||
try {
|
||||
const followRes = await this._fetch(formAction[1], {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Referer': BASE_URL + '/'
|
||||
},
|
||||
body: formData.toString()
|
||||
});
|
||||
followText = await followRes.text();
|
||||
} catch {
|
||||
throw createTransportError('Doodstream Upload: Redirect-Antwort konnte nicht gelesen werden', {
|
||||
phase: 'upload-result-submit',
|
||||
endpoint: formAction[1],
|
||||
retryable: true,
|
||||
transientNetwork: true,
|
||||
remoteCommitUncertain: true
|
||||
});
|
||||
}
|
||||
_debugLog(`Fallback response: ${summarizeResponse(followText, '')}`);
|
||||
|
||||
const fallbackCode = this._findFilecodeInHtml(followText);
|
||||
|
||||
Reference in New Issue
Block a user