summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-05-31 20:04:15 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-05-31 20:04:15 +0000
commit5569ff9723fcacb0e0206f02adbb4b85368bc1bf (patch)
tree76f9b0f74c209069e484a89554b66234ba40452f /client.c
parentabe745f99126838079e8d70318983a3b66356573 (diff)
Don't hang when window closes early; also add lots more debugging.
Diffstat (limited to 'client.c')
-rw-r--r--client.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/client.c b/client.c
index 20e5dc33..7acc2eeb 100644
--- a/client.c
+++ b/client.c
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.25 2007-12-06 09:46:21 nicm Exp $ */
+/* $Id: client.c,v 1.26 2008-05-31 20:04:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -130,6 +130,19 @@ client_main(struct client_ctx *cctx)
if (sigwinch)
client_handle_winch(cctx);
+ switch (client_msg_dispatch(cctx, &error)) {
+ case -1:
+ goto out;
+ case 0:
+ /* May be more in buffer, don't let poll block. */
+ timeout = 0;
+ break;
+ default:
+ /* Out of data, poll may block. */
+ timeout = INFTIM;
+ break;
+ }
+
pfd.fd = cctx->srv_fd;
pfd.events = POLLIN;
if (BUFFER_USED(cctx->srv_out) > 0)
@@ -143,19 +156,6 @@ client_main(struct client_ctx *cctx)
if (buffer_poll(&pfd, cctx->srv_in, cctx->srv_out) != 0)
goto server_dead;
-
- switch (client_msg_dispatch(cctx, &error)) {
- case -1:
- goto out;
- case 0:
- /* May be more in buffer, don't let poll block. */
- timeout = 0;
- break;
- default:
- /* Out of data, poll may block. */
- timeout = INFTIM;
- break;
- }
}
out: