8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:03:02 +01:00

Implement sub-task CORE-5913 : Add context variables with compression and encryption status of current connection

This commit is contained in:
hvlad 2018-09-18 19:47:36 +03:00
parent 548c65adf7
commit a51a1bbb21
2 changed files with 24 additions and 0 deletions

View File

@ -56,6 +56,14 @@ Usage:
NETWORK_PROTOCOL | The network protocol used by client to connect. Currently NETWORK_PROTOCOL | The network protocol used by client to connect. Currently
| used values: "TCPv4", "TCPv6", "WNET", "XNET" and NULL | used values: "TCPv4", "TCPv6", "WNET", "XNET" and NULL
| |
WIRE_COMPRESSED | Compression status of current connection.
| If connection is compressed - returns "TRUE", if it is
| not compressed - returns "FALSE".
| If connection is embedded - returns NULL.
|
WIRE_ENCRYPTED | Encryption status of current connection.
| Value is the same as for compression status above.
|
CLIENT_ADDRESS | The wire protocol address and port number of remote client CLIENT_ADDRESS | The wire protocol address and port number of remote client
| represented as string. Value is IP address concatenated with | represented as string. Value is IP address concatenated with
| port number using the '/' separator character. Value is | port number using the '/' separator character. Value is

View File

@ -283,6 +283,8 @@ const char
// SYSTEM namespace: connection wise items // SYSTEM namespace: connection wise items
SESSION_ID_NAME[] = "SESSION_ID", SESSION_ID_NAME[] = "SESSION_ID",
NETWORK_PROTOCOL_NAME[] = "NETWORK_PROTOCOL", NETWORK_PROTOCOL_NAME[] = "NETWORK_PROTOCOL",
WIRE_COMPRESSED_NAME[] = "WIRE_COMPRESSED",
WIRE_ENCRYPTED_NAME[] = "WIRE_ENCRYPTED",
CLIENT_ADDRESS_NAME[] = "CLIENT_ADDRESS", CLIENT_ADDRESS_NAME[] = "CLIENT_ADDRESS",
CLIENT_HOST_NAME[] = "CLIENT_HOST", CLIENT_HOST_NAME[] = "CLIENT_HOST",
CLIENT_PID_NAME[] = "CLIENT_PID", CLIENT_PID_NAME[] = "CLIENT_PID",
@ -2602,6 +2604,20 @@ dsc* evlGetContext(thread_db* tdbb, const SysFunction*, const NestValueArray& ar
resultStr = attachment->att_network_protocol; resultStr = attachment->att_network_protocol;
} }
else if (nameStr == WIRE_COMPRESSED_NAME)
{
if (attachment->att_network_protocol.isEmpty())
return NULL;
resultStr = (attachment->att_remote_flags & isc_dpb_addr_flag_conn_compressed) ? TRUE_VALUE : FALSE_VALUE;
}
else if (nameStr == WIRE_ENCRYPTED_NAME)
{
if (attachment->att_network_protocol.isEmpty())
return NULL;
resultStr = (attachment->att_remote_flags & isc_dpb_addr_flag_conn_encrypted) ? TRUE_VALUE : FALSE_VALUE;
}
else if (nameStr == CLIENT_ADDRESS_NAME) else if (nameStr == CLIENT_ADDRESS_NAME)
{ {
if (attachment->att_remote_address.isEmpty()) if (attachment->att_remote_address.isEmpty())