commit 2fe38bc0e9ec51d5da9fd10b020a0b9f028dcbd1
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Jun 23 18:22:35 2024 +0200

    libspeechd: catch end of file
    
    In case e.g. speech dispatcher crashes, we have to make get_line error out,
    so the client can notice it and reattempt opening speech dispatcher.

diff --git a/src/api/c/libspeechd.c b/src/api/c/libspeechd.c
index da31b9b1..e50c1654 100644
--- a/src/api/c/libspeechd.c
+++ b/src/api/c/libspeechd.c
@@ -168,6 +168,10 @@ char *get_line(SPDConnection * conn, int *n)
 			 SPD_REPLY_BUF_SIZE - conn->buf_used);
 		if (bytes == -1)
 			return NULL;
+		if (bytes == 0) {
+			errno = ECONNRESET;
+			return NULL;
+		}
 		conn->buf_used += bytes;
 	}
 
