bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen#include "lib.h"
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen#include "dsync-mail.h"
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen#include "dsync-ibc-private.h"
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenvoid dsync_ibc_deinit(struct dsync_ibc **_ibc)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen struct dsync_ibc *ibc = *_ibc;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen *_ibc = NULL;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->v.deinit(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenvoid dsync_ibc_set_io_callback(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen io_callback_t *callback, void *context)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->io_callback = callback;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->io_context = context;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenvoid dsync_ibc_send_handshake(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_ibc_settings *set)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->v.send_handshake(ibc, set);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_recv_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_handshake(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_ibc_settings **set_r)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.recv_handshake(ibc, set_r);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenstatic enum dsync_ibc_send_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_ret(struct dsync_ibc *ibc)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.is_send_queue_full(ibc) ?
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen DSYNC_IBC_SEND_RET_FULL :
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen DSYNC_IBC_SEND_RET_OK;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret
b8e6e314eb2f9f1fc8ce2999034321bfeb7a2269Timo Sirainendsync_ibc_send_end_of_list(struct dsync_ibc *ibc, enum dsync_ibc_eol_type type)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
b8e6e314eb2f9f1fc8ce2999034321bfeb7a2269Timo Sirainen ibc->v.send_end_of_list(ibc, type);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return dsync_ibc_send_ret(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mailbox_state(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mailbox_state *state)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen T_BEGIN {
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->v.send_mailbox_state(ibc, state);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen } T_END;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return dsync_ibc_send_ret(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_recv_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mailbox_state(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen struct dsync_mailbox_state *state_r)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.recv_mailbox_state(ibc, state_r);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mailbox_tree_node(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const char *const *name,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mailbox_node *node)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen i_assert(*name != NULL);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen T_BEGIN {
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->v.send_mailbox_tree_node(ibc, name, node);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen } T_END;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return dsync_ibc_send_ret(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_recv_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mailbox_tree_node(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const char *const **name_r,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mailbox_node **node_r)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.recv_mailbox_tree_node(ibc, name_r, node_r);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mailbox_deletes(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mailbox_delete *deletes,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen unsigned int count, char hierarchy_sep)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen T_BEGIN {
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->v.send_mailbox_deletes(ibc, deletes, count,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen hierarchy_sep);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen } T_END;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return dsync_ibc_send_ret(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_recv_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mailbox_deletes(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mailbox_delete **deletes_r,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen unsigned int *count_r, char *hierarchy_sep_r)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.recv_mailbox_deletes(ibc, deletes_r, count_r,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen hierarchy_sep_r);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mailbox(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mailbox *dsync_box)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen T_BEGIN {
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->v.send_mailbox(ibc, dsync_box);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen } T_END;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return dsync_ibc_send_ret(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_recv_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mailbox(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mailbox **dsync_box_r)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.recv_mailbox(ibc, dsync_box_r);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainenenum dsync_ibc_send_ret ATTR_NOWARN_UNUSED_RESULT
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainendsync_ibc_send_mailbox_attribute(struct dsync_ibc *ibc,
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen const struct dsync_mailbox_attribute *attr)
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen{
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen T_BEGIN {
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen ibc->v.send_mailbox_attribute(ibc, attr);
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen } T_END;
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen return dsync_ibc_send_ret(ibc);
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen}
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainenenum dsync_ibc_recv_ret
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainendsync_ibc_recv_mailbox_attribute(struct dsync_ibc *ibc,
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen const struct dsync_mailbox_attribute **attr_r)
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen{
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen return ibc->v.recv_mailbox_attribute(ibc, attr_r);
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen}
55d33f807765482eb47374aaaced1fe714e0b256Timo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_change(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mail_change *change)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen i_assert(change->uid > 0);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen T_BEGIN {
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->v.send_change(ibc, change);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen } T_END;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return dsync_ibc_send_ret(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_recv_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_change(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mail_change **change_r)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.recv_change(ibc, change_r);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mail_request(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mail_request *request)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
d8bdf558c7ba173fc47a194633d9bd97af1b9c74Timo Sirainen i_assert(request->guid != NULL || request->uid != 0);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen T_BEGIN {
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->v.send_mail_request(ibc, request);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen } T_END;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return dsync_ibc_send_ret(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_recv_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mail_request(struct dsync_ibc *ibc,
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen const struct dsync_mail_request **request_r)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.recv_mail_request(ibc, request_r);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_send_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_send_mail(struct dsync_ibc *ibc, const struct dsync_mail *mail)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen i_assert(*mail->guid != '\0' || mail->uid != 0);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen T_BEGIN {
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen ibc->v.send_mail(ibc, mail);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen } T_END;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return dsync_ibc_send_ret(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenenum dsync_ibc_recv_ret
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainendsync_ibc_recv_mail(struct dsync_ibc *ibc, struct dsync_mail **mail_r)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.recv_mail(ibc, mail_r);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
ce0e25f26d6e67480ee39b5ca0ad634fa60c4605Timo Sirainenvoid dsync_ibc_send_finish(struct dsync_ibc *ibc, const char *error,
e229fe84553486b4ab37584f2a896a33384d0d70Timo Sirainen enum mail_error mail_error,
e229fe84553486b4ab37584f2a896a33384d0d70Timo Sirainen bool require_full_resync)
24bd831901b8fd59718e353b36eaef6a950f09a2Timo Sirainen{
e229fe84553486b4ab37584f2a896a33384d0d70Timo Sirainen ibc->v.send_finish(ibc, error, mail_error, require_full_resync);
24bd831901b8fd59718e353b36eaef6a950f09a2Timo Sirainen}
24bd831901b8fd59718e353b36eaef6a950f09a2Timo Sirainen
24bd831901b8fd59718e353b36eaef6a950f09a2Timo Sirainenenum dsync_ibc_recv_ret
ce0e25f26d6e67480ee39b5ca0ad634fa60c4605Timo Sirainendsync_ibc_recv_finish(struct dsync_ibc *ibc, const char **error_r,
e229fe84553486b4ab37584f2a896a33384d0d70Timo Sirainen enum mail_error *mail_error_r,
e229fe84553486b4ab37584f2a896a33384d0d70Timo Sirainen bool *require_full_resync_r)
24bd831901b8fd59718e353b36eaef6a950f09a2Timo Sirainen{
e229fe84553486b4ab37584f2a896a33384d0d70Timo Sirainen return ibc->v.recv_finish(ibc, error_r, mail_error_r,
e229fe84553486b4ab37584f2a896a33384d0d70Timo Sirainen require_full_resync_r);
24bd831901b8fd59718e353b36eaef6a950f09a2Timo Sirainen}
24bd831901b8fd59718e353b36eaef6a950f09a2Timo Sirainen
f476a2abe41082176e65425358bf01bdcc86a41cTimo Sirainenvoid dsync_ibc_close_mail_streams(struct dsync_ibc *ibc)
f476a2abe41082176e65425358bf01bdcc86a41cTimo Sirainen{
f476a2abe41082176e65425358bf01bdcc86a41cTimo Sirainen ibc->v.close_mail_streams(ibc);
f476a2abe41082176e65425358bf01bdcc86a41cTimo Sirainen}
f476a2abe41082176e65425358bf01bdcc86a41cTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenbool dsync_ibc_has_failed(struct dsync_ibc *ibc)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->failed;
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
ea245d7a9683e7bb9cd74fcdf1a26d049b2947ebTimo Sirainenbool dsync_ibc_has_timed_out(struct dsync_ibc *ibc)
ea245d7a9683e7bb9cd74fcdf1a26d049b2947ebTimo Sirainen{
ea245d7a9683e7bb9cd74fcdf1a26d049b2947ebTimo Sirainen return ibc->timeout;
ea245d7a9683e7bb9cd74fcdf1a26d049b2947ebTimo Sirainen}
ea245d7a9683e7bb9cd74fcdf1a26d049b2947ebTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenbool dsync_ibc_is_send_queue_full(struct dsync_ibc *ibc)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.is_send_queue_full(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainenbool dsync_ibc_has_pending_data(struct dsync_ibc *ibc)
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen{
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen return ibc->v.has_pending_data(ibc);
a85473f7c11c8734bdee9c2cbe4b767f144a18aaTimo Sirainen}