[spice] turn on TCP_QUICKACK

https://assets.extrahop.com/whitepapers/TCP-Optimization-Guide-by-ExtraHop.pdf
This commit is contained in:
Geoffrey McRae 2020-01-11 16:03:28 +11:00
parent 5e915dd1ff
commit e554635e48
5 changed files with 12 additions and 3 deletions

View File

@ -1 +1 @@
B1-79-g13f55011c0+1 B1-80-g5e915dd1ff+1

View File

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
project(spice LANGUAGES C) project(spice LANGUAGES C)
set(CMAKE_C_STANDARD 11)
find_package(PkgConfig) find_package(PkgConfig)
pkg_check_modules(SPICE_PKGCONFIG REQUIRED pkg_check_modules(SPICE_PKGCONFIG REQUIRED

View File

@ -733,8 +733,9 @@ bool spice_connect_channel(struct SpiceChannel * channel)
if (spice.family != AF_UNIX) if (spice.family != AF_UNIX)
{ {
int flag = 1; const int flag = 1;
setsockopt(channel->socket, IPPROTO_TCP, TCP_NODELAY , &flag, sizeof(int)); setsockopt(channel->socket, IPPROTO_TCP, TCP_NODELAY , &flag, sizeof(int));
setsockopt(channel->socket, IPPROTO_TCP, TCP_QUICKACK, &flag, sizeof(int));
} }
if (connect(channel->socket, &spice.addr.addr, addrSize) == -1) if (connect(channel->socket, &spice.addr.addr, addrSize) == -1)

View File

@ -49,6 +49,7 @@ struct AppState
bool drawCursor; bool drawCursor;
bool cursorInView; bool cursorInView;
bool updateCursor; bool updateCursor;
bool initialCursorSync;
float scaleX, scaleY; float scaleX, scaleY;
float accX, accY; float accX, accY;
int curLastX; int curLastX;

View File

@ -25,6 +25,12 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#define INTERLOCKED_GET(x) __sync_fetch_and_add((x), 0) #define INTERLOCKED_GET(x) __sync_fetch_and_add((x), 0)
#define INTERLOCKED_CE(x, c, v) __sync_val_compare_and_swap((x), (c), (v)) #define INTERLOCKED_CE(x, c, v) __sync_val_compare_and_swap((x), (c), (v))
#define INTERLOCKED_ENTER(lock) \
while(__sync_lock_test_and_set(&(lock), 1)) while((lock));
#define INTERLOCKED_EXIT(lock) \
__sync_lock_release(&(lock));
#define INTERLOCKED_SECTION(lock, x) \ #define INTERLOCKED_SECTION(lock, x) \
while(__sync_lock_test_and_set(&(lock), 1)) while((lock)); \ while(__sync_lock_test_and_set(&(lock), 1)) while((lock)); \
x\ x\