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

Function addMultiPartConnectParameter

src/remote/remote.cpp:1071–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1069
1070template <typename T>
1071static void addMultiPartConnectParameter(const T& dataToAdd,
1072 ClumpletWriter& user_id, UCHAR param)
1073{
1074 FB_SIZE_T remaining = dataToAdd.getCount();
1075 fb_assert(remaining <= 254u * 256u); // paranoid check => 65024
1076 UCHAR part = 0;
1077 UCHAR buffer[255];
1078 typename T::const_pointer ptr = dataToAdd.begin();
1079
1080 while (remaining > 0)
1081 {
1082 FB_SIZE_T step = remaining;
1083 if (step > 254)
1084 step = 254;
1085
1086 remaining -= step;
1087 buffer[0] = part++;
1088 fb_assert(part || remaining == 0);
1089 memcpy(&buffer[1], ptr, step);
1090 ptr += step;
1091
1092 user_id.insertBytes(param, buffer, step + 1);
1093 if (!part) // we completed 256 loops, almost impossible but check anyway.
1094 break;
1095 }
1096}
1097
1098void ClntAuthBlock::extractDataFromPluginTo(ClumpletWriter& user_id)
1099{

Callers 1

Calls 3

getCountMethod · 0.45
beginMethod · 0.45
insertBytesMethod · 0.45

Tested by

no test coverage detected