aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-10-07 16:40:05 +0200
committermarha <marha@users.sourceforge.net>2013-10-07 16:40:05 +0200
commit8f0ed7f7a754df710b13b9dabbaa32b5d4211182 (patch)
tree03bf52a933c29962894c2cec5f33028439cf4f5a /xorg-server/os
parent7d29f4054380e7f42722c280b9caedce9fa4ace9 (diff)
parent81fd17c8678e89cea6610b8b2996b028b21eb5dc (diff)
downloadvcxsrv-8f0ed7f7a754df710b13b9dabbaa32b5d4211182.tar.gz
vcxsrv-8f0ed7f7a754df710b13b9dabbaa32b5d4211182.tar.bz2
vcxsrv-8f0ed7f7a754df710b13b9dabbaa32b5d4211182.zip
Merge remote-tracking branch 'origin/released'
* origin/released: xserver fontconfig libXdmcp mesa pixmand xkeyboard-config git update 7 oct 2013 Conflicts: xorg-server/dix/dispatch.c xorg-server/dix/privates.c xorg-server/glx/glxcmds.c xorg-server/hw/kdrive/ephyr/ephyr.h xorg-server/hw/kdrive/ephyr/ephyrinit.c xorg-server/hw/kdrive/ephyr/hostx.c
Diffstat (limited to 'xorg-server/os')
-rw-r--r--xorg-server/os/access.c8
-rw-r--r--xorg-server/os/io.c63
-rw-r--r--xorg-server/os/utils.c2
3 files changed, 31 insertions, 42 deletions
diff --git a/xorg-server/os/access.c b/xorg-server/os/access.c
index d3e7da599..c8e15cfea 100644
--- a/xorg-server/os/access.c
+++ b/xorg-server/os/access.c
@@ -163,6 +163,10 @@ SOFTWARE.
/* #endif */
#endif
+#if defined(IPv6) && defined(AF_INET6)
+#include <arpa/inet.h>
+#endif
+
#endif /* WIN32 */
#define X_INCLUDE_NETDB_H
@@ -631,10 +635,6 @@ CarryOnTheOldWay:
#endif
#if defined(IPv6) && defined(AF_INET6)
-#include <arpa/inet.h>
-#endif
-
-#if defined(IPv6) && defined(AF_INET6)
static void
in6_fillscopeid(struct sockaddr_in6 *sin6)
{
diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c
index 39c7bf160..2c8b05a76 100644
--- a/xorg-server/os/io.c
+++ b/xorg-server/os/io.c
@@ -206,27 +206,17 @@ YieldControlDeath(void)
timesThisConnection = 0;
}
-int
-ReadRequestFromClient(ClientPtr client)
+/* If an input buffer was empty, either free it if it is too big or link it
+ * into our list of free input buffers. This means that different clients can
+ * share the same input buffer (at different times). This was done to save
+ * memory.
+ */
+static void
+NextAvailableInput(OsCommPtr oc)
{
- OsCommPtr oc = (OsCommPtr) client->osPrivate;
- ConnectionInputPtr oci = oc->input;
- int fd = oc->fd;
- unsigned int gotnow, needed;
- int result;
- register xReq *request;
- Bool need_header;
- Bool move_header;
-
- /* If an input buffer was empty, either free it if it is too big
- * or link it into our list of free input buffers. This means that
- * different clients can share the same input buffer (at different
- * times). This was done to save memory.
- */
-
if (AvailableInput) {
if (AvailableInput != oc) {
- register ConnectionInputPtr aci = AvailableInput->input;
+ ConnectionInputPtr aci = AvailableInput->input;
if (aci->size > BUFWATERMARK) {
free(aci->buffer);
@@ -236,10 +226,25 @@ ReadRequestFromClient(ClientPtr client)
aci->next = FreeInputs;
FreeInputs = aci;
}
- AvailableInput->input = (ConnectionInputPtr) NULL;
+ AvailableInput->input = NULL;
}
- AvailableInput = (OsCommPtr) NULL;
+ AvailableInput = NULL;
}
+}
+
+int
+ReadRequestFromClient(ClientPtr client)
+{
+ OsCommPtr oc = (OsCommPtr) client->osPrivate;
+ ConnectionInputPtr oci = oc->input;
+ int fd = oc->fd;
+ unsigned int gotnow, needed;
+ int result;
+ register xReq *request;
+ Bool need_header;
+ Bool move_header;
+
+ NextAvailableInput(oc);
/* make sure we have an input buffer */
@@ -494,22 +499,8 @@ InsertFakeRequest(ClientPtr client, char *data, int count)
int fd = oc->fd;
int gotnow, moveup;
- if (AvailableInput) {
- if (AvailableInput != oc) {
- ConnectionInputPtr aci = AvailableInput->input;
+ NextAvailableInput(oc);
- if (aci->size > BUFWATERMARK) {
- free(aci->buffer);
- free(aci);
- }
- else {
- aci->next = FreeInputs;
- FreeInputs = aci;
- }
- AvailableInput->input = (ConnectionInputPtr) NULL;
- }
- AvailableInput = (OsCommPtr) NULL;
- }
if (!oci) {
if ((oci = FreeInputs))
FreeInputs = oci->next;
@@ -814,7 +805,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
}
}
#endif
- if (oco->count + count + padBytes > oco->size) {
+ if (oco->count == 0 || oco->count + count + padBytes > oco->size) {
FD_CLR(oc->fd, &OutputPending);
if (!XFD_ANYSET(&OutputPending)) {
CriticalOutputPending = FALSE;
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c
index 750bd8dfb..ddd3c0c7d 100644
--- a/xorg-server/os/utils.c
+++ b/xorg-server/os/utils.c
@@ -172,9 +172,7 @@ Bool noXFree86DRIExtension = FALSE;
#ifdef XF86VIDMODE
Bool noXFree86VidModeExtension = FALSE;
#endif
-#ifdef XFIXES
Bool noXFixesExtension = FALSE;
-#endif
#ifdef PANORAMIX
/* Xinerama is disabled by default unless enabled via +xinerama */
Bool noPanoramiXExtension = TRUE;