(void)json_parser_deinit(&conn->json_parser, &error);
// we've already failed, ignore error
}
+ if (conn->client.output != NULL)
+ o_stream_set_no_error_handling(conn->client.output, TRUE);
+
http_server_request_unref(&(conn->http_server_request));
http_server_switch_ioloop(doveadm_http_server);
http_server_connection_unref(&(conn->http_client));
if (!conn->client.input->eof && rc == 0)
return;
+ io_remove(&conn->client.io);
+ conn->client.io = NULL;
+
if (rc == -2 || (rc == 1 && conn->json_state != JSON_STATE_DONE)) {
/* this will happen if the parser above runs into unexpected element, but JSON is OK */
http_server_request_fail_close(conn->http_server_request, 400, "Unexpected element in input");
conn->json_parser = NULL;
- io_remove(&conn->client.io);
- conn->client.io = NULL;
- i_stream_unref(&conn->client.input);
- conn->client.input = NULL;
-
if (conn->client.output != NULL)
o_stream_nsend_str(conn->client.output,"]");
o_stream_destroy(&conn->output);
if (conn->io != NULL) {
- i_stream_destroy(&conn->input);
io_remove(&conn->io);
}
+ if (conn->input != NULL) {
+ i_stream_destroy(&conn->input);
+ }
+
if (conn->fd > 0 && close(conn->fd) < 0)
i_error("close(client) failed: %m");
pool_unref(&conn->pool);