From 9d8766e176439cec3653b87ae93cbe917123c4ef Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 29 May 2009 14:14:50 +0200 Subject: async_sock: Change license to LGPLv3+ --- lib/async_req/async_sock.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'lib/async_req/async_sock.c') diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c index fe71b29117..598a126467 100644 --- a/lib/async_req/async_sock.c +++ b/lib/async_req/async_sock.c @@ -3,17 +3,21 @@ async socket syscalls Copyright (C) Volker Lendecke 2008 - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + ** NOTE! The following LGPL license applies to the async_sock + ** library. This does NOT imply that all of Samba is released + ** under the LGPL - This program is distributed in the hope that it will be useful, + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -- cgit From 57ea909b327812479e9c61f0398f257023a504b4 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Thu, 16 Apr 2009 14:53:36 +0200 Subject: libwbclient: Add async call framework. --- lib/async_req/async_sock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/async_req/async_sock.c') diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c index 598a126467..09eec10fc5 100644 --- a/lib/async_req/async_sock.c +++ b/lib/async_req/async_sock.c @@ -426,7 +426,7 @@ static void writev_handler(struct tevent_context *ev, struct tevent_fd *fde, to_write += state->iov[i].iov_len; } - written = sys_writev(state->fd, state->iov, state->count); + written = writev(state->fd, state->iov, state->count); if (written == -1) { tevent_req_error(req, errno); return; @@ -570,7 +570,7 @@ static void read_packet_handler(struct tevent_context *ev, return; } - tmp = TALLOC_REALLOC_ARRAY(state, state->buf, uint8_t, total+more); + tmp = talloc_realloc(state, state->buf, uint8_t, total+more); if (tevent_req_nomem(tmp, req)) { return; } -- cgit From 625851a50f74024f5918e0b348147457c2cc42ea Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 30 May 2009 09:49:17 +0200 Subject: Handle EINTR in async_sock.c --- lib/async_req/async_sock.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/async_req/async_sock.c') diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c index 09eec10fc5..d88edb177a 100644 --- a/lib/async_req/async_sock.c +++ b/lib/async_req/async_sock.c @@ -81,6 +81,10 @@ static void async_send_handler(struct tevent_context *ev, tevent_req_data(req, struct async_send_state); state->sent = send(state->fd, state->buf, state->len, state->flags); + if ((state->sent == -1) && (errno == EINTR)) { + /* retry */ + return; + } if (state->sent == -1) { tevent_req_error(req, errno); return; @@ -148,6 +152,10 @@ static void async_recv_handler(struct tevent_context *ev, state->received = recv(state->fd, state->buf, state->len, state->flags); + if ((state->received == -1) && (errno == EINTR)) { + /* retry */ + return; + } if (state->received == -1) { tevent_req_error(req, errno); return; @@ -427,6 +435,10 @@ static void writev_handler(struct tevent_context *ev, struct tevent_fd *fde, } written = writev(state->fd, state->iov, state->count); + if ((written == -1) && (errno = EINTR)) { + /* retry */ + return; + } if (written == -1) { tevent_req_error(req, errno); return; @@ -534,6 +546,10 @@ static void read_packet_handler(struct tevent_context *ev, nread = recv(state->fd, state->buf+state->nread, total-state->nread, 0); + if ((nread == -1) && (errno == EINTR)) { + /* retry */ + return; + } if (nread == -1) { tevent_req_error(req, errno); return; -- cgit