Lower the default buffer size

For ejabberd and the mongooseim fork of ejabbered, 4097 bytes is around
the maximum message size before messages are dropped (the extra byte is
for libstrophe to put the terminating NULL. Otherwise, with a buffer
of 4096, the message will be broken up into 2 parts, with the second
consisting of the last byte of the message).

With base64 encoding, the message size will increase to 4097 * 4 / 3
bytes. When sending streams of binary data (cat'ing a file over XMPP,
ssh over XMPP, ...), stream management will get backlogged and messages
will disappear.

So halve the default buffer size. Is it too big for other jabber
servers? It is one of the mysteries but the "-b" option exists for those.
pull/1/head
Michael Santos 9 years ago
parent 1975057b6d
commit c3c83f9d72

@ -68,7 +68,7 @@ main(int argc, char **argv)
state = xmppipe_calloc(1, sizeof(xmppipe_state_t));
state->status = XMPPIPE_S_CONNECTING;
state->bufsz = 4097;
state->bufsz = 2049;
state->poll = 10;
state->keepalive = 60 * 1000;
state->keepalive_limit = 3;

Loading…
Cancel
Save