Commit 4f18b998 authored by sergeyu's avatar sergeyu Committed by Commit bot

Increase buffer size for XMPP sockets.

Previously 4096 bytes write buffer was used for XMPP socket. Problem is
that ChromeAsyncSocket stops writing when the buffer is full and
talk::XmppClient ignores this error, as result random chunks of data may
be lost. This CL increses buffer size to 64k - same value that's used in
notifier::XmppConnection.
This is essentially a temporary workaround until the problem is fixed
in jingle::ChromeAsyncSocket or talk::XmppClient

BUG=417336

Review URL: https://codereview.chromium.org/608613002

Cr-Commit-Position: refs/heads/master@{#296805}
parent a19e4877
......@@ -27,10 +27,16 @@ const char kDefaultResourceName[] = "chromoting";
// connections that are idle for more than a minute.
const int kKeepAliveIntervalSeconds = 50;
// Read buffer size used by ChromeAsyncSocket for read and write buffers. Most
// of XMPP messages are smaller than 4kB.
const size_t kReadBufferSize = 4096;
const size_t kWriteBufferSize = 4096;
// Read buffer size used by ChromeAsyncSocket for read and write buffers.
//
// TODO(sergeyu): Currently jingle::ChromeAsyncSocket fails Write() when the
// write buffer is full and talk::XmppClient just ignores the error. As result
// chunks of data sent to the server are dropped (and they may not be full XMPP
// stanzas). The problem needs to be fixed either in XmppClient on
// ChromeAsyncSocket (e.g. ChromeAsyncSocket could close the connection when
// buffer is full).
const size_t kReadBufferSize = 64 * 1024;
const size_t kWriteBufferSize = 64 * 1024;
namespace remoting {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment