Skip to content

Commit

Permalink
Fix handling async in sync mode upon failure
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-iancu committed Jul 28, 2016
1 parent 7428b69 commit cf2fd9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions async.c
Expand Up @@ -117,6 +117,7 @@ int async_fd_resume(int *fd, void *param)
if (async_status == ASYNC_CHANGE_FD)
*fd=ret;
} while(async_status==ASYNC_CONTINUE||async_status==ASYNC_CHANGE_FD);
goto done;
} else {

/* succesfully changed fd */
Expand All @@ -127,6 +128,7 @@ int async_fd_resume(int *fd, void *param)
/* remove from reactor, we are done */
reactor_del_reader( *fd, -1, IO_FD_CLOSING);

done:
if (async_status == ASYNC_DONE_CLOSE_FD)
close(*fd);

Expand Down
2 changes: 1 addition & 1 deletion modules/tm/async.c
Expand Up @@ -159,10 +159,10 @@ int t_resume_async(int *fd, void *param)
/* remove from reactor, we are done */
reactor_del_reader( *fd, -1, IO_FD_CLOSING);

route:
if (async_status == ASYNC_DONE_CLOSE_FD)
close(*fd);

route:
/* run the resume_route (some type as the original one) */
swap_route_type(route, ctx->route_type);
run_resume_route( ctx->resume_route, &faked_req);
Expand Down

0 comments on commit cf2fd9e

Please sign in to comment.