changeset 22784:99acd6d25ad2

lib-program-client: remote: Don't change exit_code in program_client_remote_disconnect() when program_input is already NULL. When the program_input is NULL, the stream is finished, meaning that the exit_code is set based on the return code. There can be a program_input for remote streams, even when the program produces no output.
author Stephan Bosch <stephan.bosch@dovecot.fi>
date Wed, 24 Jan 2018 01:09:16 +0100
parents 751eb2d43bc7
children bfb8e1924e75
files src/lib-program-client/program-client-remote.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-program-client/program-client-remote.c	Mon Jan 22 23:25:34 2018 +0100
+++ b/src/lib-program-client/program-client-remote.c	Wed Jan 24 01:09:16 2018 +0100
@@ -309,8 +309,10 @@
 	struct program_client_remote *prclient =
 		(struct program_client_remote *)pclient;
 
-	if (pclient->error == PROGRAM_CLIENT_ERROR_NONE && !prclient->noreply &&
-	    pclient->program_input != NULL && !force) {
+	if (pclient->program_input == NULL) {
+		/* nothing */
+	} else if (pclient->error == PROGRAM_CLIENT_ERROR_NONE &&
+		   !prclient->noreply && !force) {
 		const unsigned char *data;
 		size_t size;