MCPcopy Create free account
hub / github.com/MariaDB/server / log_proxy

Function log_proxy

plugin/server_audit/server_audit.cc:1237–1261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1235}
1236
1237static int log_proxy(const struct connection_info *cn,
1238 const struct mysql_event_connection *event)
1239
1240{
1241 time_t ctime;
1242 size_t csize;
1243 char raw_message[MAX_AUDIT_PAYLOAD_LENGTH + TIMESTAMP_OUTPUT_LENGTH];
1244 char *message= raw_message + TIMESTAMP_OUTPUT_LENGTH;
1245
1246 (void) time(&ctime);
1247 csize= log_header(message, MAX_AUDIT_PAYLOAD_LENGTH - 1,
1248 servhost, servhost_len,
1249 cn->user, cn->user_length,
1250 cn->host, cn->host_length,
1251 cn->ip, cn->ip_length,
1252 event->thread_id, event->port,
1253 0, "PROXY_CONNECT");
1254 csize+= my_snprintf(message+csize, MAX_AUDIT_PAYLOAD_LENGTH - 1 - csize,
1255 ",%.*s,`%.*s`@`%.*s`,%d", cn->db_length, cn->db,
1256 cn->proxy_length, cn->proxy,
1257 cn->proxy_host_length, cn->proxy_host,
1258 event->status);
1259 message[csize]= '\n';
1260 return write_log_and_lock(message, csize + 1, ctime);
1261}
1262
1263
1264static int log_connection(const struct connection_info *cn,

Callers 1

auditingFunction · 0.85

Calls 3

log_headerFunction · 0.85
my_snprintfFunction · 0.85
write_log_and_lockFunction · 0.85

Tested by

no test coverage detected