Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

HttpPost.Dispose skips Content disposal when data step throws

Aperta
#32 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Start in MaxLib.WebServer/HttpPost.cs:118-161 and read both HttpPost.Dispose() and DisposeAsync(). Trace the LazyData.Value and IPostData disposal failure paths described in the issue, then verify that Content is disposed for every path while only the re-observed parse fault is swallowed. Done means disposal exceptions retain the specified propagation behavior and the ContentStream reader and timeout source are cleaned up.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug severity:low

HttpPost.Dispose()/DisposeAsync() have no try/finally around the data step, so Content is never disposed if that step throws. Two triggers: a lazy parse that faulted (e.g. multipart with Content-Length: 0 or a boundary over 508 chars, read via Data) is rethrown at await LazyData.Value; or the parsed IPostData's own disposal throws (e.g. UnknownPostData hitting the ContentStream read timeout while draining). The ContentStream's reader and timeout CancellationTokenSource are left undisposed, and a re-thrown parse fault is logged a second time as "Unhandled exception".

Location: MaxLib.WebServer/HttpPost.cs:118-161

Fix: Wrap the whole body of both methods in try/finally with the Content disposal in the finally. Swallow only the re-observed parse fault from LazyData.Value; let a genuinely new exception from the data disposal propagate after Content is disposed.

Lingua principale
C#
Stelle
1
Fork
3
Merge medio
1g 9h
PR unite (30g)
4

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Garados007/MaxLib.WebServer

Tutte le issue di Garados007/MaxLib.WebServer

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.