]> 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 11:25:17 +0000 (13:25 +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 23d0b241ed6a12d3888ac22e9c2f804b6d151ffb..aea61675c6855acaaed3f45f3c31aace8309e949 100644 (file)
@@ -309,8 +309,10 @@ void program_client_remote_disconnect(struct program_client *pclient, bool force
        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;