From patchwork Tue Sep 2 09:21:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 385023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 772D0140119 for ; Tue, 2 Sep 2014 19:23:00 +1000 (EST) Received: from localhost ([::1]:36860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOkIk-0000SD-Iy for incoming@patchwork.ozlabs.org; Tue, 02 Sep 2014 05:22:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOkIJ-0008M3-GD for qemu-devel@nongnu.org; Tue, 02 Sep 2014 05:22:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOkID-0006NZ-QB for qemu-devel@nongnu.org; Tue, 02 Sep 2014 05:22:31 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:35507 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOkID-0006NP-F5 for qemu-devel@nongnu.org; Tue, 02 Sep 2014 05:22:25 -0400 Received: (qmail 6761 invoked by uid 89); 2 Sep 2014 09:22:24 -0000 Received: from [82.141.1.145] by client-16-kamp (envelope-from , uid 89) with qmail-scanner-2010/03/19-MF (clamdscan: 0.98.4/19319. hbedv: 8.3.24.18/7.11.170.116. spamassassin: 3.4.0. Clear:RC:1(82.141.1.145):SA:0(-1.2/4.0):. Processed in 3.837678 secs); 02 Sep 2014 09:22:24 -0000 Received: from ns.kamp-intra.net (HELO dns.kamp-intra.net) ([82.141.1.145]) by mx01.kamp.de with SMTP; 2 Sep 2014 09:22:20 -0000 X-GL_Whitelist: yes Received: from lieven-pc.kamp-intra.net (lieven-pc.kamp-intra.net [172.21.12.60]) by dns.kamp-intra.net (Postfix) with ESMTP id C21FF20683; Tue, 2 Sep 2014 11:22:10 +0200 (CEST) Received: by lieven-pc.kamp-intra.net (Postfix, from userid 1000) id B86B56113A; Tue, 2 Sep 2014 11:22:10 +0200 (CEST) From: Peter Lieven To: qemu-devel@nongnu.org Date: Tue, 2 Sep 2014 11:21:57 +0200 Message-Id: <1409649717-17004-1-git-send-email-pl@kamp.de> X-Mailer: git-send-email 1.7.9.5 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a02:248:0:51::16 Cc: Peter Lieven , kraxel@redhat.com Subject: [Qemu-devel] [PATCH] ui/vnc: set TCP_NODELAY X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org we currently have the Nagle algorithm enabled for all outgoing VNC updates. This may delay sensitive updates as mouse movements or typing in the console. As we currently prepare all data in a buffer and then send as much as we can this should not cause big trouble. Well established VNC servers like TightVNC set TCP_NODELAY as well. A regular framebuffer update request generates exactly one framebuffer update which should be pushed out as fast as possible. Signed-off-by: Peter Lieven --- ui/vnc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/vnc.c b/ui/vnc.c index 1bc1ae0..b12d0ea 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2885,6 +2885,10 @@ static void vnc_listen_read(void *opaque, bool websocket) } if (csock != -1) { +#ifdef TCP_NODELAY + int flag = 1; + setsockopt(csock, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)); +#endif vnc_connect(vs, csock, false, websocket); } }