8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:43:04 +01:00

Comments.

This commit is contained in:
robocop 2009-04-16 06:52:08 +00:00
parent f0c805097e
commit 4a6dddd02e
12 changed files with 673 additions and 696 deletions

View File

@ -210,14 +210,13 @@ int FB_EXPORTED server_main( int argc, char** argv)
case 'U':
multi_threaded = false;
break;
#endif /* SUPERSERVER */
#endif // SUPERSERVER
case 'E':
if (ISC_set_prefix(p, *argv) == -1)
printf("Invalid argument Ignored\n");
else
argv++; /* do not skip next argument if this one
is invalid */
argv++; // do not skip next argument if this one is invalid
done = true;
break;
@ -292,14 +291,14 @@ int FB_EXPORTED server_main( int argc, char** argv)
// we need some writable directory for core file
// on any unix /tmp seems to be the best place
if (CHANGE_DIR(TEMP_DIR)) {
/* error on changing the directory */
// error on changing the directory
gds__log("Could not change directory to %s due to errno %d", TEMP_DIR, errno);
}
}
#endif
/* Fork off a server, wait for it to die, then fork off another,
but give up after 100 tries */
// Fork off a server, wait for it to die, then fork off another,
// but give up after 100 tries
#ifndef SUPERSERVER
if (multi_client && !debug)
@ -315,7 +314,7 @@ int FB_EXPORTED server_main( int argc, char** argv)
break;
while (wait(0) != child)
if (INET_SERVER_start) {
n = 0; /* reset error counter on "real" signal */
n = 0; // reset error counter on "real" signal
break;
}
gds__log("INET_SERVER/main: gds_inet_server restarted");
@ -335,8 +334,8 @@ int FB_EXPORTED server_main( int argc, char** argv)
// Remove restriction on username, for DEV builds
// restrict only for production builds. MOD 21-July-2002
#ifndef DEV_BUILD
Firebird::string user_name; /* holds the user name */
/* check user id */
Firebird::string user_name; // holds the user name
// check user id
ISC_get_user(&user_name, NULL, NULL, NULL);
if (user_name != "root" &&
@ -344,7 +343,7 @@ int FB_EXPORTED server_main( int argc, char** argv)
user_name != INTERBASE_USER_NAME &&
user_name != INTERBASE_USER_SHORT)
{
/* invalid user -- bail out */
// invalid user -- bail out
fprintf(stderr, "%s: Invalid user (must be %s, %s, %s or root).\n",
"fbserver", FIREBIRD_USER_NAME,
INTERBASE_USER_NAME, INTERBASE_USER_SHORT);
@ -381,18 +380,18 @@ int FB_EXPORTED server_main( int argc, char** argv)
}
#ifdef SUPERSERVER
/* before starting the superserver stuff change directory to tmp */
// before starting the superserver stuff change directory to tmp
if (CHANGE_DIR(TEMP_DIR)) {
/* error on changing the directory */
// error on changing the directory
gds__log("Could not change directory to %s due to errno %d", TEMP_DIR, errno);
}
/* Server tries to attach to security2.fdb to make sure everything is OK
This code fixes bug# 8429 + all other bug of that kind - from
now on the server exits if it cannot attach to the database
(wrong or no license, not enough memory, etc.
*/
{
// Server tries to attach to security2.fdb to make sure everything is OK
// This code fixes bug# 8429 + all other bug of that kind - from
// now on the server exits if it cannot attach to the database
// (wrong or no license, not enough memory, etc.
{ // scope
TEXT path[MAXPATHLEN];
ISC_STATUS_ARRAY status;
isc_db_handle db_handle = 0L;
@ -411,7 +410,7 @@ int FB_EXPORTED server_main( int argc, char** argv)
isc_print_status(status);
exit(STARTUP_ERROR);
}
}
} // end scope
shutdownInit();
#endif
@ -419,9 +418,8 @@ int FB_EXPORTED server_main( int argc, char** argv)
SRVR_multi_thread(port, INET_SERVER_flag);
#ifdef DEBUG_GDS_ALLOC
/* In Debug mode - this will report all server-side memory leaks
* due to remote access
*/
// In Debug mode - this will report all server-side memory leaks due to remote access
//gds_alloc_report(0, __FILE__, __LINE__);
char name[MAXPATHLEN];
gds__prefix(name, "memdebug.log");

File diff suppressed because it is too large Load Diff

View File

