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

Function checkServerUsersVersion

src/common/call_service.cpp:718–781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716}
717
718static void checkServerUsersVersion(isc_svc_handle svc_handle, char& server_users)
719{
720 if (server_users)
721 {
722 return;
723 }
724
725 // use safe old value
726 server_users = isc_action_svc_display_user;
727
728 // query service
729 ClumpletWriter spbItems(ClumpletWriter::SpbStart, 8);
730 spbItems.insertTag(isc_info_svc_server_version);
731 ISC_STATUS_ARRAY status;
732 char results[1024];
733 if (isc_service_query(status, &svc_handle, 0, 0, 0,
734 static_cast<USHORT>(spbItems.getBufferLength()),
735 reinterpret_cast<const char*>(spbItems.getBuffer()),
736 sizeof(results), results))
737 {
738 return;
739 }
740
741 // parse results
742 const char* p = results;
743 string version;
744 while (*p != isc_info_end)
745 {
746 switch (*p++)
747 {
748 case isc_info_svc_server_version:
749 {
750 USHORT length = (USHORT) isc_vax_integer(p, sizeof(USHORT));
751 p += sizeof(length);
752 version.assign(p, length);
753 p += length;
754 }
755 break;
756 default:
757 return;
758 }
759 }
760
761 // parse version
762 FB_SIZE_T pos = version.find('-');
763 if (pos == string::npos)
764 {
765 return;
766 }
767 version.erase(0, pos);
768 for (pos = 0; pos < version.length(); ++pos)
769 {
770 if (isdigit(version[pos]))
771 {
772 version.erase(0, pos);
773 double f = atof(version.c_str());
774 if (f > 2.45) // need 2.5, but take into an account it's float
775 {

Callers 1

callRemoteServiceManagerFunction · 0.85

Calls 8

insertTagMethod · 0.45
getBufferLengthMethod · 0.45
getBufferMethod · 0.45
assignMethod · 0.45
findMethod · 0.45
eraseMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected