From 9322161952ed25a96578f163cc383be605e7f75c Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 25 Nov 2011 12:21:08 +0100 Subject: Use free_sendfile explicitly for non-async This is needed because aync job will not call free_sendfile if there is an async_ready callback. --- erts/emulator/drivers/common/efile_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c index b807f110eb..1f13a65350 100644 --- a/erts/emulator/drivers/common/efile_drv.c +++ b/erts/emulator/drivers/common/efile_drv.c @@ -2229,6 +2229,7 @@ file_async_ready(ErlDrvData e, ErlDrvThreadData data) } else { driver_select(desc->port, (ErlDrvEvent)(long)d->c.sendfile.out_fd, ERL_DRV_USE, 0); + free_sendfile(data); } } else if (d->result_ok == 0) { desc->sendfile_state = not_sending; @@ -2238,6 +2239,7 @@ file_async_ready(ErlDrvData e, ErlDrvThreadData data) free_sendfile(data); } else { driver_select(desc->port, (ErlDrvEvent)(long)d->c.sendfile.out_fd, ERL_DRV_USE, 0); + free_sendfile(data); } } else if (d->result_ok == 1) { // If we are using select to send the rest of the data desc->sendfile_state = sending; @@ -3441,7 +3443,6 @@ file_outputv(ErlDrvData e, ErlIOVec *ev) { if (sys_info.async_threads != 0) { SET_BLOCKING(d->c.sendfile.out_fd); - d->free = free_sendfile; } cq_enq(desc, d); -- cgit v1.2.3