@ -191,7 +191,7 @@ static ISC_STATUS merge_setup(const UCHAR** in, UCHAR** out, const UCHAR* const
PUT_WORD(*out, new_length);
PUT(*out, (UCHAR) count);
/* Copy data portion of information sans original count */
// Copy data portion of information sans original count
if (--length)
{

View File

@ -53,20 +53,20 @@ char* ChopFileName(const char* szName, char* szShortName, ULONG dwLen)
*
**************************************/
/* Set pointers to the beginning and the end */
// Set pointers to the beginning and the end
const char *pchLeft, *pchEnd;
pchLeft = pchEnd = szName;
while (*pchEnd)
pchEnd++;
/* Check that the path is already short enough */
// Check that the path is already short enough
if (((ULONG) (pchEnd - pchLeft)) <= dwLen)
{
memcpy(szShortName, szName, pchEnd - pchLeft + 1);
return szShortName;
}
/* Subtract the room needed for the three dots */
// Subtract the room needed for the three dots
dwLen -= 3;
const char* pchRight = pchEnd;

View File

@ -86,7 +86,8 @@ static void FillSysdbaSPB(char*, const char*);
// which is used in the help file.
static DWORD aMenuHelpIDs1[][2] =
{
{IDC_MODRES, ibs_modify}, // This has to be the first entry because
{IDC_MODRES, ibs_modify},
// This has to be the first entry because
// we modify the value of ibs_modify to
// ibs_reset when the button text changes.
@ -204,11 +205,8 @@ LRESULT CALLBACK FirebirdPage(HWND hDlg, UINT unMsg, WPARAM wParam, LPARAM lPara
return TRUE;
}
case WM_CONTEXTMENU:
{
WinHelp((HWND) wParam, "IBSERVER.HLP",
HELP_CONTEXTMENU, (ULONG_PTR) aMenuHelpIDs1);
return TRUE;
}
WinHelp((HWND) wParam, "IBSERVER.HLP", HELP_CONTEXTMENU, (ULONG_PTR) aMenuHelpIDs1);
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
@ -251,19 +249,16 @@ LRESULT CALLBACK FirebirdPage(HWND hDlg, UINT unMsg, WPARAM wParam, LPARAM lPara
switch (((LPNMHDR) lParam)->code)
{
case PSN_KILLACTIVE: // When the page is about to lose focus
{
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE);
break;
}
case PSN_SETACTIVE: // When the page is about to recieve
{ // focus
// This modifies the bubble help table to bring up
// the appropriate help topic based on whether the text
// is "Modify..." or "Reset". It assumes that the first
// entry is the first one.
aMenuHelpIDs1[0][1] = bModifyMode ? ibs_reset : ibs_modify;
break;
}
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE);
break;
case PSN_SETACTIVE:
// When the page is about to receive focus
// This modifies the bubble help table to bring up
// the appropriate help topic based on whether the text
// is "Modify..." or "Reset". It assumes that the first
// entry is the first one.
aMenuHelpIDs1[0][1] = bModifyMode ? ibs_reset : ibs_modify;
break;
case PSN_APPLY: // When 'OK' or 'Apply Now' are clicked
if (bDirty)
if (WriteFBSettings(hDlg)) // Values written successfully
@ -316,7 +311,7 @@ BOOL ReadFBSettings(HWND hDlg)
lMapSize = 0;
BOOL bSuccess = FALSE;
// Attach to "anonymous" service
// Attach to "anonymous" service
hOldCursor = SetCursor(LoadCursor(NULL, IDC_WAIT));
char* const pchPtr = szService + strlen(szService);
strcat(szService, "anonymous");
@ -332,9 +327,9 @@ BOOL ReadFBSettings(HWND hDlg)
SetDlgItemInt(hDlg, IDC_DBPAGES, lCachePages, TRUE);
SendDlgItemMessage(hDlg, IDC_MAPSIZE, CB_RESETCONTENT, 0, 0);
/* To eliminate the flicker while closing the Property Sheet */
// To eliminate the flicker while closing the Property Sheet
SetWindowPos(GetParent(hDlg), HWND_DESKTOP, 0, 0, 0, 0, SWP_HIDEWINDOW);
/* Close the Property Sheet */
// Close the Property Sheet
SendMessage(GetParent(hDlg), WM_CLOSE, 0, 0);
return bSuccess;
@ -354,10 +349,10 @@ BOOL ReadFBSettings(HWND hDlg)
bSuccess = TRUE;
}
// Empty the Map Size Combo Box
// Empty the Map Size Combo Box
SendDlgItemMessage(hDlg, IDC_MAPSIZE, CB_RESETCONTENT, 0, 0);
// Fill the Map Size Combo Box
// Fill the Map Size Combo Box
{
char szTmp[8];
int temp = 1024;
@ -378,16 +373,16 @@ BOOL ReadFBSettings(HWND hDlg)
SendDlgItemMessage(hDlg, IDC_MAPSIZE, CB_SELECTSTRING, 0, (LPARAM) pchTmp);
}
// Display the proper cache size
// Display the proper cache size
SetDlgItemInt(hDlg, IDC_DBPAGES, lCachePages, TRUE);
SetCursor(hOldCursor);
isc_service_detach(pdwStatus, &hService);
if (!bSuccess) {
/* To eliminate the flicker while closing the Property Sheet */
// To eliminate the flicker while closing the Property Sheet
SetWindowPos(GetParent(hDlg), HWND_DESKTOP, 0, 0, 0, 0, SWP_HIDEWINDOW);
/* Close the Property Sheet */
// Close the Property Sheet
SendMessage(GetParent(hDlg), WM_CLOSE, 0, 0);
}
@ -419,9 +414,9 @@ void RefreshIBControls(HWND hDlg, BOOL bEnable)
SendDlgItemMessage(hDlg, IDC_MODRES, WM_SETTEXT, 0, (LPARAM) szButtonName);
// This modifies the bubble help table to bring up the appropriate help
// topic based on whether the text is "Modify..." or "Reset". It assumes
// that the first entry is the first one.
// This modifies the bubble help table to bring up the appropriate help
// topic based on whether the text is "Modify..." or "Reset". It assumes
// that the first entry is the first one.
aMenuHelpIDs1[0][1] = bEnable ? ibs_reset : ibs_modify;
}
@ -463,7 +458,7 @@ BOOL WriteFBSettings(HWND hDlg)
char szSpb[SPB_BUFLEN]; // Server parameter block
FillSysdbaSPB(szSpb, szSysDbaPasswd);
// Build the complete name to the service
// Build the complete name to the service
hOldCursor = SetCursor(LoadCursor(NULL, IDC_WAIT));
char* pchPtr = szService + strlen(szService);
strcat(szService, "query_server");
@ -480,23 +475,23 @@ BOOL WriteFBSettings(HWND hDlg)
SetCursor(hOldCursor);
PrintCfgStatus(pdwStatus, IDS_CFGATTACH_FAILED, hDlg);
/* To eliminate the flicker while closing the Property Sheet */
// To eliminate the flicker while closing the Property Sheet
SetWindowPos(GetParent(hDlg), HWND_DESKTOP, 0, 0, 0, 0, SWP_HIDEWINDOW);
/* Close the Property Sheet */
// Close the Property Sheet
SendMessage(GetParent(hDlg), WM_CLOSE, 0, 0);
return FALSE;
}
// Fill in the Send buffer's header
// Fill in the Send buffer's header
char pchSendBuf[SEND_BUFLEN];
pchPtr = pchSendBuf;
*pchPtr++ = isc_info_svc_set_config;
short* psLen = (short *) pchPtr;
pchPtr += sizeof(USHORT);
// Fill in all the records
/*
// Fill in all the records
/*
*pchPtr++ = ISCCFG_IPCMAP_KEY;
*pchPtr++ = sizeof(long);
*(ULONG *) pchPtr = isc_vax_integer((SCHAR *) & lMapSize, sizeof(long));
@ -507,10 +502,10 @@ BOOL WriteFBSettings(HWND hDlg)
*(ULONG *) pchPtr =
isc_vax_integer((SCHAR *) & lCachePages, sizeof(long));
pchPtr += sizeof(long);
*/
*/
*psLen = pchPtr - pchSendBuf - sizeof(short) - sizeof(char);
*psLen = (short) isc_vax_integer((SCHAR *) psLen, sizeof(short));
// Query service with set_config
// Query service with set_config
char szResBuf[16]; // Response buffer
isc_service_query(pdwStatus, &hService, NULL, 0, NULL,
@ -520,9 +515,9 @@ BOOL WriteFBSettings(HWND hDlg)
{
PrintCfgStatus(pdwStatus[1] ? pdwStatus : NULL, IDS_CFGWRITE_FAILED, hDlg);
/* To eliminate the flicker while closing the Property Sheet */
// To eliminate the flicker while closing the Property Sheet
SetWindowPos(GetParent(hDlg), HWND_DESKTOP, 0, 0, 0, 0, SWP_HIDEWINDOW);
/* Close the Property Sheet */
// Close the Property Sheet
SendMessage(GetParent(hDlg), WM_CLOSE, 0, 0);
bRetFlag = FALSE;
@ -755,13 +750,13 @@ void HelpCmd( HWND hWnd, HINSTANCE hInst, WPARAM wId)
GetModuleFileName(hInst, szPathFileName, sizeof(szPathFileName));
/* Show hour glass cursor */
// Show hour glass cursor
HCURSOR hOldCursor = SetCursor(LoadCursor(NULL, IDC_WAIT));
strcpy(strrchr(szPathFileName, '\\') + 1, SERVER_HELP_FILE);
WinHelp(hWnd, szPathFileName, HELP_CONTEXT, wId);
/* Restore old cursor */
// Restore old cursor
SetCursor(hOldCursor);
return;

View File

@ -34,7 +34,7 @@
#include <prsht.h>
#include <dbt.h>
/* Since it's a Win32-only file, we might as well assert it*/
// Since it's a Win32-only file, we might as well assert it
#if !defined(WIN_NT)
#error This is a Win32 only file.
#endif
@ -57,9 +57,9 @@
#include "../remote/os/win32/ibsvrhlp.h"
#include "../remote/os/win32/chop_proto.h"
#include "../common/thd.h" /* get jrd_proto.h to declare the function */
#include "../jrd/jrd_proto.h" /* JRD_num_attachments() */
#include <stdio.h> /* sprintf() */
#include "../common/thd.h" // get jrd_proto.h to declare the function
#include "../jrd/jrd_proto.h" // JRD_num_attachments()
#include <stdio.h> // sprintf()
static HINSTANCE hInstance = NULL; // Handle to the current app. instance
static HWND hPSDlg = NULL; // Handle to the parent prop. sheet window
@ -135,8 +135,8 @@ HWND DisplayProperties(HWND hParentWnd, HINSTANCE hInst, USHORT usServerFlagMask
PSHdr.ppsp = (LPCPROPSHEETPAGE) & PSPages;
PSHdr.pfnCallback = NULL;
// Initialize the gray brush to paint the background
// for all prop. sheet pages and their controls
// Initialize the gray brush to paint the background
// for all prop. sheet pages and their controls
hGrayBrush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
hPSDlg = (HWND) PropertySheet(&PSHdr);
@ -198,7 +198,7 @@ LRESULT CALLBACK GeneralPage(HWND hDlg, UINT unMsg, WPARAM wParam, LPARAM lParam
GetModuleFileName(hInstance, szWindowText, sizeof(szWindowText));
char* pszPtr = strrchr(szWindowText, '\\');
*(pszPtr + 1) = 0x00;
pszPtr[1] = 0x00;
ChopFileName(szWindowText, szWindowText, 38);
SetDlgItemText(hDlg, IDC_PATH, szWindowText);
@ -234,10 +234,7 @@ LRESULT CALLBACK GeneralPage(HWND hDlg, UINT unMsg, WPARAM wParam, LPARAM lParam
}
return TRUE;
case WM_CONTEXTMENU:
{
WinHelp((HWND) wParam, "IBSERVER.HLP",
HELP_CONTEXTMENU, (ULONG_PTR) aMenuHelpIDs);
}
WinHelp((HWND) wParam, "IBSERVER.HLP", HELP_CONTEXTMENU, (ULONG_PTR) aMenuHelpIDs);
return TRUE;
case WM_COMMAND:
switch (wParam)

View File

@ -311,9 +311,9 @@ int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE hPrevInst, LPSTR lpszArgs, int
}
#ifdef DEBUG_GDS_ALLOC
/* In Debug mode - this will report all server-side memory leaks
* due to remote access
*/
// In Debug mode - this will report all server-side memory leaks
// due to remote access
//gds_alloc_report(0, __FILE__, __LINE__);
char name[MAXPATHLEN];
gds__prefix(name, "memdebug.log");
@ -693,9 +693,9 @@ static HANDLE parse_args(LPCSTR lpszArgs, USHORT* pserver_flag)
exit(FINI_OK);
default:
/* In case of something unrecognized, just
* continue, since we have already taken it off
* of p. */
// In case of something unrecognized, just
// continue, since we have already taken it off
// of p.
break;
}
}

View File

@ -92,7 +92,7 @@ int WINDOW_main( HINSTANCE hThisInst, int nWndMode, USHORT usServerFlagMask)
fb_shutdown_callback(0, fb_shutdown_cb, fb_shut_postproviders, 0);
/* initialize main window */
// initialize main window
WNDCLASS wcl;
wcl.hInstance = hInstance;
@ -127,8 +127,8 @@ int WINDOW_main( HINSTANCE hThisInst, int nWndMode, USHORT usServerFlagMask)
APP_HSIZE,
APP_VSIZE, HWND_DESKTOP, NULL, hInstance, NULL);
// Do the proper ShowWindow depending on if the app is an icon on
// the desktop, or in the task bar.
// Do the proper ShowWindow depending on if the app is an icon on
// the desktop, or in the task bar.
SendMessage(hWnd, WM_COMMAND, IDM_CANCEL, 0);
UpdateWindow(hWnd);
@ -192,11 +192,11 @@ LRESULT CALLBACK WindowFunc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
switch (message)
{
case WM_QUERYENDSESSION:
/* If we are running as a non-service server, then query the user
* to determine if we should end the session. Otherwise, assume that
* the server is a service and could be servicing remote clients and
* therefore should not be shut down.
*/
// If we are running as a non-service server, then query the user
// to determine if we should end the session. Otherwise, assume that
// the server is a service and could be servicing remote clients and
// therefore should not be shut down.
if (usServerFlags & SRVR_non_service) {
return CanEndServer(hWnd, true);
}
@ -242,8 +242,8 @@ LRESULT CALLBACK WindowFunc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
// The SetForegroundWindow() has to be called because our window
// does not become the Foreground one (inspite of clicking on
//the icon). This is so because the icon is painted on the task
//bar and is not the same as a minimized window.
// the icon). This is so because the icon is painted on the task
// bar and is not the same as a minimized window.
SetForegroundWindow(hWnd);
HMENU hPopup = CreatePopupMenu();
@ -274,8 +274,8 @@ LRESULT CALLBACK WindowFunc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
case IDM_GUARDED:
{
/* Since we are going to be guarded, we do not need to
* show the server icon. The guardian will show its own. */
// Since we are going to be guarded, we do not need to
// show the server icon. The guardian will show its own.
NOTIFYICONDATA nid;
nid.cbSize = sizeof(NOTIFYICONDATA);
nid.hWnd = hWnd;
@ -524,7 +524,7 @@ BOOL CanEndServer(HWND hWnd, bool bSysExit)
char szMsgString[MSG_STRINGLEN];
sprintf(szMsgString, "%u ", usNumAtt);
if (!usNumAtt) /* IF 0 CONNECTIONS, JUST SHUTDOWN */
if (!usNumAtt) // IF 0 CONNECTIONS, JUST SHUTDOWN
return TRUE;
LoadString(hInstance, IDS_QUIT, szMsgString + strlen(szMsgString),

View File

@ -22,7 +22,7 @@
*/
#ifdef DEBUG
/* define WNET_trace to 0 (zero) for no packet debugging */
// define WNET_trace to 0 (zero) for no packet debugging
#define WNET_trace
#endif
@ -74,29 +74,29 @@ static void exit_handler(void*);
#endif
static void force_close(rem_port*);
static rem_str* make_pipe_name(const TEXT*, const TEXT*, const TEXT*);
static rem_port* receive(rem_port*, PACKET *);
static int send_full(rem_port*, PACKET *);
static int send_partial(rem_port*, PACKET *);
static int xdrwnet_create(XDR *, rem_port*, UCHAR *, USHORT, xdr_op);
static bool_t xdrwnet_endofrecord(XDR *, int);
static int wnet_destroy(XDR *);
static rem_port* receive(rem_port*, PACKET*);
static int send_full(rem_port*, PACKET*);
static int send_partial(rem_port*, PACKET*);
static int xdrwnet_create(XDR*, rem_port*, UCHAR*, USHORT, xdr_op);
static bool_t xdrwnet_endofrecord(XDR*, int);
static int wnet_destroy(XDR*);
static bool wnet_error(rem_port*, const TEXT*, ISC_STATUS, int);
static void wnet_gen_error(rem_port*, const Firebird::Arg::StatusVector& v);
static bool_t wnet_getbytes(XDR *, SCHAR *, u_int);
static bool_t wnet_getlong(XDR *, SLONG *);
static u_int wnet_getpostn(XDR *);
static caddr_t wnet_inline(XDR *, u_int);
static bool_t wnet_putlong(XDR *, const SLONG*);
static bool_t wnet_getbytes(XDR*, SCHAR*, u_int);
static bool_t wnet_getlong(XDR*, SLONG*);
static u_int wnet_getpostn(XDR*);
static caddr_t wnet_inline(XDR*, u_int);
static bool_t wnet_putlong(XDR*, const SLONG*);
static bool_t wnet_putbytes(XDR*, const SCHAR*, u_int);
static bool_t wnet_read(XDR *);
static bool_t wnet_setpostn(XDR *, u_int);
static bool_t wnet_write(XDR *, int);
static bool_t wnet_read(XDR*);
static bool_t wnet_setpostn(XDR*, u_int);
static bool_t wnet_write(XDR*, int);
#ifdef DEBUG
static void packet_print(const TEXT*, const UCHAR*, const int);
#endif
static bool packet_receive(rem_port*, UCHAR *, SSHORT, SSHORT *);
static bool packet_receive(rem_port*, UCHAR*, SSHORT, SSHORT*);
static bool packet_send(rem_port*, const SCHAR*, SSHORT);
static void wnet_make_file_name(TEXT *, DWORD);
static void wnet_make_file_name(TEXT*, DWORD);
static int cleanup_ports(const int, const int, void*);
@ -134,13 +134,13 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
*
**************************************/
/* We need to establish a connection to a remote server. Allocate the necessary
blocks and get ready to go. */
// We need to establish a connection to a remote server. Allocate the necessary
// blocks and get ready to go.
Rdb* rdb = new Rdb;
PACKET* packet = &rdb->rdb_packet;
/* Pick up some user identification information */
// Pick up some user identification information
Firebird::string buffer;
Firebird::ClumpletWriter user_id(Firebird::ClumpletReader::UnTagged, MAX_DPB_SIZE);
@ -156,7 +156,7 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
user_id.insertTag(CNCT_user_verification);
}
/* Establish connection to server */
// Establish connection to server
P_CNCT* const cnct = &packet->p_cnct;
packet->p_operation = op_connect;
@ -166,11 +166,11 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
cnct->p_cnct_file.cstr_length = file_name.length();
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
/* Note: prior to V3.1E a receivers could not in truth handle more
then 5 protocol descriptions; however, this restriction does not
apply to Windows since it was created in 4.0 */
// Note: prior to V3.1E a receivers could not in truth handle more
// then 5 protocol descriptions; however, this restriction does not
// apply to Windows since it was created in 4.0
/* If we want user verification, we can't speak anything less than version 7 */
// If we want user verification, we can't speak anything less than version 7
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
@ -192,7 +192,7 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
cnct->p_cnct_versions[i] = protocols_to_try1[i];
}
/* If we can't talk to a server, punt. Let somebody else generate an error. */
// If we can't talk to a server, punt. Let somebody else generate an error.
rem_port* port = WNET_connect(node_name, packet, status_vector, 0);
if (!port) {
@ -200,7 +200,7 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
return NULL;
}
/* Get response packet from server. */
// Get response packet from server.
rdb->rdb_port = port;
port->port_context = rdb;
@ -216,7 +216,7 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
cnct->p_cnct_file.cstr_length = file_name.length();
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
/* try again with next set of known protocols */
// try again with next set of known protocols
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
@ -238,7 +238,7 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
return NULL;
}
/* Get response packet from server. */
// Get response packet from server.
rdb->rdb_port = port;
port->port_context = rdb;
@ -255,7 +255,7 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
cnct->p_cnct_file.cstr_length = file_name.length();
cnct->p_cnct_file.cstr_address = reinterpret_cast<const UCHAR*>(file_name.c_str());
/* try again with next set of known protocols */
// try again with next set of known protocols
cnct->p_cnct_user_id.cstr_length = user_id.getBufferLength();
cnct->p_cnct_user_id.cstr_address = user_id.getBuffer();
@ -276,7 +276,7 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
return NULL;
}
/* Get response packet from server. */
// Get response packet from server.
rdb->rdb_port = port;
port->port_context = rdb;
@ -294,8 +294,8 @@ rem_port* WNET_analyze(const Firebird::PathName& file_name,
port->port_protocol = packet->p_acpt.p_acpt_version;
/* once we've decided on a protocol, concatenate the version
string to reflect it... */
// once we've decided on a protocol, concatenate the version
// string to reflect it...
Firebird::string temp;
temp.printf("%s/P%d", port->port_version->str_data,
@ -342,7 +342,7 @@ rem_port* WNET_connect(const TEXT* name,
delete port->port_connection;
port->port_connection = make_pipe_name(name, SERVER_PIPE_SUFFIX, 0);
/* If we're a host, just make the connection */
// If we're a host, just make the connection
if (packet)
{
@ -366,7 +366,7 @@ rem_port* WNET_connect(const TEXT* name,
return port;
}
/* We're a server, so wait for a host to show up */
// We're a server, so wait for a host to show up
LPSECURITY_ATTRIBUTES security_attr = ISC_get_security_desc();
@ -489,7 +489,7 @@ rem_port* WNET_reconnect(HANDLE handle, ISC_STATUS* status_vector)
}
rem_port* WNET_server(void *handle)
rem_port* WNET_server(void* handle)
{
/**************************************
*
@ -524,11 +524,11 @@ static bool accept_connection( rem_port* port, const P_CNCT* cnct)
* response for protocol selection.
*
**************************************/
/* Default account to "guest" (in theory all packets contain a name) */
// Default account to "guest" (in theory all packets contain a name)
Firebird::string name("guest"), password;
/* Pick up account and password, if given. The password is ignored */
// Pick up account and password, if given. The password is ignored
Firebird::ClumpletReader id(Firebird::ClumpletReader::UnTagged,
cnct->p_cnct_user_id.cstr_address, cnct->p_cnct_user_id.cstr_length);
@ -617,7 +617,6 @@ static rem_port* alloc_port( rem_port* parent)
}
// Third param "ast" is unused.
static rem_port* aux_connect( rem_port* port, PACKET* packet)
{
/**************************************
@ -631,7 +630,7 @@ static rem_port* aux_connect( rem_port* port, PACKET* packet)
* done a successfull connect request ("packet" contains the response).
*
**************************************/
/* If this is a server, we're got an auxiliary connection. Accept it */
// If this is a server, we're got an auxiliary connection. Accept it
if (port->port_server_flags) {
if (!connect_client(port))
@ -641,9 +640,8 @@ static rem_port* aux_connect( rem_port* port, PACKET* packet)
return port;
}
/* The server will be sending its process id in the packet to
* create a unique pipe name.
*/
// The server will be sending its process id in the packet to
// create a unique pipe name.
P_RESP* response = &packet->p_resp;
@ -794,7 +792,7 @@ static void disconnect(rem_port* port)
*
**************************************/
/* If this is a sub-port, unlink it from it's parent */
// If this is a sub-port, unlink it from it's parent
rem_port* const parent = port->port_parent;
if (parent)
@ -944,7 +942,7 @@ static rem_str* make_pipe_name(const TEXT* connect_name, const TEXT* suffix_name
}
static rem_port* receive( rem_port* main_port, PACKET * packet)
static rem_port* receive( rem_port* main_port, PACKET* packet)
{
/**************************************
*
@ -966,7 +964,7 @@ static rem_port* receive( rem_port* main_port, PACKET * packet)
}
static int send_full( rem_port* port, PACKET * packet)
static int send_full( rem_port* port, PACKET* packet)
{
/**************************************
*
@ -986,7 +984,7 @@ static int send_full( rem_port* port, PACKET * packet)
}
static int send_partial( rem_port* port, PACKET * packet)
static int send_partial( rem_port* port, PACKET* packet)
{
/**************************************
*
@ -1028,7 +1026,7 @@ static int xdrwnet_create(XDR* xdrs,
}
static bool_t xdrwnet_endofrecord( XDR * xdrs, bool_t flushnow)
static bool_t xdrwnet_endofrecord( XDR* xdrs, bool_t flushnow)
{
/**************************************
*
@ -1045,7 +1043,7 @@ static bool_t xdrwnet_endofrecord( XDR * xdrs, bool_t flushnow)
}
static int wnet_destroy( XDR * xdrs)
static int wnet_destroy( XDR* xdrs)
{
/**************************************
*
@ -1128,7 +1126,7 @@ static void wnet_gen_error (rem_port* port, const Firebird::Arg::StatusVector& v
}
static bool_t wnet_getbytes( XDR * xdrs, SCHAR * buff, u_int count)
static bool_t wnet_getbytes( XDR* xdrs, SCHAR* buff, u_int count)
{
/**************************************
*
@ -1142,7 +1140,7 @@ static bool_t wnet_getbytes( XDR * xdrs, SCHAR * buff, u_int count)
**************************************/
SLONG bytecount = count;
/* Use memcpy to optimize bulk transfers. */
// Use memcpy to optimize bulk transfers.
while (bytecount > (SLONG) sizeof(ISC_QUAD))
{
@ -1163,8 +1161,8 @@ static bool_t wnet_getbytes( XDR * xdrs, SCHAR * buff, u_int count)
return FALSE;
}
/* Scalar values and bulk transfer remainder fall thru
to be moved byte-by-byte to avoid memcpy setup costs. */
// Scalar values and bulk transfer remainder fall thru
// to be moved byte-by-byte to avoid memcpy setup costs.
if (!bytecount)
return TRUE;
@ -1188,7 +1186,7 @@ static bool_t wnet_getbytes( XDR * xdrs, SCHAR * buff, u_int count)
}
static bool_t wnet_getlong( XDR * xdrs, SLONG * lp)
static bool_t wnet_getlong( XDR* xdrs, SLONG* lp)
{
/**************************************
*
@ -1211,7 +1209,7 @@ static bool_t wnet_getlong( XDR * xdrs, SLONG * lp)
}
static u_int wnet_getpostn( XDR * xdrs)
static u_int wnet_getpostn( XDR* xdrs)
{
/**************************************
*
@ -1228,7 +1226,7 @@ static u_int wnet_getpostn( XDR * xdrs)
}
static caddr_t wnet_inline( XDR * xdrs, u_int bytecount)
static caddr_t wnet_inline( XDR* xdrs, u_int bytecount)
{
/**************************************
*
@ -1262,7 +1260,7 @@ static bool_t wnet_putbytes( XDR* xdrs, const SCHAR* buff, u_int count)
**************************************/
SLONG bytecount = count;
/* Use memcpy to optimize bulk transfers. */
// Use memcpy to optimize bulk transfers.
while (bytecount > (SLONG) sizeof(ISC_QUAD))
{
@ -1283,8 +1281,8 @@ static bool_t wnet_putbytes( XDR* xdrs, const SCHAR* buff, u_int count)
return FALSE;
}
/* Scalar values and bulk transfer remainder fall thru
to be moved byte-by-byte to avoid memcpy setup costs. */
// Scalar values and bulk transfer remainder fall thru
// to be moved byte-by-byte to avoid memcpy setup costs.
if (!bytecount)
return TRUE;
@ -1308,7 +1306,7 @@ static bool_t wnet_putbytes( XDR* xdrs, const SCHAR* buff, u_int count)
}
static bool_t wnet_putlong( XDR * xdrs, const SLONG* lp)
static bool_t wnet_putlong( XDR* xdrs, const SLONG* lp)
{
/**************************************
*
@ -1325,7 +1323,7 @@ static bool_t wnet_putlong( XDR * xdrs, const SLONG* lp)
}
static bool_t wnet_read( XDR * xdrs)
static bool_t wnet_read( XDR* xdrs)
{
/**************************************
*
@ -1344,7 +1342,7 @@ static bool_t wnet_read( XDR * xdrs)
SCHAR* p = xdrs->x_base;
const SCHAR* const end = p + BUFFER_SIZE;
/* If buffer is not completely empty, slide down what what's left */
// If buffer is not completely empty, slide down what what's left
if (xdrs->x_handy > 0) {
memmove(p, xdrs->x_private, xdrs->x_handy);
@ -1374,7 +1372,7 @@ static bool_t wnet_read( XDR * xdrs)
}
static bool_t wnet_setpostn( XDR * xdrs, u_int bytecount)
static bool_t wnet_setpostn( XDR* xdrs, u_int bytecount)
{
/**************************************
*
@ -1396,7 +1394,7 @@ static bool_t wnet_setpostn( XDR * xdrs, u_int bytecount)
}
static bool_t wnet_write( XDR * xdrs, bool_t end_flag)
static bool_t wnet_write( XDR* xdrs, bool_t end_flag)
{
/**************************************
*
@ -1410,14 +1408,14 @@ static bool_t wnet_write( XDR * xdrs, bool_t end_flag)
* load.
*
**************************************/
/* Encode the data portion of the packet */
// Encode the data portion of the packet
rem_port* vport = (rem_port*) xdrs->x_public;
const SCHAR* p = xdrs->x_base;
SSHORT length = xdrs->x_private - p;
/* Send data in manageable hunks. If a packet is partial, indicate
that with a negative length. A positive length marks the end. */
// Send data in manageable hunks. If a packet is partial, indicate
// that with a negative length. A positive length marks the end.
while (length) {
const SSHORT l = MIN(length, MAX_DATA);

View File

@ -32,7 +32,7 @@
#include "../remote/parse_proto.h"
#if !defined(DEV_BUILD) || (defined(DEV_BUILD) && defined(WIN_NT))
#include "../jrd/gds_proto.h" /* gds__log() */
#include "../jrd/gds_proto.h" // gds__log()
#endif
@ -100,7 +100,7 @@ RMessage* PARSE_messages(const UCHAR* blr, USHORT blr_length)
align = type_alignments[dtype_cstring];
break;
/* Parse the tagged blr types correctly */
// Parse the tagged blr types correctly
case blr_text2:
desc->dsc_dtype = dtype_text;
@ -282,18 +282,18 @@ const UCHAR* PARSE_prepare_messages(const UCHAR* blr, USHORT blr_length)
case blr_text2:
case blr_varying2:
case blr_cstring2:
blr += 4; /* SUBTYPE word & LENGTH word */
blr += 4; // SUBTYPE word & LENGTH word
break;
case blr_text:
case blr_varying:
case blr_cstring:
blr += 2; /* LENGTH word */
blr += 2; // LENGTH word
break;
case blr_short:
case blr_long:
case blr_int64:
case blr_quad:
blr++; /* SCALE byte */
blr++; // SCALE byte
break;
case blr_float:
case blr_double:
@ -306,7 +306,7 @@ const UCHAR* PARSE_prepare_messages(const UCHAR* blr, USHORT blr_length)
if (new_blr == old_blr)
{
new_blr = FB_NEW(*getDefaultMemoryPool()) UCHAR[blr_length];
/* FREE: Never freed, blr_d_float is VMS specific */
// FREE: Never freed, blr_d_float is VMS specific
#ifdef DEBUG_REMOTE_MEMORY
printf("PARSE_prepare_messages allocate blr %x\n", new_blr);
#endif
@ -323,7 +323,7 @@ const UCHAR* PARSE_prepare_messages(const UCHAR* blr, USHORT blr_length)
default:
DEV_REPORT("Unexpected BLR in PARSE_prepare_messages()");
/* This old code would return, so we will also */
// This old code would return, so we will also
return new_blr;
}
}

View File

@ -79,7 +79,7 @@ inline void DEBUG_XDR_ALLOC(XDR* xdrs, const void* xdrvar, const void* addr, ULO
inline void DEBUG_XDR_FREE(XDR* xdrs, const void* xdrvar, const void* addr, ULONG len)
{
}
#endif /* DEBUG_XDR_MEMORY */
#endif // DEBUG_XDR_MEMORY
#define MAP(routine, ptr) if (!routine (xdrs, &ptr)) return P_FALSE(xdrs, p);
const ULONG MAX_OPAQUE = 32768;
@ -90,25 +90,25 @@ enum SQL_STMT_TYPE
TYPE_PREPARED
};
static bool alloc_cstring(XDR *, CSTRING *);
static void free_cstring(XDR *, CSTRING *);
static Rsr* get_statement(XDR *, SSHORT);
static bool alloc_cstring(XDR*, CSTRING*);
static void free_cstring(XDR*, CSTRING*);
static Rsr* get_statement(XDR*, SSHORT);
static bool_t xdr_cstring(XDR*, CSTRING*);
static inline bool_t xdr_cstring_const(XDR*, CSTRING_CONST*);
static bool_t xdr_datum(XDR *, const DSC*, BLOB_PTR *);
static bool_t xdr_datum(XDR*, const DSC*, BLOB_PTR*);
#ifdef DEBUG_XDR_MEMORY
static bool_t xdr_debug_packet(XDR *, enum xdr_op, PACKET *);
static bool_t xdr_debug_packet(XDR*, enum xdr_op, PACKET*);
#endif
static bool_t xdr_longs(XDR *, CSTRING *);
static bool_t xdr_message(XDR *, RMessage*, const rem_fmt*);
static bool_t xdr_quad(XDR *, struct bid *);
static bool_t xdr_request(XDR *, USHORT, USHORT, USHORT);
static bool_t xdr_longs(XDR*, CSTRING*);
static bool_t xdr_message(XDR*, RMessage*, const rem_fmt*);
static bool_t xdr_quad(XDR*, struct bid*);
static bool_t xdr_request(XDR*, USHORT, USHORT, USHORT);
static bool_t xdr_slice(XDR*, lstring*, USHORT, const UCHAR*);
static bool_t xdr_status_vector(XDR *, ISC_STATUS *, TEXT * strings[]);
static bool_t xdr_status_vector(XDR*, ISC_STATUS*, TEXT * strings[]);
static bool_t xdr_sql_blr(XDR*, SLONG, CSTRING*, bool, SQL_STMT_TYPE);
static bool_t xdr_sql_message(XDR *, SLONG);
static bool_t xdr_sql_message(XDR*, SLONG);
static bool_t xdr_trrq_blr(XDR*, CSTRING*);
static bool_t xdr_trrq_message(XDR *, USHORT);
static bool_t xdr_trrq_message(XDR*, USHORT);
#ifdef NOT_USED_OR_REPLACED
// TMN: Patched away this for now, it should probably be removed.
@ -194,12 +194,12 @@ void xdr_debug_memory(XDR* xdrs,
fb_assert(port != 0);
fb_assert(port->port_header.blk_type == type_port);
/* Compare the XDR variable address with the lower and upper bounds
of each packet to determine which packet contains it. Record or
delete an entry in that packet's memory allocation table. */
// Compare the XDR variable address with the lower and upper bounds
// of each packet to determine which packet contains it. Record or
// delete an entry in that packet's memory allocation table.
rem_vec* vector = port->port_packet_vector;
if (!vector) /* Not tracking port's protocol */
if (!vector) // Not tracking port's protocol
return;
ULONG i;
@ -210,43 +210,43 @@ void xdr_debug_memory(XDR* xdrs,
{
fb_assert(packet->p_operation > op_void && packet->p_operation < op_max);
if ((SCHAR*) xdrvar >= (SCHAR *) packet &&
(SCHAR*) xdrvar < (SCHAR *) packet + sizeof(PACKET))
if ((SCHAR*) xdrvar >= (SCHAR*) packet &&
(SCHAR*) xdrvar < (SCHAR*) packet + sizeof(PACKET))
{
ULONG j;
for (j = 0; j < P_MALLOC_SIZE; j++)
{
if (xop == XDR_FREE)
{
if ((SCHAR *) packet->p_malloc[j].p_address == (SCHAR *) address)
if ((SCHAR*) packet->p_malloc[j].p_address == (SCHAR*) address)
{
packet->p_malloc[j].p_operation = op_void;
packet->p_malloc[j].p_allocated = NULL;
packet->p_malloc[j].p_address = 0;
/* packet->p_malloc [j].p_xdrvar = 0; */
// packet->p_malloc [j].p_xdrvar = 0;
return;
}
}
else { /* XDR_ENCODE or XDR_DECODE */
else { // XDR_ENCODE or XDR_DECODE
fb_assert(xop == XDR_ENCODE || xop == XDR_DECODE);
if (packet->p_malloc[j].p_operation == op_void) {
packet->p_malloc[j].p_operation = packet->p_operation;
packet->p_malloc[j].p_allocated = length;
packet->p_malloc[j].p_address = address;
/* packet->p_malloc [j].p_xdrvar = xdrvar; */
// packet->p_malloc [j].p_xdrvar = xdrvar;
return;
}
}
}
/* Assertion failure if not enough entries to record every xdr
memory allocation or an entry to be freed can't be found. */
// Assertion failure if not enough entries to record every xdr
// memory allocation or an entry to be freed can't be found.
fb_assert(j < P_MALLOC_SIZE); /* Increase P_MALLOC_SIZE if necessary */
fb_assert(j < P_MALLOC_SIZE); // Increase P_MALLOC_SIZE if necessary
}
}
}
fb_assert(i < vector->vec_count); /* Couldn't find packet for this xdr arg */
fb_assert(i < vector->vec_count); // Couldn't find packet for this xdr arg
}
#endif
@ -408,7 +408,7 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
MAP(xdr_short, reinterpret_cast<SSHORT&>(data->p_data_message_number));
MAP(xdr_short, reinterpret_cast<SSHORT&>(data->p_data_messages));
/* Changes to this op's protocol must mirror in xdr_protocol_overhead */
// Changes to this op's protocol must mirror in xdr_protocol_overhead
return xdr_request(xdrs, data->p_data_request,
data->p_data_message_number,
@ -417,8 +417,8 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
case op_response:
case op_response_piggyback:
/* Changes to this op's protocol must be mirrored
in xdr_protocol_overhead */
// Changes to this op's protocol must be mirrored
// in xdr_protocol_overhead
response = &p->p_resp;
MAP(xdr_short, reinterpret_cast<SSHORT&>(response->p_resp_object));
@ -615,11 +615,10 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
MAP(xdr_short, reinterpret_cast<SSHORT&>(sqldata->p_sqldata_transaction));
if (xdrs->x_op == XDR_DECODE)
{
/* the statement should be reset for each execution so that
all prefetched information from a prior execute is properly
cleared out. This should be done before fetching any message
information (for example: blr info)
*/
// the statement should be reset for each execution so that
// all prefetched information from a prior execute is properly
// cleared out. This should be done before fetching any message
// information (for example: blr info)
Rsr* statement = NULL;
statement = get_statement(xdrs, sqldata->p_sqldata_statement);
@ -653,7 +652,7 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
}
xdr_sql_blr(xdrs, (SLONG) - 1, &prep_stmt->p_sqlst_out_blr, true, TYPE_IMMEDIATE);
MAP(xdr_short, reinterpret_cast<SSHORT&>(prep_stmt->p_sqlst_out_message_number));
/* Fall into ... */
// Fall into ...
case op_exec_immediate:
case op_prepare_statement:
@ -682,7 +681,7 @@ bool_t xdr_protocol(XDR* xdrs, PACKET* p)
MAP(xdr_long, reinterpret_cast<SLONG&>(sqldata->p_sqldata_status));
MAP(xdr_short, reinterpret_cast<SSHORT&>(sqldata->p_sqldata_messages));
/* Changes to this op's protocol must mirror in xdr_protocol_overhead */
// Changes to this op's protocol must mirror in xdr_protocol_overhead
port = (rem_port*) xdrs->x_public;
if ((port->port_protocol > PROTOCOL_VERSION7 && sqldata->p_sqldata_messages) ||
@ -799,40 +798,38 @@ ULONG xdr_protocol_overhead(P_OP op)
* OS.
*
**************************************/
ULONG size = 4 /* xdr_sizeof (xdr_enum, p->p_operation) */ ;
ULONG size = 4; // xdr_sizeof (xdr_enum, p->p_operation)
switch (op)
{
case op_fetch_response:
size += 4 /* xdr_sizeof (xdr_long, sqldata->p_sqldata_status) */
+ 4 /* xdr_sizeof (xdr_short, sqldata->p_sqldata_messages) */ ;
size += 4 // xdr_sizeof (xdr_long, sqldata->p_sqldata_status)
+ 4; // xdr_sizeof (xdr_short, sqldata->p_sqldata_messages)
break;
case op_send:
case op_start_and_send:
case op_start_send_and_receive:
size += 4 /* xdr_sizeof (xdr_short, data->p_data_request) */
+ 4 /* xdr_sizeof (xdr_short, data->p_data_incarnation) */
+ 4 /* xdr_sizeof (xdr_short, data->p_data_transaction) */
+ 4 /* xdr_sizeof (xdr_short, data->p_data_message_number) */
+ 4 /* xdr_sizeof (xdr_short, data->p_data_messages) */ ;
size += 4 // xdr_sizeof (xdr_short, data->p_data_request)
+ 4 // xdr_sizeof (xdr_short, data->p_data_incarnation)
+ 4 // xdr_sizeof (xdr_short, data->p_data_transaction)
+ 4 // xdr_sizeof (xdr_short, data->p_data_message_number)
+ 4; // xdr_sizeof (xdr_short, data->p_data_messages)
break;
case op_response:
case op_response_piggyback:
/* Note: minimal amounts are used for cstring & status_vector */
size += 4 /* xdr_sizeof (xdr_short, response->p_resp_object) */
+ 8 /* xdr_sizeof (xdr_quad, response->p_resp_blob_id) */
+ 4 /* xdr_sizeof (xdr_cstring, response->p_resp_data) */
// Note: minimal amounts are used for cstring & status_vector
size += 4 // xdr_sizeof (xdr_short, response->p_resp_object)
+ 8 // xdr_sizeof (xdr_quad, response->p_resp_blob_id)
+ 4 // xdr_sizeof (xdr_cstring, response->p_resp_data)
+
3 *
4
/* xdr_sizeof (xdr_status_vector (xdrs, response->p_resp_status_vector */
;
4; // xdr_sizeof (xdr_status_vector (xdrs, response->p_resp_status_vector
break;
default:
fb_assert(FALSE); /* Not supported operation */
fb_assert(FALSE); // Not supported operation
return 0;
}
return size;
@ -1067,9 +1064,9 @@ static bool_t xdr_datum( XDR* xdrs, const DSC* desc, BLOB_PTR* buffer)
case dtype_timestamp:
fb_assert(desc->dsc_length >= 2 * sizeof(SLONG));
if (!xdr_long(xdrs, &((SLONG *) p)[0]))
if (!xdr_long(xdrs, &((SLONG*) p)[0]))
return FALSE;
if (!xdr_long(xdrs, &((SLONG *) p)[1]))
if (!xdr_long(xdrs, &((SLONG*) p)[1]))
return FALSE;
break;
@ -1083,7 +1080,7 @@ static bool_t xdr_datum( XDR* xdrs, const DSC* desc, BLOB_PTR* buffer)
case dtype_quad:
case dtype_blob:
fb_assert(desc->dsc_length >= sizeof(struct bid));
if (!xdr_quad(xdrs, (struct bid *) p))
if (!xdr_quad(xdrs, (struct bid*) p))
return FALSE;
break;
@ -1118,7 +1115,7 @@ static bool_t xdr_debug_packet( XDR* xdrs, enum xdr_op xop, PACKET* packet)
if (xop == XDR_FREE)
{
/* Free a slot in the packet tracking vector */
// Free a slot in the packet tracking vector
rem_vec* vector = port->port_packet_vector;
if (vector)
@ -1133,10 +1130,10 @@ static bool_t xdr_debug_packet( XDR* xdrs, enum xdr_op xop, PACKET* packet)
}
}
else
{ /* XDR_ENCODE or XDR_DECODE */
{ // XDR_ENCODE or XDR_DECODE
/* Allocate an unused slot in the packet tracking vector
to start recording memory allocations for this packet. */
// Allocate an unused slot in the packet tracking vector
// to start recording memory allocations for this packet.
fb_assert(xop == XDR_ENCODE || xop == XDR_DECODE);
rem_vec* vector = A L L R _vector(&port->port_packet_vector, 0);
@ -1181,7 +1178,7 @@ static bool_t xdr_longs( XDR* xdrs, CSTRING* cstring)
return FALSE;
}
/* Handle operation specific stuff, particularly memory allocation/deallocation */
// Handle operation specific stuff, particularly memory allocation/deallocation
switch (xdrs->x_op)
{
@ -1228,8 +1225,8 @@ static bool_t xdr_message( XDR* xdrs, RMessage* message, const rem_fmt* format)
const rem_port* port = (rem_port*) xdrs->x_public;
/* If we are running a symmetric version of the protocol, just slop
the bits and don't sweat the translations */
// If we are running a symmetric version of the protocol, just slop
// the bits and don't sweat the translations
if (port->port_flags & PORT_symmetric)
{
@ -1330,7 +1327,7 @@ static bool_t xdr_request(XDR* xdrs,
tail->rrq_xdr = message->msg_next;
const rem_fmt* format = tail->rrq_format;
/* Find the address of the record */
// Find the address of the record
if (!message->msg_address)
message->msg_address = message->msg_buffer;
@ -1354,7 +1351,7 @@ static bool_t xdr_slice(XDR* xdrs, lstring* slice, USHORT sdl_length, const UCHA
if (!xdr_long(xdrs, reinterpret_cast<SLONG*>(&slice->lstr_length)))
return FALSE;
/* Handle operation specific stuff, particularly memory allocation/deallocation */
// Handle operation specific stuff, particularly memory allocation/deallocation
switch (xdrs->x_op)
{
@ -1394,7 +1391,7 @@ static bool_t xdr_slice(XDR* xdrs, lstring* slice, USHORT sdl_length, const UCHA
return TRUE;
}
/* Get descriptor of array element */
// Get descriptor of array element
ISC_STATUS_ARRAY status_vector;
struct sdl_info info;
@ -1403,7 +1400,7 @@ static bool_t xdr_slice(XDR* xdrs, lstring* slice, USHORT sdl_length, const UCHA
const dsc* desc = &info.sdl_info_element;
const rem_port* port = (rem_port*) xdrs->x_public;
BLOB_PTR* p = (BLOB_PTR *) slice->lstr_address;
BLOB_PTR* p = (BLOB_PTR*) slice->lstr_address;
ULONG n;
if (port->port_flags & PORT_symmetric)
@ -1449,7 +1446,7 @@ static bool_t xdr_sql_blr(XDR* xdrs,
if (!xdr_cstring(xdrs, blr))
return FALSE;
/* We care about all receives and sends from fetch */
// We care about all receives and sends from fetch
if (xdrs->x_op == XDR_FREE)
return TRUE;
@ -1474,26 +1471,26 @@ static bool_t xdr_sql_blr(XDR* xdrs,
return TRUE;
}
/* Parse the blr describing the message. */
// Parse the blr describing the message.
rem_fmt** fmt_ptr = direction ? &statement->rsr_select_format : &statement->rsr_bind_format;
if (xdrs->x_op == XDR_DECODE)
{
/* For an immediate statement, flush out any previous format information
* that might be hanging around from an earlier execution.
* For all statements, if we have new blr, flush out the format information
* for the old blr.
*/
// For an immediate statement, flush out any previous format information
// that might be hanging around from an earlier execution.
// For all statements, if we have new blr, flush out the format information
// for the old blr.
if (*fmt_ptr && ((stmt_type == TYPE_IMMEDIATE) || blr->cstr_length != 0))
{
delete *fmt_ptr;
*fmt_ptr = NULL;
}
/* If we have BLR describing a new input/output message, get ready by
* setting up a format
*/
// If we have BLR describing a new input/output message, get ready by
// setting up a format
if (blr->cstr_length) {
RMessage* temp_msg = (RMessage*) PARSE_messages(blr->cstr_address, blr->cstr_length);
if (temp_msg != (RMessage*) -1) {
@ -1503,8 +1500,8 @@ static bool_t xdr_sql_blr(XDR* xdrs,
}
}
/* If we know the length of the message, make sure there is a buffer
large enough to hold it. */
// If we know the length of the message, make sure there is a buffer
// large enough to hold it.
if (!(statement->rsr_format = *fmt_ptr))
return TRUE;
@ -1580,7 +1577,7 @@ static bool_t xdr_status_vector(XDR* xdrs, ISC_STATUS* vector, TEXT* strings[])
*
**************************************/
/* If this is a free operation, release any allocated strings */
// If this is a free operation, release any allocated strings
if (xdrs->x_op == XDR_FREE)
{
@ -1619,15 +1616,15 @@ static bool_t xdr_status_vector(XDR* xdrs, ISC_STATUS* vector, TEXT* strings[])
}
else
{
/* Use the first slot in the strings table */
// Use the first slot in the strings table
TEXT** sp = strings;
if (*sp)
{
/* Slot is used, by a string passed in a previous
* status vector. Free that string, and allocate
* a new one to prevent any size mismatches trashing
* memory.
*/
// Slot is used, by a string passed in a previous
// status vector. Free that string, and allocate
// a new one to prevent any size mismatches trashing
// memory.
temp_xdrs.x_public = xdrs->x_public;
temp_xdrs.x_op = XDR_FREE;
if (!xdr_wrapstring(&temp_xdrs, sp))
@ -1671,7 +1668,7 @@ static bool_t xdr_trrq_blr(XDR* xdrs, CSTRING* blr)
if (!xdr_cstring(xdrs, blr))
return FALSE;
/* We care about all receives and sends from fetch */
// We care about all receives and sends from fetch
if (xdrs->x_op == XDR_FREE || xdrs->x_op == XDR_ENCODE)
return TRUE;
@ -1681,7 +1678,7 @@ static bool_t xdr_trrq_blr(XDR* xdrs, CSTRING* blr)
if (!procedure)
procedure = port->port_rpr = new Rpr;
/* Parse the blr describing the message. */
// Parse the blr describing the message.
delete procedure->rpr_in_msg;
procedure->rpr_in_msg = NULL;
@ -1755,7 +1752,7 @@ static bool_t xdr_trrq_message( XDR* xdrs, USHORT msg_type)
}
static Rsr* get_statement( XDR * xdrs, SSHORT statement_id)
static Rsr* get_statement( XDR* xdrs, SSHORT statement_id)
{
/**************************************
*
@ -1774,14 +1771,13 @@ static Rsr* get_statement( XDR * xdrs, SSHORT statement_id)
Rsr* statement = NULL;
rem_port* port = (rem_port*) xdrs->x_public;
/* if the statement ID is -1, this seems to indicate that we are
re-executing the previous statement. This is not a
well-understood area of the implementation.
// if the statement ID is -1, this seems to indicate that we are
// re-executing the previous statement. This is not a
// well-understood area of the implementation.
if (statement_id == -1)
statement = port->port_statement;
else
*/
//if (statement_id == -1)
// statement = port->port_statement;
//else
fb_assert(statement_id >= -1);

View File

@ -34,7 +34,7 @@
#include "../jrd/gds_proto.h"
#ifdef BURP
#include "../burp/misc_proto.h" /* Was "../burp/misc_pro.h" -Jeevan */
#include "../burp/misc_proto.h" // Was "../burp/misc_pro.h" -Jeevan
inline UCHAR* XDR_ALLOC(ULONG size)
{
return MISC_alloc_burp(size);
@ -70,24 +70,24 @@ inline void DEBUG_XDR_ALLOC(XDR* xdrs, const void* xdrvar, const void* addr, ULO
inline void DEBUG_XDR_FREE(XDR* xdrs, const void* xdrvar, const void* addr, ULONG len)
{
}
#endif /* DEBUG_XDR_MEMORY */
#endif // DEBUG_XDR_MEMORY
/* Sun's XDR documentation says this should be "MAXUNSIGNED", but
for Firebird purposes, limiting strings to 65K is more than
sufficient. */
// Sun's XDR documentation says this should be "MAXUNSIGNED", but
// for Firebird purposes, limiting strings to 65K is more than
// sufficient.
// This setting may be related to our max DSQL statement size.
const u_int MAXSTRING_FOR_WRAPSTRING = 65535;
static XDR_INT mem_destroy(XDR *);
static bool_t mem_getbytes(XDR *, SCHAR *, u_int);
static bool_t mem_getlong(XDR *, SLONG *);
static u_int mem_getpostn(XDR *);
static caddr_t mem_inline(XDR *, u_int);
static XDR_INT mem_destroy(XDR*);
static bool_t mem_getbytes(XDR*, SCHAR*, u_int);
static bool_t mem_getlong(XDR*, SLONG*);
static u_int mem_getpostn(XDR*);
static caddr_t mem_inline(XDR*, u_int);
static bool_t mem_putbytes(XDR*, const SCHAR*, u_int);
static bool_t mem_putlong(XDR *, const SLONG*);
static bool_t mem_setpostn(XDR *, u_int);
static bool_t mem_putlong(XDR*, const SLONG*);
static bool_t mem_setpostn(XDR*, u_int);
static const XDR::xdr_ops mem_ops =
@ -110,7 +110,7 @@ static const XDR::xdr_ops mem_ops =
static SCHAR zeros[4] = { 0, 0, 0, 0 };
bool_t xdr_hyper( XDR * xdrs, void * pi64)
bool_t xdr_hyper( XDR* xdrs, void* pi64)
{
/**************************************
*
@ -173,11 +173,11 @@ bool_t xdr_hyper( XDR * xdrs, void * pi64)
case XDR_FREE:
return TRUE;
}
// TMN: added compiler silencier return FALSE.
// TMN: added compiler silencier return FALSE.
return FALSE;
}
bool_t xdr_bool( XDR * xdrs, bool_t * bp)
bool_t xdr_bool( XDR* xdrs, bool_t* bp)
{
/**************************************
*
@ -211,7 +211,7 @@ bool_t xdr_bool( XDR * xdrs, bool_t * bp)
}
bool_t xdr_bytes(XDR * xdrs, SCHAR ** bpp, u_int * lp, u_int maxlength)
bool_t xdr_bytes(XDR* xdrs, SCHAR** bpp, u_int* lp, u_int maxlength)
{
/**************************************
*
@ -240,9 +240,9 @@ bool_t xdr_bytes(XDR * xdrs, SCHAR ** bpp, u_int * lp, u_int maxlength)
case XDR_DECODE:
if (!*bpp)
{
*bpp = (SCHAR *) XDR_ALLOC((ULONG) (maxlength + 1));
/* FREE: via XDR_FREE call to this procedure */
if (!*bpp) /* NOMEM: */
*bpp = (SCHAR*) XDR_ALLOC((ULONG) (maxlength + 1));
// FREE: via XDR_FREE call to this procedure
if (!*bpp) // NOMEM:
return FALSE;
DEBUG_XDR_ALLOC(xdrs, bpp, *bpp, (maxlength + 1));
}
@ -269,7 +269,7 @@ bool_t xdr_bytes(XDR * xdrs, SCHAR ** bpp, u_int * lp, u_int maxlength)
}
bool_t xdr_double(XDR * xdrs, double *ip)
bool_t xdr_double(XDR* xdrs, double* ip)
{
/**************************************
*
@ -316,7 +316,7 @@ bool_t xdr_double(XDR * xdrs, double *ip)
}
bool_t xdr_enum(XDR * xdrs, xdr_op * ip)
bool_t xdr_enum(XDR* xdrs, xdr_op* ip)
{
/**************************************
*
@ -333,7 +333,7 @@ bool_t xdr_enum(XDR * xdrs, xdr_op * ip)
switch (xdrs->x_op)
{
case XDR_ENCODE:
temp = (SLONG) * ip;
temp = (SLONG) *ip;
return PUTLONG(xdrs, &temp);
case XDR_DECODE:
@ -350,7 +350,7 @@ bool_t xdr_enum(XDR * xdrs, xdr_op * ip)
}
bool_t xdr_float(XDR * xdrs, float *ip)
bool_t xdr_float(XDR* xdrs, float* ip)
{
/**************************************
*
@ -379,7 +379,7 @@ bool_t xdr_float(XDR * xdrs, float *ip)
}
bool_t xdr_free(xdrproc_t proc, SCHAR * objp)
bool_t xdr_free(xdrproc_t proc, SCHAR* objp)
{
/**************************************
*
@ -399,7 +399,7 @@ bool_t xdr_free(xdrproc_t proc, SCHAR * objp)
}
bool_t xdr_int(XDR * xdrs, int *ip)
bool_t xdr_int(XDR* xdrs, int* ip)
{
/**************************************
*
@ -433,7 +433,7 @@ bool_t xdr_int(XDR * xdrs, int *ip)
}
bool_t xdr_long(XDR * xdrs, SLONG * ip)
bool_t xdr_long(XDR* xdrs, SLONG* ip)
{
/**************************************
*
@ -462,7 +462,7 @@ bool_t xdr_long(XDR * xdrs, SLONG * ip)
}
bool_t xdr_opaque(XDR * xdrs, SCHAR * p, u_int len)
bool_t xdr_opaque(XDR* xdrs, SCHAR* p, u_int len)
{
/**************************************
*
@ -503,7 +503,7 @@ bool_t xdr_opaque(XDR * xdrs, SCHAR * p, u_int len)
}
bool_t xdr_short(XDR * xdrs, SSHORT * ip)
bool_t xdr_short(XDR* xdrs, SSHORT* ip)
{
/**************************************
*
@ -537,7 +537,7 @@ bool_t xdr_short(XDR * xdrs, SSHORT * ip)
}
bool_t xdr_string(XDR * xdrs, SCHAR ** sp, u_int maxlength)
bool_t xdr_string(XDR* xdrs, SCHAR** sp, u_int maxlength)
{
/**************************************
*
@ -570,9 +570,9 @@ bool_t xdr_string(XDR * xdrs, SCHAR ** sp, u_int maxlength)
case XDR_DECODE:
if (!*sp)
{
*sp = (SCHAR *) XDR_ALLOC((ULONG) (maxlength + 1));
/* FREE: via XDR_FREE call to this procedure */
if (!*sp) /* NOMEM: return error */
*sp = (SCHAR*) XDR_ALLOC((ULONG) (maxlength + 1));
// FREE: via XDR_FREE call to this procedure
if (!*sp) // NOMEM: return error
return FALSE;
DEBUG_XDR_ALLOC(xdrs, sp, *sp, (maxlength + 1));
}
@ -600,7 +600,7 @@ bool_t xdr_string(XDR * xdrs, SCHAR ** sp, u_int maxlength)
}
bool_t xdr_u_int(XDR * xdrs, u_int * ip)
bool_t xdr_u_int(XDR* xdrs, u_int* ip)
{
/**************************************
*
@ -635,7 +635,7 @@ bool_t xdr_u_int(XDR * xdrs, u_int * ip)
}
bool_t xdr_u_long(XDR * xdrs, ULONG * ip)
bool_t xdr_u_long(XDR* xdrs, ULONG* ip)
{
/**************************************
*
@ -666,7 +666,7 @@ bool_t xdr_u_long(XDR * xdrs, ULONG * ip)
}
bool_t xdr_u_short(XDR * xdrs, u_short * ip)
bool_t xdr_u_short(XDR* xdrs, u_short* ip)
{
/**************************************
*
@ -745,7 +745,7 @@ int xdr_union( XDR* xdrs,
}
bool_t xdr_wrapstring(XDR * xdrs, SCHAR ** strp)
bool_t xdr_wrapstring(XDR* xdrs, SCHAR** strp)
{
/**************************************
*
@ -784,7 +784,7 @@ int xdrmem_create( XDR* xdrs, SCHAR* addr, u_int len, xdr_op x_op)
}
static XDR_INT mem_destroy(XDR * xdrs)
static XDR_INT mem_destroy(XDR* xdrs)
{
/**************************************
*
@ -830,7 +830,7 @@ static bool_t mem_getbytes( XDR* xdrs, SCHAR* buff, u_int count)
}
static bool_t mem_getlong( XDR * xdrs, SLONG * lp)
static bool_t mem_getlong( XDR* xdrs, SLONG* lp)
{
/**************************************
*
@ -848,9 +848,9 @@ static bool_t mem_getlong( XDR * xdrs, SLONG * lp)
return FALSE;
}
SLONG* p = (SLONG *) xdrs->x_private;
SLONG* p = (SLONG*) xdrs->x_private;
*lp = ntohl(*p++);
xdrs->x_private = (SCHAR *) p;
xdrs->x_private = (SCHAR*) p;
return TRUE;
}
@ -878,7 +878,7 @@ SLONG getOperation(const void* data, size_t size)
}
static u_int mem_getpostn( XDR * xdrs)
static u_int mem_getpostn( XDR* xdrs)
{
/**************************************
*
@ -895,7 +895,7 @@ static u_int mem_getpostn( XDR * xdrs)
}
static caddr_t mem_inline( XDR * xdrs, u_int bytecount)
static caddr_t mem_inline( XDR* xdrs, u_int bytecount)
{
/**************************************
*
@ -945,7 +945,7 @@ static bool_t mem_putbytes(XDR* xdrs, const SCHAR* buff, u_int count)
}
static bool_t mem_putlong( XDR * xdrs, const SLONG* lp)
static bool_t mem_putlong( XDR* xdrs, const SLONG* lp)
{
/**************************************
*
@ -963,15 +963,15 @@ static bool_t mem_putlong( XDR * xdrs, const SLONG* lp)
return FALSE;
}
SLONG* p = (SLONG *) xdrs->x_private;
SLONG* p = (SLONG*) xdrs->x_private;
*p++ = htonl(*lp);
xdrs->x_private = (SCHAR *) p;
xdrs->x_private = (SCHAR*) p;
return TRUE;
}
static bool_t mem_setpostn( XDR * xdrs, u_int bytecount)
static bool_t mem_setpostn( XDR* xdrs, u_int bytecount)
{
/**************************************
*