summaryrefslogtreecommitdiff
path: root/hw/kdrive/ephyr/ephyrglxext.c
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@openedhand.com>2007-08-31 14:43:39 +0200
committerDodji Seketeli <dodji@openedhand.com>2007-10-02 16:55:16 +0200
commit9e192d2118246ad715e23cf5626a038274eb1eaa (patch)
treecb0985b98d83d9188e2bf75be965555ae0b114aa /hw/kdrive/ephyr/ephyrglxext.c
parent4dd4be99df38b70d43b02d9cb19e09e0ed94462b (diff)
Xephyr: better error handling in GLX forwarding
* hw/kdrive/ephyr/ephyrglxext.c: fixed various logging functions (ephyrGLXGetStringReal): make sure all the string is sent to clients including the ending zero. * hw/kdrive/ephyr/ephyrhostglx.c: (ephyrHostGLXGetStringFromServer): better error handling. (ephyrHostGLXSendClientInfo): ditto. (ephyrHostGLXMakeCurrent): ditto
Diffstat (limited to 'hw/kdrive/ephyr/ephyrglxext.c')
-rw-r--r--hw/kdrive/ephyr/ephyrglxext.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/hw/kdrive/ephyr/ephyrglxext.c b/hw/kdrive/ephyr/ephyrglxext.c
index fbac6aa9a..27b2a2dc3 100644
--- a/hw/kdrive/ephyr/ephyrglxext.c
+++ b/hw/kdrive/ephyr/ephyrglxext.c
@@ -368,7 +368,7 @@ ephyrGLXQueryServerString(__GLXclientState *a_cl, GLbyte *a_pc)
EPHYR_LOG_ERROR ("failed to query string from host\n") ;
goto out ;
}
- EPHYR_LOG ("string: %s", server_string) ;
+ EPHYR_LOG ("string: %s\n", server_string) ;
length= strlen (server_string) + 1;
reply.type = X_Reply ;
reply.sequenceNumber = client->sequence ;
@@ -577,8 +577,8 @@ ephyrGLXGetStringReal (__GLXclientState *a_cl, GLbyte *a_pc, Bool a_do_swap)
goto out ;
}
if (string) {
- length = strlen (string) ;
- EPHYR_LOG ("got string: string:%s\n", string) ;
+ length = strlen (string) + 1;
+ EPHYR_LOG ("got string:'%s', size:%d\n", string, length) ;
} else {
EPHYR_LOG ("got string: string (null)\n") ;
}
@@ -593,7 +593,7 @@ ephyrGLXGetStringReal (__GLXclientState *a_cl, GLbyte *a_pc, Bool a_do_swap)
res = Success ;
out:
- EPHYR_LOG ("enter\n") ;
+ EPHYR_LOG ("leave\n") ;
return res ;
}
@@ -619,6 +619,8 @@ ephyrGLXGetIntegervReal (__GLXclientState *a_cl, GLbyte *a_pc, Bool a_do_swap)
GLint answer_buf_room[200];
GLint *buf=NULL ;
+ EPHYR_LOG ("enter\n") ;
+
a_pc += __GLX_SINGLE_HDR_SIZE;
int_name = *(GLenum*) (a_pc+0) ;
@@ -638,7 +640,9 @@ ephyrGLXGetIntegervReal (__GLXclientState *a_cl, GLbyte *a_pc, Bool a_do_swap)
}
__glXSendReply (a_cl->client, buf, 1, sizeof (value), GL_FALSE, 0) ;
res = Success ;
+
out:
+ EPHYR_LOG ("leave\n") ;
return res ;
}
@@ -665,6 +669,8 @@ ephyrGLXIsDirectReal (__GLXclientState *a_cl, GLbyte *a_pc, Bool a_do_swap)
EPHYR_RETURN_VAL_IF_FAIL (a_cl && a_pc, FALSE) ;
+ EPHYR_LOG ("enter\n") ;
+
memset (&reply, 0, sizeof (reply)) ;
if (!ephyrHostIsContextDirect (req->context, (int*)&is_direct)) {
EPHYR_LOG_ERROR ("ephyrHostIsContextDirect() failed\n") ;
@@ -676,7 +682,9 @@ ephyrGLXIsDirectReal (__GLXclientState *a_cl, GLbyte *a_pc, Bool a_do_swap)
reply.sequenceNumber = client->sequence;
WriteToClient(client, sz_xGLXIsDirectReply, (char *)&reply);
res = Success ;
+
out:
+ EPHYR_LOG ("leave\n") ;
return res ;
}