diff options
author | monojenkins <jo.shields+jenkins@xamarin.com> | 2020-04-28 21:22:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-28 21:22:51 +0300 |
commit | 075c3f06197e3b969f4234d0f56a2e10ee6ee305 (patch) | |
tree | 33f7bcc549fe580496b00a44e0a8570574e8ae70 /external | |
parent | 35cc82cc6cc5430b3e33695ec4a43948b63b3471 (diff) |
Fix if already send error to http client, do not callback. (#19668)
Fixed #10435
HttpListener already closes the Response object, closes the HTTP Client connection, and then sets the value of Response.StatusCode again. If so, an ObjectDisposedException is thrown.
```
Unhandled Exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.HttpListenerResponse'.
at System.Net.HttpListenerResponse.set_ContentLength64 (System.Int64 value) [0x00013] in <b4473693dd3c4d45883c574a53529fbe>:0
at MonoConsoleApp1.Program.Main (System.String[] args) [0x000f8] in <a66f6d7d417445dc9f89c691941ca70b>:0
at MonoConsoleApp1.Program.<Main> (System.String[] args) [0x0000c] in <a66f6d7d417445dc9f89c691941ca70b>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.HttpListenerResponse'.
at System.Net.HttpListenerResponse.set_ContentLength64 (System.Int64 value) [0x00013] in <b4473693dd3c4d45883c574a53529fbe>:0
at MonoConsoleApp1.Program.Main (System.String[] args) [0x000f8] in <a66f6d7d417445dc9f89c691941ca70b>:0
at MonoConsoleApp1.Program.<Main> (System.String[] args) [0x0000c] in <a66f6d7d417445dc9f89c691941ca70b>:0
```
If an error is sent to the HTTP client while processing a request, it is patched so that the next process is not executed anymore.
Backport of #19664.
Diffstat (limited to 'external')
0 files changed, 0 insertions, 0 deletions