コード例 #1
0
void notify_connection_sync_callback(bool success, void *context)
{
    struct notify_connection *conn = context;

    o_stream_nsend_str(conn->output, success ? "+\n" : "-\n");
    notify_connection_unref(conn);
}
コード例 #2
0
ファイル: notify-connection.c プロジェクト: Raffprta/core
static void notify_sync_callback(bool success, void *context)
{
	struct notify_sync_request *request = context;

	o_stream_nsend_str(request->conn->output, t_strdup_printf(
		"%c\t%u\n", success ? '+' : '-', request->id));

	notify_connection_unref(&request->conn);
	i_free(request);
}
コード例 #3
0
static void notify_connection_destroy(struct notify_connection *conn)
{
    i_assert(conn->fd != -1);

    if (!CONNECTION_IS_FIFO(conn))
        master_service_client_connection_destroyed(master_service);

    DLLIST_REMOVE(&conns, conn);

    io_remove(&conn->io);
    i_stream_close(conn->input);
    if (conn->output != NULL)
        o_stream_close(conn->output);
    net_disconnect(conn->fd);
    conn->fd = -1;

    notify_connection_unref(conn);
}
コード例 #4
0
ファイル: notify-connection.c プロジェクト: Raffprta/core
static void notify_connection_destroy(struct notify_connection *conn)
{
	if (conn->destroyed)
		return;
	conn->destroyed = TRUE;

	DLLIST_REMOVE(&connections, conn);

	io_remove(&conn->io);
	i_stream_close(conn->input);
	o_stream_close(conn->output);
	if (close(conn->fd) < 0)
		i_error("close(notify connection) failed: %m");
	conn->fd = -1;

	notify_connection_unref(&conn);
	master_service_client_connection_destroyed(master_service);
}