xcb_send_request: Send all requests using a common internal send_request.
authorJamey Sharp <jamey@minilop.net>
Sat, 9 Oct 2010 11:08:18 +0000 (04:08 -0700)
committerJamey Sharp <jamey@minilop.net>
Sat, 9 Oct 2010 19:37:23 +0000 (12:37 -0700)
commitee1bc1d28a1bda0526db90139edc1304d2ef3d7c
tree27868b56106d138167252d424b3fde3a4e5832c4
parent1c4717de367fe3bf1cf56bd8ef2bd30586bed023
xcb_send_request: Send all requests using a common internal send_request.

This simplifies the critical section of xcb_send_request and fixes a
couple of subtle bugs:

- It's possible for xcb_send_request to need to issue two sync requests
  before it can issue the real request. Previously, we counted sequence
  numbers as if both were issued, but only one went out on the wire.

- The test for whether to sync at 32-bit sequence number wrap has been
  incorrect since we switched to 64-bit sequence numbers internally.

This change means that if the output queue was already full and the
current request is bigger than the output queue, XCB will do one more
write syscall than it did before. But syncs are rare and small requests
are the norm, so this shouldn't be a measurable difference.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
src/xcb_out.c