Commit c952b31
committed
Handle dead connections in HTTP response methods
When a client disconnects mid-response, binding.pyx raises ReferenceError
from connection.send() because the underlying C connection (thisptr) is
NULL. This became more visible after _log_request() was added, since the
SQLite write introduces enough delay for clients to disconnect before the
response is sent.
Catch ReferenceError in send_response, send_header, and end_headers so
the response path silently stops instead of crashing.1 parent 15b042b commit c952b31
File tree
2 files changed
+90
-3
lines changed- modules/python/dionaea
- tests/http/tests
2 files changed
+90
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1088 | 1088 | | |
1089 | 1089 | | |
1090 | 1090 | | |
1091 | | - | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1092 | 1095 | | |
1093 | 1096 | | |
1094 | 1097 | | |
| |||
1140 | 1143 | | |
1141 | 1144 | | |
1142 | 1145 | | |
1143 | | - | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1144 | 1150 | | |
1145 | 1151 | | |
1146 | | - | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1147 | 1156 | | |
1148 | 1157 | | |
1149 | 1158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
0 commit comments