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

Merge pull request #278 from red-soft-ru/fb4_empty_trace_config

Fixed error with calculation trace session size when session user or …
This commit is contained in:
Vlad Khorsun 2020-08-07 10:42:14 +03:00 committed by GitHub
commit c1e95605ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -695,11 +695,15 @@ void ConfigStorage::addSession(TraceSession& session)
if (session.ses_auth.hasData()) {
writer.write(tagAuthBlock, session.ses_auth.getCount(), session.ses_auth.begin());
}
writer.write(tagUserName, session.ses_user.length(), session.ses_user.c_str());
if (!session.ses_user.empty()) {
writer.write(tagUserName, session.ses_user.length(), session.ses_user.c_str());
}
if (session.ses_role.hasData()) {
writer.write(tagRole, session.ses_role.length(), session.ses_role.c_str());
}
writer.write(tagConfig, session.ses_config.length(), session.ses_config.c_str());
if (!session.ses_config.empty()) {
writer.write(tagConfig, session.ses_config.length(), session.ses_config.c_str());
}
writer.write(tagStartTS, sizeof(session.ses_start), &session.ses_start);
if (!session.ses_logfile.empty()) {
writer.write(tagLogFile, session.ses_logfile.length(), session.ses_logfile.c_str());