search for: io_writ

Displaying 17 results from an estimated 17 matches for "io_writ".

Did you mean: io_write
2005 Dec 14
2
Patch: ioloop using kqueue/kevent for FreeBSD
...s/time.h> + +#ifndef INITIAL_BUF_SIZE +# define INITIAL_BUF_SIZE 128 +#endif + + +struct ioloop_handler_context { + int kq; + size_t evbuf_size; + struct kevent *evbuf; + + size_t fds_size; + struct fdrecord *fds; +}; + +struct fdrecord { + /* IO_READ | IO_WRITE | IO_ERROR */ + unsigned char mode : 3; +}; + + +void io_loop_handler_init(struct ioloop *ioloop) +{ + struct ioloop_handler_context *ctx; + + ioloop->handler_context = ctx = + p_new(ioloop->pool, struct ioloop_handler_context, 1); + ctx->evbuf_s...
2004 Oct 25
0
[PATCH] move iolist functions into separate file
...quot;ioloop-internal.h" + +int iolist_add(struct io_list *list, struct io *io) +{ + if ((io->condition & IO_READ) != 0) { + i_assert(list->ios[IOLIST_INPUT] == NULL); + list->ios[IOLIST_INPUT] = io; + return list->ios[IOLIST_OUTPUT] == NULL; + } + if ((io->condition & IO_WRITE) != 0) { + i_assert(list->ios[IOLIST_OUTPUT] == NULL); + list->ios[IOLIST_OUTPUT] = io; + return list->ios[IOLIST_INPUT] == NULL; + } + + i_unreached(); + return TRUE; +} + +int iolist_del(struct io_list *list, struct io *io) +{ + if (list->ios[IOLIST_INPUT] == io) { + list->ios...
2003 Apr 16
1
PATCH Add support for kqueue in ioloop subsystem
...free(ioloop->pool, ioloop->handler_data); } void io_loop_handle_add(struct ioloop *ioloop, int fd, int condition) { short filter; struct ioloop_handler_data *data = ioloop->handler_data; i_assert(fd >= 0); if (condition & IO_READ) filter |= EVFILT_READ; if (condition & IO_WRITE) filter |= EVFILT_WRITE; EV_SET(&data->event, fd, filter, EV_ADD, 0, 0, NULL); if (kevent(data->kq, &data->event, 1, NULL, 0, NULL) < 0) { i_warning("couldn't add filter with kqueue: %m"); } } void io_loop_handle_remove(struct ioloop *ioloop, int fd, int...
2018 Feb 27
2
tinc 1.1: missing PONG
...lem, but it's okay because user code does not rely on this event being fired again if ignored. */ - io_t *writeable_io = NULL; + unsigned int curgen = io_tree.generation; - for splay_each(io_t, io, &io_tree) + for splay_each(io_t, io, &io_tree) { if(io->flags & IO_WRITE && send(io->fd, NULL, 0, 0) == 0) { - writeable_io = io; - break; + io->cb(io->data, IO_WRITE); + + if(curgen != io_tree.generation) { + break; + } } + } - if(writeable_io) { - writeable_io->cb(writeable_io->data, IO_WRITE); - continue; + if(e...
2004 Aug 30
0
[PATCH] [RFC] epoll based ioloop handler (now with patch)
...LHUP) + +static int epoll_event_mask(struct io_list *list) +{ + int events = 0, i; + struct io *io; + + for (i = 0; i < list->count; i++) { + io = list->ios[i]; + + if (!io) + continue; + + if (io->condition & IO_READ) + events |= IO_EPOLL_INPUT; + if (io->condition & IO_WRITE) + events |= IO_EPOLL_OUTPUT; + } + + return events; +} + +static void iolist_add(struct io_list *list, struct io *io) +{ + int i; + + i_assert(list->count < EPOLL_IOS_PER_FD); + + for (i = 0; i < EPOLL_IOS_PER_FD; i++) { + if (!list->ios[i]) { + list->ios[i] = io; + break; +...
2008 Jun 07
2
typo in failures.c
Hi, I found a typo on line 101 of dovecot-1.1.rc8/src/lib/failures.c. The first two arguments to io_add() are reversed. The fd should be first, and IO_WRITE second.
2016 Jul 11
4
2.3.0~alpha0-1~auto+197: Crash when openening a message via IMAP
...06.36, lip=141.42.206.11, mpid=27254, TLS, session=<TGwoO1o3id+NKs4k> Jul 11 13:12:44 mproxy dovecot: imap(hildeb)<TGwoO1o3id+NKs4k>: Panic: file imap-client.c: line 854 (client_check_command_hangs): assertion failed: ((io_loop_find_fd_conditions(current_ioloop, client->fd_out) & IO_WRITE) != 0) Jul 11 13:12:44 mproxy dovecot: imap(hildeb)<TGwoO1o3id+NKs4k>: Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(+0x8e09e) [0x7efd1d3a309e] -> /usr/lib/dovecot/libdovecot.so.0(+0x8e18c) [0x7efd1d3a318c] -> /usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7efd1d34169e] ->...
2004 Aug 25
0
[PATCH] move highest_fd calculations to ioloop-select.c
...= -1; ioloop->handler_data = p_new(ioloop->pool, struct ioloop_handler_data, 1); FD_ZERO(&ioloop->handler_data->read_fds); @@ -44,6 +63,9 @@ void io_loop_handle_add(struct ioloop *i FD_SET(fd, &ioloop->handler_data->read_fds); if (condition & IO_WRITE) FD_SET(fd, &ioloop->handler_data->write_fds); + + if (io->fd > ioloop->highest_fd) + ioloop->highest_fd = io->fd; } void io_loop_handle_remove(struct ioloop *ioloop, struct io *io) @@ -57,6 +79,10 @@ void io_loop_handle_remove(struct ioloop FD_CLR(fd, &iolo...
2005 Dec 15
2
Patch: More of kqueue() support.
...) 2005 Vaclav Haisman <v.haisman@sh.cvut.cz> * @@ -16,6 +16,7 @@ #ifdef IOLOOP_KQUEUE +#include <unistd.h> #include <sys/types.h> #include <sys/event.h> #include <sys/time.h> @@ -24,6 +25,8 @@ # define INITIAL_BUF_SIZE 128 #endif +#define MASK (IO_READ | IO_WRITE | IO_ERROR) + struct ioloop_handler_context { int kq; size_t evbuf_size; @@ -57,6 +60,7 @@ void io_loop_handler_init(struct ioloop void io_loop_handler_deinit(struct ioloop *ioloop) { + close(ioloop->handler_context->kq); p_free(ioloop->pool, ioloop...
2010 Mar 21
3
2.0.beta3 imapd running hot
Hi, since a couple of weeks I occasionally have an imapd going crazy on me, using up 100% CPU. Current revision is 10962 29865 vmail 20 0 47820 3296 1708 R 99.7 0.9 131:07.85 imap vmail 29865 86.1 0.8 47820 3296 ? R Mar20 131:20 dovecot/imap [berni 2001:a60:f001:1:219:66ff:fe8b:a6e IDLE strace -p <pid> shows a repeating pattern of epoll_wait(8, {{EPOLLOUT,
2010 Mar 26
2
Busy looping of 2.0Beta4 on NetBSD-current
I built and install Dovecot 2.0Beta4 on my NetBSD/amd64-current system, and am seeing the user-owned imap processes busy-looping. In Dovecot 1.2.x (and 1.x and 0.x..) I force ionotify and ioloop to kqueue, so I suspected that was the problem. Turns out it's not: Using poll or none also causes the same problem. This did not happen in 1.2.8 (didn't try anything later than that).
2006 May 09
2
Fix for the kevent "Unrecognized event" problem.
The attached patch should fix the problem with dying imap on "Unrecognized event". The problem is that when we register a handle for IO_ERROR only, we still can get readable/writable event without EV_EOF being set. This case was not handled. -- Vaclav Haisman -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: io-kq.diff URL:
2004 Oct 25
0
[PATCH] Request for testing: BSD kqueue ioloop handler
...D; i++) { + io = list->ios[i]; + if (io == NULL) + continue; + + call = FALSE; + if ((event->filter & EV_EOF) != 0) { + call = TRUE; + } else if ((io->condition & IO_READ) != 0) { + call = event->filter & EVFILT_READ; + } else if ((io->condition & IO_WRITE) != 0) { + call = event->filter & EVFILT_WRITE; + } + + if (call) { + t_id = t_push(); + io->callback(io->context); + if (t_pop() != t_id) + i_panic("Leaked a t_pop() call!"); + } + } + } +} + +#endif /* IOLOOP_KQUEUE */ diff -urpNX /usr/share/dontdiff...
2016 Jul 04
3
kqueue crash on FreeBSD with 2.2.25
On 16-07-03 03:30:36, Timo Sirainen wrote: > On 02 Jul 2016, at 03:30, Adam Weinberger <adamw at adamw.org> wrote: > > > >>> Jul 1 10:07:27 imap dovecot: master: Panic: kevent(EV_ADD, READ, 54) failed: Bad file descriptor > >>> > >>> It's not dumping core, and I get the message even with "protocols =" > >>> >
2010 Apr 14
4
PostgreSQL driver supporting [round-robin] load balancing and redundancy [LONG]
...+ i_info("%s: %p: connected", __func__, pgc); + add_ready_pgc(pgc->pgdb, pgc); + return; + + case PGRES_POLLING_FAILED: + pg_call = "PQconnectPoll"; + goto error; + + case PGRES_POLLING_READING: + io_dir = IO_READ; + break; + + case PGRES_POLLING_WRITING: + io_dir = IO_WRITE; + } + + pgc->io = io_add(PQsocket(the_pgc), io_dir, continue_pgc_connect, pgc); + return; + +error: + log_pg_error(pgc, __func__, pg_call); + + PQfinish(the_pgc); + pgc->pgc = NULL; + + pgc->timeout = timeout_add(RECONNECT_DELAY, + restart_pgc_connect, pgc); +} + +static void start...
2010 Mar 13
2
Design: Asynchronous I/O for single/multi-dbox
...the buffer. Async output streams also work the same as non-blocking file_ostreams: write() returns the number of bytes added to buffer. When buffer becomes full, it starts returning EAGAIN. The ostream handles flushing internally the same way as file_ostreams does, although instead of using io_add(IO_WRITE) it uses FS API's set_output_callback(). If callers need to know when more data can be written or when all of the data has been written, it can override the ostream's flush_callback, just like with file_ostreams. Async IO for FS API backend =========================== So now that all of...
2013 Oct 15
23
[PATCH 00/21] Upgrade to Lua 5.2.2, add filesystem module and get_key binding
Hi, This series targets automatic boot menu generation, but most of it is the Lua upgrade, because I got tired reading deprecated API docs. It's mostly a straightforward forward port of the earlier Syslinux specific changes to Lua 5.1, except that: * I chose the add a stub getenv() implementation to the COM32 API instead of #ifdefing out all the references in Lua, and * I kept oslib