Only send cancel async if there is an async id

This commit is contained in:
Kovid Goyal 2022-08-31 21:52:35 +05:30
parent 65c3630099
commit 7f77f7e408
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -202,7 +202,7 @@ func (self *rc_io_data) next_chunk() (chunk []byte, one_escape_code_done bool, e
func get_response(do_io func(io_data *rc_io_data) ([]byte, error), io_data *rc_io_data) (ans *Response, err error) {
serialized_response, err := do_io(io_data)
if err != nil {
if errors.Is(err, os.ErrDeadlineExceeded) {
if errors.Is(err, os.ErrDeadlineExceeded) && io_data.rc.Async != "" {
io_data.rc.Payload = nil
io_data.rc.CancelAsync = true
io_data.multiple_payload_generator = nil