1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

54 Commits

Author SHA1 Message Date
Andrew Bartlett
d40fe50a67 build: avoid util.h as a public header name due to conflict with MacOS 2011-09-23 09:24:03 +02:00
Volker Lendecke
50e30afa60 s3: Fix bug 8385
Poll and select behave differently regarding error handling. When doing the
connect(2), we can not rely on poll telling us both readability and writability
upon error. Just always try a second connect(2). At least on Linux it returns 0
when it succeeded.

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Aug 25 19:39:12 CEST 2011 on sn-devel-104
2011-08-25 19:39:12 +02:00
Andrew Bartlett
af5f494bd2 build: provide tevent-util as a public library
This is needed so that OpenChange can get at _tevent_req_nterr(), which is referenced
by generated PIDL output.

Andrew Bartlett
2011-08-08 13:34:06 +02:00
Volker Lendecke
4281967990 Add wait_for_read_send/recv
Wait for readability of a socket as a tevent_req
2011-07-28 17:42:22 +02:00
Jeremy Allison
0efcc94fb8 Fix bug #8197 - winbind does not properly detect when a DC connection is dead.
Only waiting for writability doesn't get fd errors back with poll.
So always begin by selecting for readability, and if we get it then
see if bytes were available to read or it really is an error condition.

If bytes were available, remove the select on read as we know we
will retrieve the error when we've finished writing and start
reading the reply (or the write will timeout or fail).

Metze and Volker please check.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Jun  6 21:53:16 CEST 2011 on sn-devel-104
2011-06-06 21:53:16 +02:00
Matthias Dieter Wallnöfer
7d2d902d51 async_rec/async_sock.c - add an additional "const"
In order to suppress a build warning.

Acked-by: Volker and Metze

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Wed Mar 23 10:26:23 CET 2011 on sn-devel-104
2011-03-23 10:26:23 +01:00
Günther Deschner
89db591b2a s3-waf: add UTIL_TEVENT subsystem (as in ../lib/util/wscript)
Guenther
2011-02-14 13:38:53 +01:00
Volker Lendecke
65f4f22cb4 Use sockaddr_storage in async sendto/recvfrom 2010-12-29 22:44:06 +01:00
Volker Lendecke
c4b18bd860 async_send->sendto, async_recv->recvfrom 2010-12-28 12:59:11 +01:00
Jelmer Vernooij
3deece5591 s4: Remove the old perl/m4/make/mk-based build system.
The new waf-based build system now has all the same functionality, and
the old build system has been broken for quite some time.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Oct 31 02:01:44 UTC 2010 on sn-devel-104
2010-10-31 02:01:44 +00:00
Stefan Metzmacher
33bb334e80 s4-waf: inline LIBREPLACE_NETWORK into 'replace'
metze
2010-04-12 09:13:43 +02:00
Andrew Tridgell
b690fedef5 s4-waf: removed the AUTOGENERATED markers
we won't be using the mk -> wscript generator again
2010-04-06 20:27:16 +10:00
Andrew Tridgell
f9eae32f4b s4-waf: mark the wscript files as python so vim/emacs knows how to highlight them 2010-04-06 20:27:11 +10:00
Andrew Tridgell
845e0cbe6f build: commit all the waf build files in the tree 2010-04-06 20:26:48 +10:00
Stefan Metzmacher
f0d6e61977 async_sock: return -1/EPIPE if we're getting an end of file on read.
This makes the error handling in the callers easier.

metze
2009-09-21 06:04:53 +02:00
Volker Lendecke
b706265786 Fix a = vs == error in writev_handler 2009-06-15 07:48:48 +02:00
Stefan Metzmacher
faabc97c9a async_sock: try fix the source4 build on FreeBSD, Solaris, SLES8
metze
2009-06-08 09:40:06 +02:00
Volker Lendecke
a731eb64d9 Fix an uninitialized variable read in async_connect_send 2009-06-06 10:42:55 +02:00
Volker Lendecke
74330085ec Only err on readability if writev_send was explicitly asked to do so
A socket might be readable for other reasons
2009-06-04 12:05:00 +02:00
Volker Lendecke
625851a50f Handle EINTR in async_sock.c 2009-05-30 09:51:02 +02:00
Kai Blin
57ea909b32 libwbclient: Add async call framework. 2009-05-30 09:17:37 +02:00
Volker Lendecke
9d8766e176 async_sock: Change license to LGPLv3+ 2009-05-29 18:17:38 +02:00
Volker Lendecke
9de2efaa5b Change async_connect to use connect instead of getsockopt to get the error
On my Linux box, this is definitely the more reliable strategy with unix domain
sockets, and according to my tests it also works correctly with TCP sockets.
2009-05-24 13:50:54 +02:00
Volker Lendecke
a8e02b591b Add "err_on_readability" to writev_send
A socket where the other side has closed only becomes readable. To catch
errors early when sitting in a pure writev, we need to also test for
readability.
2009-05-24 13:47:29 +02:00
Volker Lendecke
1a69ba8945 Allow NULL queue to writev_send 2009-05-24 13:45:35 +02:00
Volker Lendecke
ccd293ba0e Remove async_req 2009-04-08 23:11:59 +02:00
Volker Lendecke
d3825d5d10 Use recv instead of read in read_packet_handler
This way the socket wrapper pcap file also sees the replies :-)
2009-04-05 13:45:15 +02:00
Volker Lendecke
b693f7f067 Remove some transitional code in writev_send 2009-03-17 17:31:22 +01:00
Volker Lendecke
54b9ad4f1f Remove some unused code from async_req.[ch] 2009-03-16 20:45:55 +01:00
Stefan Metzmacher
b96aa69dff async_sock: fix truncating of the temporary iovec in writev_send/recv()
Volker: please check!

