Pass the wqueue directly to the wqueue callback functions
This commit is contained in:
+2
-2
@@ -15,7 +15,7 @@ static int uc_wqueue_handle_write(struct UCWQueue *wqueue)
|
||||
q = UC_TAILQ_FIRST(&wqueue->queue);
|
||||
|
||||
mbuf = UC_TAILQ_CONTAINER(q, struct MBuf, entry);
|
||||
rc = wqueue->write_cb(mux, fd, mbuf);
|
||||
rc = wqueue->write_cb(mux, wqueue, mbuf);
|
||||
if (rc <= 0) {
|
||||
//NOTE for rc < 0, nothing can touch the wqueue or fd
|
||||
//any more, as it might been free'd
|
||||
@@ -58,7 +58,7 @@ static void uc_wqueue_cb(struct IOMux *mux, struct IOMuxFD *fd, unsigned int wha
|
||||
|
||||
|
||||
if (rc >= 0 && what & MUX_EV_READ) {
|
||||
rc = wqueue->read_cb(mux, fd);
|
||||
rc = wqueue->read_cb(mux, wqueue);
|
||||
//NOTE - can't touch the wqueue or fd after this point,
|
||||
//as it might been free'd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user