leitner
c29096b2e0
some more eagain handling in tryread and trywrite
...
cosmetic change
8 years ago
leitner
d862c9e482
"fmt.h" instead of <fmt.h>
8 years ago
leitner
b4c4eb607e
remove OpenBSD #warning (obsd maintainer says no longer needed)
8 years ago
leitner
2a0bcc2fb6
implement deferred closing
8 years ago
leitner
b73a699dab
reengineer alt queue handling to prevent race
8 years ago
leitner
f9570b38a1
attempt to work around race condition when you close an fd but there are
...
still outstanding events queued on it.
8 years ago
leitner
8913f6174c
document race condition caused by queueing of multiple events
8 years ago
leitner
137b80ea74
test for pread and use it instead of lseek+read in cdb and io_mmapwritefile
9 years ago
leitner
a1f1986247
include <foo> -> include "foo"
9 years ago
leitner
7bdc1b29bb
a few missing headers and minor fixes
...
fix corking behavior for the case where a buffer follows a buffer in
iob_send
9 years ago
leitner
fce165fdcb
remove dead store
10 years ago
leitner
c60c2425ce
hopefully fix the infinite loop in gatling
10 years ago
leitner
193dfba16b
remove compiler warning
10 years ago
leitner
4fa4a524d2
add io_fd_flags so the caller can tell io_fd whether the socket is blocking
...
(saves one fcntl syscall)
10 years ago
leitner
953eb639b2
on Linux, save a few syscalls by using sendto/sendmsg with MSG_MORE
...
instead of write/writev + setsockopt TCP_CORK
10 years ago
leitner
4404ab35f3
revert to level triggering for epoll (forgot io_wantread)
10 years ago
leitner
967e3ce019
revert edge triggering epoll; it had reliability and fairness issues and
...
was also not actually faster
10 years ago
leitner
39e7ee90bb
introduce io_eagain_read and io_eagain_write (discontinue using io_eagain plz)
11 years ago
leitner
d9cbb3940c
it turns out you don't need -1/EGAIN to know edge triggering told you
...
there is no more data, it's enough to read/write less than you asked for
11 years ago
leitner
5baf943f0a
finish epoll move to edge triggering
11 years ago
leitner
a544abc39c
switch io_fds from array to newly implemented (hopefully thread-safe) iarray
...
switch epoll from level triggering to edge triggering
11 years ago
leitner
ff3a3410ec
hopefully this fixes the looping gatling processes
11 years ago
leitner
e175800a8c
add io_fd_canwrite (like io_fd but assume the fd is writable)
...
save a few syscalls here and there
13 years ago
leitner
6e6fc8b85d
fix endless loop bug on freebsd
13 years ago
leitner
c2a2a15c12
document the return value expected from the callback given to iob_write
...
remove unused #include in iob_reset
if iob_addfile_close fails, it now closes the fd
if iob_addbuf_munmap fails, it now munmaps the buf
if iob_addbuf_free fails, it now frees the buf
some win32 cross-compile fixes for iarray
13 years ago
leitner
662cf55fc9
accept -3 as error return from the callback, too
13 years ago
leitner
b0886bc324
the iob calls return int, not void
13 years ago
leitner
d2aae4864c
only try to receive one byte to avoid discarding data
14 years ago
leitner
3bed09a972
get rid of warning
15 years ago
leitner
acd4fdb68b
add/fix man pages
...
zero a buffer in io_passfd so valgrind does not complain when we pass it
to a syscall (which did not use the uninitialized parts anyway)
15 years ago
leitner
1fcfcd268a
hups
16 years ago
leitner
51202765fe
the #define extern hack in io_fd.c also included time.h, fix that
...
catch case in timeout loop where we have something to report on an fd;
in that case do not report a timeout but let the other event get through
first.
16 years ago
leitner
fd47173110
remove four warnings
16 years ago
leitner
a8a5e9a3d5
some valgrind de-noising
...
fix subtle typo in sub_of (David Sirovsky)
17 years ago
leitner
68d88f60b9
munmap cleanup fix (Erdgeist)
17 years ago
leitner
8b17690318
use callback based infrastructure to reset iob's
17 years ago
leitner
527efc70b6
add iob_addbuf_munmap
17 years ago
leitner
1b88982d19
off-by-one
18 years ago
leitner
7b52bfc982
fix really pathological case where io_timeouted would never
...
start over from the beginning because always new accept()ed
connections came in and got newer, higher descriptors since the last
io_timeouted loop. (Dirk Engling)
18 years ago
leitner
8eab2b5aaf
make io_timeout clearer
18 years ago
leitner
f046d1cdc1
add iob_bytesleft
...
don't leak memory in test/httpd.c
18 years ago
leitner
83c1186870
fix for NetBSD 3.0 (they broke their sys/types.h)
...
remove support for ip6.int reverse lookup in DNS routines (the domain is
no longer delegated)
19 years ago
leitner
d361d81c64
make socket_(tc|ud)p[46] actually return non-blocking sockets as
...
documented (Richard Lyons)
19 years ago
leitner
d468ea9eb7
add io_block
19 years ago
leitner
c16d9880dc
remove printf
19 years ago
leitner
c1c50c7dbd
further Windoze support (test/io5.c works, gatling still doesn't)
...
This is just to get gatling to work, I may remove it again after
that.
19 years ago
leitner
f65398ff2e
io_close resets the cookie
20 years ago
leitner
9512cee614
add -D_REENTRANT to CFLAGS so libowfat can be used in multi-threaded
...
programs
20 years ago
leitner
b1e8f341ba
no debug
20 years ago
leitner
12caccfd48
don't shrink in array_allocate
20 years ago
leitner
e1e80badf0
add some debug stuff
20 years ago
leitner
46dcfbdce1
Uh, it's #warning and not #warn. *blush*
20 years ago
leitner
289ca04238
Work around OpenBSD. Again.
20 years ago
leitner
f0e9a2afc9
work around broken Solaris sys/socket.h
20 years ago
leitner
c169ae9b4a
IRIX compatibility (yuck!)
20 years ago
leitner
9405f1271b
remove gcc4-only warning option
20 years ago
leitner
c874604f12
gcc 4 cleanups (mostly unsigned char* vs char*)
20 years ago
leitner
7cd919d333
silence two gcc warnings
20 years ago
leitner
11da04b651
fix descriptor leak in iob_addfile_close if the range was 0 (oops)
20 years ago
leitner
1205a3d38f
byte_zero the allocated io_batch in iob_new
20 years ago
leitner
882885fdff
remove cruft
20 years ago
leitner
9eb09b5bfe
add iob_free and man page for iob_reset.
...
check in some windoze compat crap (still does not compile through for
windoze)
20 years ago
leitner
e73c3e85f1
document error case
20 years ago
leitner
bbf4c614bf
fix iob_write to handle failure properly
...
document that the iob_write callback should limit itself
20 years ago
leitner
f4c8a0c7c2
fix openbsd problem?
20 years ago
leitner
fd4344f3c0
how could this ever have worked?
20 years ago
leitner
89c12ba545
typo, found by Tino Reichardt
20 years ago
leitner
b617d63d1e
update dependencies
...
add errmsg_info and msg
20 years ago
leitner
bffb1dab90
mention prototype of io_write_callback
20 years ago
leitner
86cfc33dab
add iob_write (send io batch through callback, e.g. for SSL)
20 years ago
leitner
b48ce77792
add iob_write (to write an io batch through a callback)
20 years ago
leitner
e95599085a
use madvise MADV_PREFETCH to implement iob_prefetch
20 years ago
leitner
f4108178f2
fix case where iob_send sends all from io batch, but then new data is
...
added and iob_send is called again
21 years ago
leitner
523f6f4765
cosmetics: use write instead of writev if there is only one buffer to
...
write (looks nicer in strace)
21 years ago
leitner
72382af11a
Solaris compatibility for io_passfd and io_receivefd (untested, but at
...
least it compiles)
21 years ago
leitner
1e871b1c32
actually return 0 on success in io_passfd
21 years ago
leitner
696c5f872c
add io_readwritefile, io_appendfile
21 years ago
leitner
11f0616cf3
work around broken Linux sendfile API (offset 64-bit but count 32-bit)
21 years ago
leitner
768a46e304
argh more bsd
21 years ago
leitner
a23757a317
bsd compat
21 years ago
leitner
f26451c086
slight optimization for sending 0 bytes from a file
...
(also fixes a FreeBSD-current sendfile breakage)
21 years ago
leitner
5e2141e9f6
fix bug in mmap code path of io_sendfile (David Leadbeater)
21 years ago
leitner
d8ce4dc2e5
fix signal race (Scott Lamb)
21 years ago
leitner
076a8f4628
explicitly define extern globals
21 years ago
leitner
78d181cb3e
document return values correctly
21 years ago
leitner
6fb76c3cd9
<io.h> -> <iob.h>
21 years ago
leitner
4aecd26995
add more man pages
21 years ago
leitner
24227e0e01
add sigpipe helper
21 years ago
leitner
1d9075071f
add some man pages
21 years ago
leitner
b27aa1a9d8
better error handling
21 years ago
leitner
70e112b892
add fd passing functions
21 years ago
leitner
745c4affc5
add io_socketpair
21 years ago
leitner
3996ade63e
add iob_addfile_close (iob_reset will close the files)
21 years ago
leitner
adcb7aee21
handle POLLNVAL (can't happen errors)
21 years ago
leitner
8454eb7e4c
speculative pre-emptive freebsd 4 compatibility ;)
21 years ago
leitner
069aedc871
try to fix freebsd 4 compile error
21 years ago
leitner
4eed466fbc
writev fix
21 years ago
leitner
177e18f415
the mmap+write version of io_sendfile sent too much at the end and/or
...
went into an infinite loop sometimes.
21 years ago
leitner
c18a0dbf62
actually check in AIX sendfile code
21 years ago
leitner
cae1a561fd
integrate Linux sendfile into trysendfile.c infrastructure
...
first stab at AIX 5 sendfile support
21 years ago