metze
2009-03-11 17:33:30 +01:00
Volker Lendecke
fe486d7b9f Add "queue" to writev_send
Unless higher levels queue themselves somehow, writev will *always* be queued.
So the queueing should be done at the right level.
2009-03-08 11:20:59 +01:00
Simo Sorce
67d41d0fc7 Make struct tevent_req opaque
Move struct tevent_req in tevent_internal, and ad getters and setters
for private data and the callback function.
This patch also renames 'private_state' into 'data'. What is held in this
pointer is in fact data and not a state like enum tevent_req_state.
Calling it 'state' is confusing.

The functions addedd are:
tevent_req_set_callback() - sets req->async.fn and req->async.private_data
tevent_req_set_print_fn() - sets req->private_print
tevent_req_callback_data() - gets req->async.private_data
tevent_req_data() - gets rea->data

This way it is much simpler to keep API/ABI compatibility in the future.
2009-03-02 11:02:09 -05:00
Volker Lendecke
ddd3da8ab7 Simplify async_connect_send slightly 2009-02-28 12:32:22 +01:00
Volker Lendecke
423c1d88fc Remove async_req based async_send 2009-02-25 13:04:19 +01:00
Volker Lendecke
00ad0c4a43 Remove async_req based async_recv 2009-02-25 13:04:18 +01:00
Volker Lendecke
25df6d7413 Add more conventional async_recv 2009-02-24 20:40:48 +01:00
Volker Lendecke
a60480b71a Add more conventional async_send 2009-02-24 20:40:48 +01:00
Volker Lendecke
08f028f179 Remove unused param_connect struct 2009-02-24 20:40:48 +01:00
Volker Lendecke
bbbdfa2056 Remove unused recvall 2009-02-24 20:40:48 +01:00
Volker Lendecke
4021029cdd Add async read_packet 2009-02-24 20:40:47 +01:00
Volker Lendecke
f9df355bef Fix async writev 2009-02-24 20:40:47 +01:00
Volker Lendecke
e50075a580 Remove async sendall 2009-02-24 20:40:47 +01:00
Volker Lendecke
76c6330dfb Add async writev 2009-02-24 20:40:47 +01:00
Volker Lendecke
39976035eb Convert async_connect to tevent_req 2009-02-24 20:40:47 +01:00
Kai Blin
612c5e746b async_sock: Use tevent_timeval instead of timeval functions 2009-02-17 09:19:31 +01:00
Tim Prouty
1696298aad s3 async: Fix the build on systems that have ETIMEDOUT but not ETIME
Fallback on EAGAIN
2009-02-09 13:23:44 -08:00
Kai Blin
b8cafc5ad2 async_sock: Map ASYNC_REQ_TIMEOUT to ETIMEDOUT instead of ETIME
Also, fall back to EIO if ETIMEDOUT is not present
2009-02-09 12:13:58 +01:00
Kai Blin
c3b9b6c8aa async_sock: Use unix errnos instead of NTSTATUS
This also switches wb_reqtrans to use wbcErr instead of NTSTATUS as it would
be pointless to convert to errno first and to wbcErr later.
2009-02-09 08:36:08 +01:00
Volker Lendecke
d3f9b0fab6 Next step disentangling async_req from NTSTATUS
Now I need to document this :-)
2009-02-02 20:15:03 +01:00
Volker Lendecke
c14b7e648b Split up async_req into a generic and a NTSTATUS specific part 2009-02-01 19:05:39 +01:00