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

Method getLocalInfo

src/remote/client/interface.cpp:1995–2066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1993
1994
1995unsigned char* Attachment::getLocalInfo(UCharBuffer& info, unsigned int buffer_length,
1996 unsigned char* buffer)
1997{
1998 const rem_port* const port = rdb->rdb_port;
1999
2000 UCHAR* ptr = buffer;
2001 const UCHAR* const end = buffer + buffer_length;
2002
2003 for (auto item = info.begin(); item < info.end(); )
2004 {
2005 if (ptr >= end)
2006 return nullptr;
2007
2008 if (*item == isc_info_end)
2009 {
2010 if (info.getCount() == 1)
2011 info.remove(item);
2012 break;
2013 }
2014
2015 FB_UINT64 value;
2016 bool skip = false;
2017
2018 switch (*item)
2019 {
2020 case fb_info_wire_snd_packets:
2021 case fb_info_wire_rcv_packets:
2022 case fb_info_wire_out_packets:
2023 case fb_info_wire_in_packets:
2024 case fb_info_wire_snd_bytes:
2025 case fb_info_wire_rcv_bytes:
2026 case fb_info_wire_out_bytes:
2027 case fb_info_wire_in_bytes:
2028 case fb_info_wire_roundtrips:
2029 value = port->getStatItem(*item);
2030 break;
2031
2032 case fb_info_max_blob_cache_size:
2033 value = rdb->rdb_blob_cache_size;
2034 break;
2035
2036 case fb_info_max_inline_blob_size:
2037 value = rdb->rdb_inline_blob_size;
2038 break;
2039
2040 default:
2041 skip = true;
2042 break;
2043 }
2044
2045 if (skip)
2046 {
2047 item++;
2048 continue;
2049 }
2050
2051 if (value <= MAX_SLONG)
2052 ptr = fb_utils::putInfoItemInt(*item, (SLONG) value, ptr, end);

Callers 1

getInfoMethod · 0.45

Calls 7

putInfoItemIntFunction · 0.85
getStatItemMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getCountMethod · 0.45
removeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected