diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-04-14 10:44:25 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-05-01 17:38:25 +0200 |
commit | b4c5387e9f10369ed18fcfbe55a6fc8f8a2e08aa (patch) | |
tree | 65b48fc2f37031f689f1c25687fe4ad44754e28a /lib/tsocket/tsocket_bsd.c | |
parent | cc75ff1a37b1e7d9e75e718731fa30e4901850c7 (diff) | |
download | samba-b4c5387e9f10369ed18fcfbe55a6fc8f8a2e08aa.tar.gz samba-b4c5387e9f10369ed18fcfbe55a6fc8f8a2e08aa.tar.bz2 samba-b4c5387e9f10369ed18fcfbe55a6fc8f8a2e08aa.zip |
tsocket: tdgram move input checks to the common code as there're needed for all backends
We need to make sure that we free the sendto and recvfrom requests before
the tdgram_context
metze
Diffstat (limited to 'lib/tsocket/tsocket_bsd.c')
-rw-r--r-- | lib/tsocket/tsocket_bsd.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c index 52cc5cc1cf..34ae60ee09 100644 --- a/lib/tsocket/tsocket_bsd.c +++ b/lib/tsocket/tsocket_bsd.c @@ -557,9 +557,6 @@ struct tdgram_bsd { void (*readable_handler)(void *private_data); void *writeable_private; void (*writeable_handler)(void *private_data); - - struct tevent_req *read_req; - struct tevent_req *write_req; }; static void tdgram_bsd_fde_handler(struct tevent_context *ev, @@ -698,7 +695,6 @@ static int tdgram_bsd_recvfrom_destructor(struct tdgram_bsd_recvfrom_state *stat struct tdgram_bsd *bsds = tdgram_context_data(state->dgram, struct tdgram_bsd); - bsds->read_req = NULL; tdgram_bsd_set_readable_handler(bsds, NULL, NULL, NULL); return 0; @@ -726,12 +722,6 @@ static struct tevent_req *tdgram_bsd_recvfrom_send(TALLOC_CTX *mem_ctx, state->len = 0; state->src = NULL; - if (bsds->read_req) { - tevent_req_error(req, EBUSY); - goto post; - } - bsds->read_req = req; - talloc_set_destructor(state, tdgram_bsd_recvfrom_destructor); if (bsds->fd == -1) { @@ -876,8 +866,8 @@ static int tdgram_bsd_sendto_destructor(struct tdgram_bsd_sendto_state *state) struct tdgram_bsd *bsds = tdgram_context_data(state->dgram, struct tdgram_bsd); - bsds->write_req = NULL; tdgram_bsd_set_writeable_handler(bsds, NULL, NULL, NULL); + return 0; } @@ -907,12 +897,6 @@ static struct tevent_req *tdgram_bsd_sendto_send(TALLOC_CTX *mem_ctx, state->dst = dst; state->ret = -1; - if (bsds->write_req) { - tevent_req_error(req, EBUSY); - goto post; - } - bsds->write_req = req; - talloc_set_destructor(state, tdgram_bsd_sendto_destructor); if (bsds->fd == -1) { @@ -1026,11 +1010,6 @@ static struct tevent_req *tdgram_bsd_disconnect_send(TALLOC_CTX *mem_ctx, return NULL; } - if (bsds->read_req || bsds->write_req) { - tevent_req_error(req, EBUSY); - goto post; - } - if (bsds->fd == -1) { tevent_req_error(req, ENOTCONN); goto post; |