gri3-wm/libi3
Orestis Floros 37d0105c83
Kill misbehaving subscribed clients instead of hanging
This change only affects clients that are subscribed to events, which
should be the main cause of our problems.

In the common case (no buffered data) the behaviour doesn't change at
all: the message is sent directly, no ev_io / ev_timeout callback is
enabled. Once a write to a client's socket is not completed fully
(returns with EAGAIN error), we put the message in the tail of a queue
and init an ev_io callback and a corresponding timer. If the timer is
triggered first, the socket is closed and the client connection is
removed. If the socket becomes writeable before the timeout we either
reset the timer if we couldn't push all the buffered data or completely
remove it if everything was pushed.

We could also replace ipc_send_message() for all client connections in
i3, not just those subscribed to events.

Furthermore, we could limit the amount of messages stored and increase
the timeout (or use multiple timeouts): eg it's ok if a client is not
reading for 10 seconds and we are only holding 5KB of messages for them
but it is not ok if they are inactive for 5 seconds and we have 30MB of
messages held.

Closes #2999
Closes #2539
2018-08-08 19:14:56 +03:00
..
README Introduce libi3, an *internal* library to eliminate code duplication 2011-10-02 16:11:30 +01:00
dpi.c Fixes #3072, Xft.dpi can be floating point 2017-12-09 15:12:25 +01:00
draw_util.c libi3: Add basic validation to hex color conversion 2017-07-12 17:53:15 -04:00
fake_configure_notify.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
font.c fix height offset calculation in pango text drawing 2018-07-28 19:31:32 -07:00
format_placeholders.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
get_colorpixel.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
get_config_path.c Correct XDG paths precedence for config files 2018-07-10 05:04:34 +03:00
get_exe_path.c Replace http:// with https:// where applicable 2017-09-24 10:19:07 +02:00
get_mod_mask.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
get_process_filename.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
get_visualtype.c Update copyright notices and get rid of ranges 2015-04-20 17:50:21 -04:00
ipc_connect.c no-op refactoring: make ipc_connect find socket path 2017-11-26 16:41:59 +01:00
ipc_recv_message.c Bugfix: avert endless loop on unexpected EOF at ipc messages (#3021) 2017-11-09 11:18:23 -08:00
ipc_send_message.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
is_debug_build.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
mkdirp.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
resolve_tilde.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
root_atom_contents.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
safewrappers.c Kill misbehaving subscribed clients instead of hanging 2018-08-08 19:14:56 +03:00
string.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
strndup.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
ucs2_conversion.c Fix redundant casts to the same type 2018-04-27 00:09:42 +03:00

README

Introduction
============

libi3 is an *INTERNAL* library which contains functions that i3 and related
tools (i3-msg, i3-input, i3-nagbar, i3-config-wizard, i3bar) use.

It is NOT to be used by other programs.

Structure
=========

Every function gets its own .c file, which in turn gets compiled into an .o
object file. Afterwards, all .o files are archived into one static library
(libi3.a). This library will be linked into all i3 binaries. The linker is able
to eliminate unused .o files when linking, so only the functions which you
actually use will be included in the corresponding binary.