Stefan Metzmacher
857ed9ca5a
tsocket/bsd: also ask for TEVENT_FD_READ when we want to write into a stream socket
...
Otherwise we would not notice a broken connection.
metze
2009-06-29 16:03:57 +02:00
Stefan Metzmacher
b1d5e515b2
tsocket/bsd: more correctly check if the cached tevent_fd is still valid
...
I some cases the pointer value of tevent_context is the same again,
if we do something like:
ev1 = tevent_context_init();
...
fde = tevent_add_fd(ev1, fd, TEVENT_FD_READ...);
...
talloc_free(ev1);
...
ev2 = tevent_context_init();
if (ev1 == ev2) {
/* this can happen! */
}
if (tevent_fd_get_flags(fde) == 0) {
/* this is always true */
}
But the "talloc_free(ev1)" will set fde->event_ctx to NULL
and tevent_fd_get_flags() will always return 0.
metze
2009-06-29 16:03:57 +02:00
Volker Lendecke
c687eb15d9
Properly free a downlevel readv request. Metze, please check
2009-06-27 23:17:49 +02:00
Andrew Tridgell
c0965e0eec
It seems that IRIX doesn't have IOV_MAX
2009-06-09 14:54:15 +10:00
Stefan Metzmacher
edd9bd9b16
tsocket: allow empty vectors at the end for tstream_writev()/readv()
...
metze
2009-05-22 14:01:22 +02:00
Volker Lendecke
ac65ae9b1d
Set errno=ENOMEM if tevent_add_fd fails
...
tevent_add_fd does not properly set that. At least in epoll and select this is
the only error condition.
Metze, please check!
2009-05-19 23:51:22 +02:00
Volker Lendecke
f9d00fb58e
Simplify the logic of tsocket_bsd_pending
...
Remove two indentation levels by returning early on error.
Metze, please check!
2009-05-19 23:35:16 +02:00
Volker Lendecke
6ca4d727c4
Attempt to the build on NetBSD5 and a few others
2009-05-01 23:26:22 +02:00
Stefan Metzmacher
6ac61e6707
tsocket: add tstream_readv_pdu_queue_send/recv()
...
metze
2009-05-01 17:42:01 +02:00
Stefan Metzmacher
eb723c2061
tsocket: add tstream_writev_queue_send/recv()
...
metze
2009-05-01 17:42:00 +02:00
Stefan Metzmacher
a0830f4cb9
tsocket: add tstream_readv_pdu_send/recv()
...
metze
2009-05-01 17:41:56 +02:00
Stefan Metzmacher
ee6d796c19
tsocket: add tstream implementation for bsd sockets (inet and unix)
...
metze
2009-05-01 17:41:55 +02:00
Stefan Metzmacher
8a090c4b8b
tsocket: add tstream_context infrastructure similar to tdgram_context
...
metze
2009-05-01 17:41:53 +02:00
Stefan Metzmacher
182a4b30de
tsocket: rename tdgram_unix_dgram_socket() => tdgram_unix_socket()
...
metze
2009-05-01 17:41:38 +02:00
Stefan Metzmacher
b46599590f
tsocket: move tsocket_simple_int_recv() to tsocket.c
...
metze
2009-05-01 17:38:27 +02:00
Stefan Metzmacher
0db3b944bd
tsocket: move tsocket_sendto_queue_send/recv() to tsocket_helpers.c
...
metze
2009-05-01 17:38:26 +02:00
Stefan Metzmacher
b4c5387e9f
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
2009-05-01 17:38:25 +02:00
Stefan Metzmacher
cc75ff1a37
tsocket: for unix domain sockets we need to use sizeof(struct sockaddr_un)
...
sizeof(struct sockaddr_storage) generates EINVAL.
metze
2009-05-01 17:38:24 +02:00
Stefan Metzmacher
66a2cd36c6
tsocket: return EINVAL when tdgram_sendto_send() is used with len == 0
...
metze
2009-05-01 17:38:23 +02:00
Stefan Metzmacher
997eb9eb43
tsocket: fix dependecies
...
metze
2009-05-01 17:38:22 +02:00
Stefan Metzmacher
9dbb535aa5
tsocket: remove tsocket_context related stuff
...
It will be replaced by tdgram_context and tstream_context.
metze
2009-05-01 17:38:21 +02:00
Stefan Metzmacher
56aae35a23
tsocket: fix the build without ipv6 support
...
metze
2009-04-16 09:31:14 +02:00
Stefan Metzmacher
522bdea1f3
tsocket: reduce size of dummy variable
...
metze
2009-04-06 16:37:18 +02:00
Stefan Metzmacher
9d9f945281
tsocket: use the correct 'ret' variable for tdgram_disconnect_send/recv()
...
metze
2009-04-06 15:49:08 +02:00
Stefan Metzmacher
3bbad34a02
tsocket: remove DGRAM support from tsocket_context
...
metze
2009-04-02 21:54:08 +02:00
Stefan Metzmacher
c59ee5a139
tsocket: optimize tdgram_bsd a lot
...
The desire is to do as less syscalls during the
tdgram_sendto_send/recv() and tdgram_recvfrom_send/recv()
operations.
1. we first try the sendto()/recvfrom() syscall and
only use a fd event if we got EAGAIN.
2. we cache the fd event and only change it's flags
if really needed.
For the highload case we do almost no epoll_ctl() and epoll_wait()/select()
syscalls anymore. This speeds up the LDAP-BENCH-CLDAP test
by more than 20%. (With a modified version of this test
which let the server skip any ldb calls and just return success
I'm getting about 8000 requests per second, while I'm getting
just about 6000 requests per second without optimization)
metze
2009-04-02 21:54:00 +02:00
Stefan Metzmacher
85742dbc06
tsocket: add tdgram_sendto_queue_send/recv()
...
metze
2009-04-02 21:53:59 +02:00
Stefan Metzmacher
8d98070a9f
tsocket: split out a smaller tdgram_context abstraction
...
The idea is to have a tdgram and a tstream abstraction
which only provide tevent_req based io functions.
metze
2009-04-02 21:53:03 +02:00
Stefan Metzmacher
c200e8632f
tsocket: try to fix the build on solaris FIONREAD was missing
...
metze
2009-03-31 20:33:33 +02:00
Stefan Metzmacher
23bb1eedf6
tsocket: more s/sun/un to make the build on solaris happy
...
metze
2009-03-28 23:50:56 +01:00
Stefan Metzmacher
cacfae159f
tsocket: try to fix the build on solaris systems
...
It seems that 'sun' is somewhere defined and we can
use it as name for variables or struct/union members.
metze
2009-03-27 11:40:36 +01:00
Stefan Metzmacher
4e18c24e2e
lib/tsocket: add tsocket_guide.txt section with specific details about bsd style sockets
...
metze
2009-03-19 16:25:58 +01:00
Stefan Metzmacher
f6efec5dd4
lib/tsocket: add a fast path to tsocket_writev_send/recv()
...
This is similar to the tsocket_sendto_send/recv() fast path.
metze
2009-03-19 16:25:57 +01:00
Stefan Metzmacher
b900e92425
lib/tsocket: add a fast path to tsocket_sendto_send/recv()
...
By first trying to send data without waiting for the socket
to become writeable we gain about 10-20% performance in the
LDAP-BENCH-CLDAP test.
metze
2009-03-19 16:25:57 +01:00
Stefan Metzmacher
235a7a420b
lib/tsocket: add tsocket_guide.txt section about the async _send/recv() helper functions
...
metze
2009-03-19 16:25:56 +01:00
Stefan Metzmacher
a27c6eb8e2
lib/tsocket: add tsocket_readv_send/recv()
...
metze
2009-03-19 16:25:56 +01:00
Stefan Metzmacher
6c8bd1005d
lib/tsocket: add tsocket_writev_queue_send/recv()
...
metze
2009-03-19 16:25:55 +01:00
Stefan Metzmacher
2e44ceaea8
lib/tsocket: add tsocket_writev_send/recv()
...
metze
2009-03-19 16:25:55 +01:00
Stefan Metzmacher
a140823cc9
lib/tsocket: add tsocket_connect_send/recv()
...
metze
2009-03-19 16:25:54 +01:00
Stefan Metzmacher
4002b7bdc1
lib/tsocket: add tsocket_sendto_queue_send/recv()
...
metze
2009-03-19 16:25:54 +01:00
Stefan Metzmacher
9ed7a45c88
lib/tsocket: add tsocket_sendto_send/recv()
...
metze
2009-03-19 16:25:54 +01:00
Stefan Metzmacher
ccfd6a6e39
lib/tsocket: add tsocket_recvfrom_send/recv()
...
metze
2009-03-19 16:25:53 +01:00
Stefan Metzmacher
6c88d61bdd
lib/tsocket: add an implementation for bsd style sockets.
...
metze
2009-03-19 16:25:53 +01:00
Stefan Metzmacher
c00126e609
lib/tsocket: add a tsocket_guide.txt with a description of the design
...
metze
2009-03-19 16:25:52 +01:00
Stefan Metzmacher
d848d517b5
lib/tsocket: add some useful helper functions
...
metze
2009-03-19 16:20:22 +01:00
Stefan Metzmacher
2e0e416676
lib/tsocket: add generic socket abstraction layer
...
This will replace source4/lib/socket/.
metze
2009-03-19 15:01:12 +01:00