Commit Diff


commit - f9d8661b68f61636701e3320cafaf5853db70123
commit + ec5d75ef0eb4b9bfe701449ba0d58b281229f7c9
blob - 602fa1a38bbd3bd9ae043608eacf421054cc6049
blob + 97a65550f4fc74e4a6f74b7798fdb8248a286fba
--- kamid/client.c
+++ kamid/client.c
@@ -1950,14 +1950,6 @@ handle_message(struct imsg *imsg, size_t len, int cont
 	 * Twrite is special and can be "continued" to allow writing
 	 * more than what the imsg framework would allow us to.
 	 */
-	if (writeleft > 0 && !cont) {
-		log_warnx("received a non continuation message when still "
-		    "missed %zu bytes to write", writeleft);
-		client_send_listener(IMSG_CLOSE, NULL, 0);
-		client_shutdown();
-		return;
-	}
-
 	if (cont) {
 		if (writeskip)
 			return;
@@ -1975,6 +1967,14 @@ handle_message(struct imsg *imsg, size_t len, int cont
 		return;
 	}
 
+	if (writeleft > 0) {
+		log_warnx("received a non continuation message when still "
+		    "missed %zu bytes to write", writeleft);
+		client_send_listener(IMSG_CLOSE, NULL, 0);
+		client_shutdown();
+		return;
+	}
+
 	writefid = NULL;
 	writepos = -1;
 	writetot = 0;