Skip to content

Commit ff8af19

Browse files
committed
Avoid read_cb after calling hio_close during hio_unpack
1 parent f561857 commit ff8af19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

event/hevent.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ void hio_read_cb(hio_t* io, void* buf, int len) {
400400
hio_read_stop(io);
401401
}
402402

403-
if (io->read_cb) {
403+
if (io->read_cb && !io->closed) {
404404
// printd("read_cb------\n");
405405
io->read_cb(io, buf, len);
406406
// printd("read_cb======\n");
@@ -418,7 +418,7 @@ void hio_read_cb(hio_t* io, void* buf, int len) {
418418
}
419419

420420
void hio_write_cb(hio_t* io, const void* buf, int len) {
421-
if (io->write_cb) {
421+
if (io->write_cb && !io->closed) {
422422
// printd("write_cb------\n");
423423
io->write_cb(io, buf, len);
424424
// printd("write_cb======\n");

0 commit comments

Comments
 (0)