]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-program-client: remote: Don't change exit_code in program_client_remote_disconnec...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 24 Jan 2018 00:09:16 +0000 (01:09 +0100)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 31 Jan 2018 12:00:02 +0000 (14:00 +0200)
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.

src/lib-program-client/program-client-remote.c

index 56707e4040d50f98674db1e820e1081dc8fbefb7..250538a665ab9a1313b8c235df66c60818a1adff 100644 (file)
@@ -544,8 +544,10 @@ void program_client_remote_disconnect(struct program_client *pclient, bool force
 
        timeout_remove(&prclient->to_retry);
 
-       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;