]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-program-client: remote: Don't try to read remaining input at disconnect.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Mon, 26 Feb 2018 17:21:04 +0000 (18:21 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 25 Jun 2019 09:22:31 +0000 (12:22 +0300)
This code is no longer relevant. At disconnect, there is nothing left to be read
by definition.

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

index d2acea9888588463b14636e9bd1d6efc12ce40ea..143840b79ec84957565c28fccb981daa5f78cbd1 100644 (file)
@@ -547,38 +547,14 @@ program_client_remote_close_output(struct program_client *pclient)
 }
 
 static void
-program_client_remote_disconnect(struct program_client *pclient, bool force)
+program_client_remote_disconnect(struct program_client *pclient,
+                                bool force ATTR_UNUSED)
 {
        struct program_client_remote *prclient =
                (struct program_client_remote *)pclient;
 
        timeout_remove(&prclient->to_retry);
 
-       if (pclient->raw_program_input == NULL) {
-               /* nothing */
-       } else if (pclient->error == PROGRAM_CLIENT_ERROR_NONE &&
-                  !prclient->noreply && !force) {
-               const unsigned char *data;
-               size_t size;
-
-               /* Skip any remaining program output and parse the exit code */
-               while (i_stream_read_more
-                       (pclient->raw_program_input, &data, &size) > 0) {
-                       i_stream_skip(pclient->raw_program_input, size);
-               }
-
-               /* Check for error and EOF. Since we're disconnected, always
-                  mark an internal error when not all input is read. This is
-                  generally unlikely to occur. */
-               if (pclient->raw_program_input->stream_errno != 0 ||
-                   i_stream_have_bytes_left(pclient->raw_program_input)) {
-                       pclient->exit_code =
-                               PROGRAM_CLIENT_EXIT_INTERNAL_FAILURE;
-               }
-       } else {
-               pclient->exit_code = PROGRAM_CLIENT_EXIT_SUCCESS;
-       }
-
        program_client_disconnected(pclient);
 }