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

Function typeBuffer

src/common/call_service.cpp:621–716  ·  view source on GitHub ↗

typeBuffer @brief Prints data, returned by service, using outputFunction @param status @param buf @param offset @param uData @param outputFunction @param functionArg @param text **/

Source from the content-addressed store, hash-verified

619
620 **/
621static int typeBuffer(ISC_STATUS* status, char* buf, int offset,
622 Auth::UserData& uData, Firebird::IListUsers* callback,
623 Firebird::string& text)
624{
625 const char* p = &buf[offset];
626
627 // Sanity checks
628 if (*p++ != isc_info_svc_get_users)
629 {
630 status[0] = isc_arg_gds;
631 status[1] = isc_gsec_params_not_allowed;
632 status[2] = isc_arg_end;
633 return -1;
634 }
635 FB_SIZE_T loop = static_cast<FB_SIZE_T>(isc_vax_integer (p, sizeof (USHORT)));
636 p += sizeof (USHORT);
637 if (p[loop] != isc_info_end)
638 {
639 status[0] = isc_arg_gds;
640 status[1] = isc_gsec_params_not_allowed;
641 status[2] = isc_arg_end;
642 return -1;
643 }
644
645 // No data - stop processing
646 if (! loop)
647 {
648 return -1;
649 }
650
651 // Old data left - use them
652 if (offset)
653 {
654 memmove(&buf[offset], p, loop + 1);
655 p = buf;
656 loop += offset;
657 offset = 0;
658 }
659
660 while (*p != isc_info_end)
661 {
662 fb_assert(p[loop] == isc_info_end);
663 try
664 {
665 switch (*p++)
666 {
667 case isc_spb_sec_username:
668 if (uData.user.get()[0])
669 {
670 LocalStatus status;
671 CheckStatusWrapper statusWrapper(&status);
672
673 if (callback)
674 {
675 setAttr(&statusWrapper, &uData);
676 check(&statusWrapper);
677 callback->list(&statusWrapper, &uData);
678 check(&statusWrapper);

Callers 1

callRemoteServiceManagerFunction · 0.85

Calls 8

parseString2Function · 0.85
setAttrFunction · 0.70
checkFunction · 0.70
parseLongFunction · 0.70
getMethod · 0.45
listMethod · 0.45
clearMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected