Commit aefbd2f
committed
🥅 Guard against tagged responses sent too soon
The premature tagged response guard that was added for #644 only checked
for premature `OK`, not for premature `BAD` or `NO`. When those are
detected prior to the tag being sent, this treats those cases as the
same sort of error.
Note that this explicitly raises a "closed stream" IOError when
disconnected. This is the error that would be raised anyway, if
`send_command` were allowed to write to the connection. But, if we can
test that the socket is already closed, we can raise the error directly.
There's no need to attempt to format and send data.1 parent f5b0ea0 commit aefbd2f
2 files changed
Lines changed: 30 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3201 | 3201 | | |
3202 | 3202 | | |
3203 | 3203 | | |
3204 | | - | |
3205 | | - | |
| 3204 | + | |
| 3205 | + | |
3206 | 3206 | | |
3207 | 3207 | | |
3208 | 3208 | | |
| |||
3665 | 3665 | | |
3666 | 3666 | | |
3667 | 3667 | | |
3668 | | - | |
3669 | | - | |
| 3668 | + | |
| 3669 | + | |
3670 | 3670 | | |
3671 | 3671 | | |
3672 | 3672 | | |
| |||
3687 | 3687 | | |
3688 | 3688 | | |
3689 | 3689 | | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
3690 | 3700 | | |
3691 | 3701 | | |
3692 | 3702 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | | - | |
216 | | - | |
217 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
218 | 221 | | |
219 | | - | |
| 222 | + | |
220 | 223 | | |
221 | 224 | | |
222 | 225 | | |
| |||
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
233 | | - | |
234 | | - | |
235 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
236 | 239 | | |
237 | 240 | | |
238 | 241 | | |
| |||
250 | 253 | | |
251 | 254 | | |
252 | 255 | | |
253 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
254 | 261 | | |
255 | 262 | | |
256 | 263 | | |
| |||
0 commit comments