aboutsummaryrefslogtreecommitdiffstats
path: root/libaxl_receive.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-06-11 20:14:09 +0200
committerMattias Andrée <maandree@kth.se>2020-06-11 20:14:09 +0200
commitb56c78b9251806c5e5cd3a5fa5d1f6e8e3de351b (patch)
treeaa502d70d9969c333ccf9e70d55fd6dea41623c2 /libaxl_receive.c
parentFix error checking (diff)
downloadlibaxl-b56c78b9251806c5e5cd3a5fa5d1f6e8e3de351b.tar.gz
libaxl-b56c78b9251806c5e5cd3a5fa5d1f6e8e3de351b.tar.bz2
libaxl-b56c78b9251806c5e5cd3a5fa5d1f6e8e3de351b.tar.xz
Misc, mainly connect stuff
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libaxl_receive.c')
-rw-r--r--libaxl_receive.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libaxl_receive.c b/libaxl_receive.c
index bb4af68..11ca644 100644
--- a/libaxl_receive.c
+++ b/libaxl_receive.c
@@ -230,14 +230,15 @@ libaxl_receive(LIBAXL_CONTEXT *restrict ctx, union libaxl_input *restrict msgp,
while (conn->in_progress < n) {
r = recv(conn->fd, &inbuf[conn->in_progress], n - conn->in_progress, flags);
if (r <= 0) {
- WUNLOCK_CONNECTION_RECV(conn);
liberror_save_backtrace(NULL);
if (!r) {
liberror_set_error("The connection to the display server has been closed",
"libaxl_receive", "libaxl", LIBAXL_ERROR_CONNECTION_CLOSED);
+ WUNLOCK_CONNECTION_RECV(conn);
return LIBAXL_ERROR_CONNECTION_CLOSED;
}
liberror_recv_failed(conn->fd, &inbuf[conn->in_progress], n - conn->in_progress, flags, "<display server>");
+ WUNLOCK_CONNECTION_RECV(conn);
return LIBAXL_ERROR_SYSTEM;
}
conn->in_progress += (size_t)r;
@@ -268,15 +269,16 @@ libaxl_receive(LIBAXL_CONTEXT *restrict ctx, union libaxl_input *restrict msgp,
while (conn->in_progress < n) {
r = recv(conn->fd, &inbuf[conn->in_progress], n - conn->in_progress, flags);
if (r <= 0) {
- WUNLOCK_CONNECTION_RECV(conn);
liberror_save_backtrace(NULL);
if (!r) {
liberror_set_error("The connection to the display server has been closed",
"libaxl_receive", "libaxl", LIBAXL_ERROR_CONNECTION_CLOSED);
+ WUNLOCK_CONNECTION_RECV(conn);
return LIBAXL_ERROR_CONNECTION_CLOSED;
}
liberror_recv_failed(conn->fd, &inbuf[conn->in_progress], n - conn->in_progress,
flags, "<display server>");
+ WUNLOCK_CONNECTION_RECV(conn);
return LIBAXL_ERROR_SYSTEM;
}
conn->in_progress += (size_t)r;
@@ -575,9 +577,13 @@ received_reply:
*(void **)&msg[o] = data = &inbuf[i];
count = counts[oc++];
/* TODO */
+ fprintf(stderr, "libaxl_receive: function not fully implemented: '*' case\n");
+ abort();
break;
case '&': /* TODO */
+ fprintf(stderr, "libaxl_receive: function not fully implemented: '&' case\n");
+ abort();
/*
LIBAXL_REQUEST_LIST_FONTS
LIBAXL_REQUEST_GET_FONT_PATH