MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / putAttachment

Method putAttachment

src/jrd/Monitoring.cpp:1046–1152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1044
1045
1046void Monitoring::putAttachment(SnapshotData::DumpRecord& record, const Jrd::Attachment* attachment)
1047{
1048 fb_assert(attachment);
1049 if (!attachment->att_user)
1050 return;
1051
1052 const auto dbb = attachment->att_database;
1053
1054 record.reset(rel_mon_attachments);
1055
1056 PathName attName(attachment->att_filename);
1057 ISC_systemToUtf8(attName);
1058
1059 // user (MUST BE ALWAYS THE FIRST ITEM PASSED!)
1060 record.storeString(f_mon_att_user, attachment->getUserName());
1061 // attachment id
1062 record.storeInteger(f_mon_att_id, attachment->att_attachment_id);
1063 // process id
1064 record.storeInteger(f_mon_att_server_pid, getpid());
1065 // state
1066 int temp = attachment->hasActiveRequests() ? mon_state_active : mon_state_idle;
1067 record.storeInteger(f_mon_att_state, temp);
1068 // attachment name
1069 record.storeString(f_mon_att_name, attName);
1070 // role
1071 record.storeString(f_mon_att_role, attachment->getSqlRole());
1072 // remote protocol
1073 record.storeString(f_mon_att_remote_proto, attachment->att_network_protocol);
1074 // remote address
1075 record.storeString(f_mon_att_remote_addr, attachment->att_remote_address);
1076 // remote process id
1077 if (attachment->att_remote_pid)
1078 record.storeInteger(f_mon_att_remote_pid, attachment->att_remote_pid);
1079 // remote process name
1080 record.storeString(f_mon_att_remote_process, attachment->att_remote_process);
1081 // remote connection flags
1082 if (attachment->att_remote_address.hasData())
1083 {
1084 record.storeBoolean(f_mon_att_wire_compressed,
1085 attachment->att_remote_flags & isc_dpb_addr_flag_conn_compressed);
1086 record.storeBoolean(f_mon_att_wire_encrypted,
1087 attachment->att_remote_flags & isc_dpb_addr_flag_conn_encrypted);
1088 }
1089 // charset
1090 record.storeInteger(f_mon_att_charset_id, attachment->att_charset);
1091 // timestamp
1092 record.storeTimestampTz(f_mon_att_timestamp, attachment->att_timestamp);
1093 // garbage collection flag
1094 temp = (attachment->att_flags & ATT_no_cleanup) ? 0 : 1;
1095 record.storeInteger(f_mon_att_gc, temp);
1096 // client library version
1097 record.storeString(f_mon_att_client_version, attachment->att_client_version);
1098 // remote protocol version
1099 record.storeString(f_mon_att_remote_version, attachment->att_remote_protocol);
1100 // wire encryption plugin
1101 record.storeString(f_mon_att_remote_crypt, attachment->att_remote_crypt);
1102 // remote host name
1103 record.storeString(f_mon_att_remote_host, attachment->att_remote_host);

Callers

nothing calls this directly

Calls 15

ISC_systemToUtf8Function · 0.85
genUniqueIdFunction · 0.85
formatFunction · 0.85
storeStringMethod · 0.80
storeIntegerMethod · 0.80
hasActiveRequestsMethod · 0.80
storeBooleanMethod · 0.80
storeTimestampTzMethod · 0.80
storeGlobalIdMethod · 0.80
getIdleTimerClockMethod · 0.80
resetMethod · 0.45
getUserNameMethod · 0.45

Tested by

no test coverage detected