Files
MaxScale/include/maxscale/clock.h
Markus Mäkelä a655c5d08c MXS-619: Allow backend authentication to complete
By deferring the closing of a DCB until the protocol tells that it's in a
stable state, we avoid closing the connection mid-authentication. This
makes sure that all connections have reached a stable state before they
are closed which in turn prevents the connections from counting towards
aborted connects (or failed authentications like it did with the old fix).
2020-07-02 11:34:39 +03:00

47 lines
981 B
C

/*
* Copyright (c) 2018 MariaDB Corporation Ab
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
*
* Change Date: 2024-06-02
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2 or later of the General
* Public License.
*/
#pragma once
#include <maxscale/cdefs.h>
MXS_BEGIN_DECLS
/**
* The global clock
*
* This value is incremented roughly every 100 milliseconds and may be used for
* very crude timing. The crudeness is due to the fact that the housekeeper
* thread does the updating of this value.
*
* @return The current clock tick
*/
int64_t mxs_clock();
/**
* Convert heartbeats to seconds
*/
static inline int64_t MXS_CLOCK_TO_SEC(int64_t a)
{
return a / 10;
}
/**
* Convert seconds to heartbeats
*/
static inline int64_t MXS_SEC_TO_CLOCK(int64_t a)
{
return a * 10;
}
MXS_END_DECLS