Index: uspace/lib/hound/src/protocol.c
===================================================================
--- uspace/lib/hound/src/protocol.c	(revision 5ae1c51758b0e7f1201875571f58aaefc96cffbb)
+++ uspace/lib/hound/src/protocol.c	(revision 71780e099bd3d9cff0aed6ff0b00641b120373a8)
@@ -225,6 +225,7 @@
 
 	ipc_callid_t callid;
+	ipc_call_t call;
 	size_t size = 0;
-	while (async_data_write_receive(&callid, &size)) {
+	while (async_data_write_receive_call(&callid, &call, &size)) {
 		char *buffer = malloc(size);
 		if (!buffer) {
@@ -236,11 +237,13 @@
 			server_iface->stream_data_write(stream, buffer, size);
 		} else {
-			// TODO did answering fail?
 			async_answer_0(callid, ret);
 		}
 	}
-	//TODO we assume that the fail was caused by IPC_M_HOUND_STREAM_EXIT
-	async_answer_0(callid, EOK);
-	return EOK;
+	//TODO drain?
+	const int ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT
+	    ? EOK : EINVAL;
+
+	async_answer_0(callid, ret);
+	return ret;
 }
 
