From: Mark O. <sky...@us...> - 2001-04-05 17:05:46
|
Update of /cvsroot/firebird/interbase/remote In directory usw-pr-cvs1:/tmp/cvs-serv32292/remote Modified Files: cntl.c ibconfig.c ibconfig.rc inet.c property.c property.rc Log Message: Committed Changes made in the borland tree Committed Changes made by Mike Nordel re, 64 bit io for win32 and bug fixes Index: cntl.c =================================================================== RCS file: /cvsroot/firebird/interbase/remote/cntl.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** cntl.c 2000/08/05 16:13:33 1.2 --- cntl.c 2001/04/05 17:05:43 1.3 *************** *** 121,127 **** * **************************************/ ! int flag; TEXT *p, default_mode [100]; ! DWORD last_error; HANDLE cleanup_thread_handle; --- 121,128 ---- * **************************************/ ! int flag, status; TEXT *p, default_mode [100]; ! DWORD last_error = 0; ! DWORD temp; HANDLE cleanup_thread_handle; *************** *** 159,162 **** --- 160,165 ---- } + status = 1; + if (report_status (SERVICE_START_PENDING, NO_ERROR, 1, 3000) && (stop_event_handle = CreateEvent (NULL, TRUE, FALSE, NULL)) != NULL && *************** *** 165,172 **** report_status (SERVICE_RUNNING, NO_ERROR, 0, 0)) { ! WaitForSingleObject (stop_event_handle, INFINITE); } ! last_error = GetLastError(); if (stop_event_handle) --- 168,178 ---- report_status (SERVICE_RUNNING, NO_ERROR, 0, 0)) { ! status = 0; ! temp = WaitForSingleObject (stop_event_handle, INFINITE); } + ! if (temp == WAIT_FAILED || status) ! last_error = GetLastError(); if (stop_event_handle) *************** *** 191,194 **** --- 197,201 ---- CloseHandle(cleanup_thread_handle); + CloseHandle (cleanup_thread_handle); report_status (SERVICE_STOPPED, last_error, 0, 0); } Index: ibconfig.c =================================================================== RCS file: /cvsroot/firebird/interbase/remote/ibconfig.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ibconfig.c 2000/08/31 04:57:26 1.2 --- ibconfig.c 2001/04/05 17:05:43 1.3 *************** *** 37,40 **** --- 37,41 ---- #include "../jrd/svc_undoc.h" #include "../jrd/svc_proto.h" + #include "../jrd/ods.h" // to get MAX_PAGE_SIZE #include "../remote/window_proto.h" #include "../ipserver/ipsrv_proto.h" *************** *** 400,407 **** // Fill the Map Size Combo Box ! SendDlgItemMessage(hDlg, IDC_MAPSIZE, CB_ADDSTRING, 0,(LPARAM)"1024"); ! SendDlgItemMessage(hDlg, IDC_MAPSIZE, CB_ADDSTRING, 0,(LPARAM)"2048"); ! SendDlgItemMessage(hDlg, IDC_MAPSIZE, CB_ADDSTRING, 0,(LPARAM)"4096"); ! SendDlgItemMessage(hDlg, IDC_MAPSIZE, CB_ADDSTRING, 0,(LPARAM)"8192"); // Select the right Map Size, inserting it if necessary --- 401,413 ---- // Fill the Map Size Combo Box ! { ! char szTmp[8]; ! int temp = 1024; ! while (temp <= MAX_PAGE_SIZE) { ! wsprintf(szTmp, "%d", temp); ! SendDlgItemMessage(hDlg, IDC_MAPSIZE, CB_ADDSTRING, 0,(LPARAM)szTmp); ! temp <<= 1; ! } ! } // Select the right Map Size, inserting it if necessary Index: ibconfig.rc =================================================================== RCS file: /cvsroot/firebird/interbase/remote/ibconfig.rc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** ibconfig.rc 2000/08/03 20:54:03 1.1.1.1 --- ibconfig.rc 2001/04/05 17:05:43 1.2 *************** *** 27,31 **** EDITTEXT IDC_DBPAGES, 137, 84, 47, 12, ES_RIGHT | WS_BORDER | WS_TABSTOP LTEXT "&Client map size (bytes):", IDC_MAPTEXT, 22, 107, 77, 12 ! COMBOBOX IDC_MAPSIZE, 126, 106, 58, 40, CBS_DROPDOWNLIST | CBS_SORT | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Modify...", IDC_MODRES, 133, 132, 51, 13 ICON IDI_CAUTION, IDC_CAUTION_ICON, 9, 17, 18, 20 --- 27,31 ---- EDITTEXT IDC_DBPAGES, 137, 84, 47, 12, ES_RIGHT | WS_BORDER | WS_TABSTOP LTEXT "&Client map size (bytes):", IDC_MAPTEXT, 22, 107, 77, 12 ! COMBOBOX IDC_MAPSIZE, 126, 106, 58, 40, CBS_DROPDOWNLIST | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Modify...", IDC_MODRES, 133, 132, 51, 13 ICON IDI_CAUTION, IDC_CAUTION_ICON, 9, 17, 18, 20 Index: inet.c =================================================================== RCS file: /cvsroot/firebird/interbase/remote/inet.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** inet.c 2001/03/23 08:14:01 1.4 --- inet.c 2001/04/05 17:05:43 1.5 *************** *** 160,164 **** ** so that it won't be redefined below. */ ! #define SOCKET SOCKET #define ERRNO WSAGetLastError() #define H_ERRNO WSAGetLastError() --- 160,167 ---- ** so that it won't be redefined below. */ ! /* TMN: 28 Jul 2000 - Fixed compiler warning */ ! # ifndef SOCKET ! # define SOCKET SOCKET ! # endif /* SOCKET */ #define ERRNO WSAGetLastError() #define H_ERRNO WSAGetLastError() *************** *** 179,184 **** #define INET_ADDR_IN_USE WSAEADDRINUSE #define sleep(seconds) Sleep ((seconds) * 1000) - #endif #ifdef PC_PLATFORM #define NO_FORK --- 182,189 ---- #define INET_ADDR_IN_USE WSAEADDRINUSE #define sleep(seconds) Sleep ((seconds) * 1000) + #endif /* WIN_NT */ + + #ifdef PC_PLATFORM #define NO_FORK *************** *** 378,382 **** static PORT aux_connect (PORT, PACKET *, ! int (*)(void)); static PORT aux_request (PORT, PACKET *); --- 383,387 ---- static PORT aux_connect (PORT, PACKET *, ! XDR_INT (*)(void)); static PORT aux_request (PORT, PACKET *); *************** *** 768,771 **** --- 773,778 ---- #ifdef SUPERSERVER + /* TMN: 28 Jul 2000 - Added include to remove warnings */ + #include "../jrd/thd_proto.h" static MUTX_T port_mutex; static BOOLEAN port_mutex_inited = 0; *************** *** 1102,1106 **** SOCKET s; PORT port; ! TEXT *protocol, temp [128], *p; struct sockaddr_in address; #ifndef VMS --- 1109,1115 ---- SOCKET s; PORT port; ! TEXT* protocol; ! TEXT temp[128]; ! TEXT* p; struct sockaddr_in address; #ifndef VMS *************** *** 1126,1132 **** }; INET_start_time = inet_debug_timer(); ! if ((p = getenv ("INET_force_error")) != NULL) INET_force_error = atoi (p); } #endif --- 1135,1142 ---- }; INET_start_time = inet_debug_timer(); ! if ((p = getenv ("INET_force_error")) != NULL) { INET_force_error = atoi (p); } + } #endif *************** *** 1146,1149 **** --- 1156,1160 ---- strcpy (temp, name); for (p = temp; *p;) + { if (*p++ == '/') { *************** *** 1154,1166 **** } } if (name && *name) { ! if (port->port_connection) ALLR_free (port->port_connection); port->port_connection = REMOTE_make_string (name); } else name = port->port_host->str_data; /* Set up Inter-Net socket address */ --- 1165,1181 ---- } } + } if (name && *name) { ! if (port->port_connection) { ALLR_free (port->port_connection); + } port->port_connection = REMOTE_make_string (name); } else + { name = port->port_host->str_data; + } /* Set up Inter-Net socket address */ *************** *** 1168,1177 **** inet_zero ((SCHAR*) &address, sizeof (address)); - /* V M S */ - #ifdef VMS if (getservport (protocol, "tcp", &address.sin_port) == -1) { inet_error (port, "getservbyname", isc_net_connect_err, 0); return NULL; } --- 1183,1192 ---- inet_zero ((SCHAR*) &address, sizeof (address)); #ifdef VMS + /* V M S */ if (getservport (protocol, "tcp", &address.sin_port) == -1) { inet_error (port, "getservbyname", isc_net_connect_err, 0); + disconnect (port); return NULL; } *************** *** 1181,1194 **** { inet_error (port, "gethostbyname", isc_net_connect_err, 0); return NULL; } } else address.sin_addr.s_addr = INADDR_ANY; #else #ifdef WINDOWS_ONLY ! if (initWSA(port)) return NULL; #endif /* WINDOWS_ONLY */ --- 1196,1214 ---- { inet_error (port, "gethostbyname", isc_net_connect_err, 0); + disconnect (port); return NULL; } } else + { address.sin_addr.s_addr = INADDR_ANY; + } #else #ifdef WINDOWS_ONLY ! if (initWSA(port)) { ! disconnect (port); return NULL; + } #endif /* WINDOWS_ONLY */ *************** *** 1236,1239 **** --- 1256,1260 ---- NetworkLibraryCleanup (); #endif /* WINDOWS_ONLY */ + disconnect (port); return NULL; } *************** *** 1243,1250 **** address.sin_family = host->h_addrtype; ! if (packet) ! inet_copy (host->h_addr, &address.sin_addr, sizeof (address.sin_addr)); ! else address.sin_addr.s_addr = INADDR_ANY; THREAD_EXIT; --- 1264,1272 ---- address.sin_family = host->h_addrtype; ! if (packet) { ! inet_copy (host->h_addr, (SCHAR*)&address.sin_addr, sizeof (address.sin_addr)); ! } else { address.sin_addr.s_addr = INADDR_ANY; + } THREAD_EXIT; *************** *** 1358,1361 **** --- 1380,1385 ---- NetworkLibraryCleanup (); #endif /* WINDOWS_ONLY */ + disconnect (port); + disconnect (port); return NULL; } *************** *** 1627,1637 **** BOOLEAN user_set; #endif #if !(defined OS2_ONLY || defined PC_PLATFORM) int trusted; - SLONG gids [128]; TEXT host [MAXHOSTLEN]; struct passwd *passwd; int i, gid_count; #endif /* Default account to "guest" (in theory all packets contain a name) */ --- 1651,1667 ---- BOOLEAN user_set; #endif + #if !(defined OS2_ONLY || defined PC_PLATFORM) + # if !defined(WINDOWS_ONLY) && !defined(NETWARE_386) && !defined(OS2_ONLY) && !defined(WIN_NT) int trusted; TEXT host [MAXHOSTLEN]; struct passwd *passwd; + + # if !defined(VMS) + SLONG gids [128]; int i, gid_count; #endif + # endif + #endif /* Default account to "guest" (in theory all packets contain a name) */ *************** *** 1706,1710 **** #endif ! #ifndef WINDOWS_ONLY if (user_verification) { --- 1736,1741 ---- #endif ! #if !defined(WINDOWS_ONLY) ! if (user_verification) { *************** *** 1712,1718 **** port->port_flags |= PORT_not_trusted; } ! #ifndef NETWARE_386 ! #ifndef OS2_ONLY ! #ifndef WIN_NT #ifdef VMS else --- 1743,1749 ---- port->port_flags |= PORT_not_trusted; } ! ! #if !defined(NETWARE_386) && !defined(OS2_ONLY) && !defined(WIN_NT) ! #ifdef VMS else *************** *** 1817,1823 **** } #endif /* VMS */ ! #endif /* OS2_ONLY */ ! #endif /* WIN_NT */ ! #endif /* NETWARE_386 */ #endif /* WINDOWS_ONLY */ --- 1848,1854 ---- } #endif /* VMS */ ! ! #endif /* !NETWARE_386 && !OS2_ONLY !WIN_NT */ ! #endif /* WINDOWS_ONLY */ *************** *** 1888,1892 **** if (first_time == TRUE) ! {char messg[128]; ISC_get_config (LOCK_HEADER, INET_tcp_buffer); if (INET_remote_buffer < MAX_DATA_LW || INET_remote_buffer > MAX_DATA_HW) --- 1919,1923 ---- if (first_time == TRUE) ! { ISC_get_config (LOCK_HEADER, INET_tcp_buffer); if (INET_remote_buffer < MAX_DATA_LW || INET_remote_buffer > MAX_DATA_HW) *************** *** 1894,1899 **** --- 1925,1933 ---- INET_max_data = INET_remote_buffer; #ifdef DEBUG + { + char messg[128]; sprintf(messg, " Info: Remote Buffer Size set to %d", INET_remote_buffer); gds__log(messg, NULL_PTR); + } #endif first_time = FALSE; *************** *** 1943,1950 **** port->port_connect = aux_connect; port->port_request = aux_request; ! port->port_buff_size = INET_remote_buffer; xdrinet_create (&port->port_send, port, ! &port->port_buffer [INET_remote_buffer], INET_remote_buffer, XDR_ENCODE); --- 1977,1984 ---- port->port_connect = aux_connect; port->port_request = aux_request; ! port->port_buff_size = (USHORT)INET_remote_buffer; xdrinet_create (&port->port_send, port, ! &port->port_buffer [INET_remote_buffer], (USHORT)INET_remote_buffer, XDR_ENCODE); *************** *** 1958,1962 **** PORT port, PACKET *packet, ! XDR_INT (*ast)()) { /************************************** --- 1992,1996 ---- PORT port, PACKET *packet, ! XDR_INT (*ast)(void)) { /************************************** *************** *** 1976,1980 **** --- 2010,2018 ---- PORT new_port; struct sockaddr_in address; + #if !defined(WINDOWS_ONLY) && \ + (!(defined VMS || defined NETWARE_386 || defined PC_PLATFORM || \ + defined OS2_ONLY || defined WIN_NT) && !defined APOLLO) int arg; + #endif /* If this is a server, we're got an auxiliary connection. Accept it */ *************** *** 2012,2016 **** inet_zero ((SCHAR*) &address, sizeof (address)); ! inet_copy (response->p_resp_data.cstr_address, &address, response->p_resp_data.cstr_length); address.sin_family = AF_INET; --- 2050,2054 ---- inet_zero ((SCHAR*) &address, sizeof (address)); ! inet_copy (response->p_resp_data.cstr_address, (SCHAR*)&address, response->p_resp_data.cstr_length); address.sin_family = AF_INET; *************** *** 2199,2208 **** return NULL; } ! inet_copy (host->h_addr, &address.sin_addr, sizeof (address.sin_addr)); #endif response->p_resp_data.cstr_address = (UCHAR*) &response->p_resp_blob_id; response->p_resp_data.cstr_length = sizeof (response->p_resp_blob_id); ! inet_copy (&address, response->p_resp_data.cstr_address, response->p_resp_data.cstr_length); --- 2237,2246 ---- return NULL; } ! inet_copy (host->h_addr, (SCHAR*)&address.sin_addr, sizeof (address.sin_addr)); #endif response->p_resp_data.cstr_address = (UCHAR*) &response->p_resp_blob_id; response->p_resp_data.cstr_length = sizeof (response->p_resp_blob_id); ! inet_copy ((SCHAR*)&address, response->p_resp_data.cstr_address, response->p_resp_data.cstr_length); *************** *** 2392,2396 **** * **************************************/ ! PORT parent, *ptr; int n; #ifdef DEFER_PORT_CLEANUP --- 2430,2434 ---- * **************************************/ ! PORT parent; int n; #ifdef DEFER_PORT_CLEANUP *************** *** 2415,2425 **** } shutdown ((int) port->port_handle, 2); ! #endif #if !(defined VMS || defined NETWARE_386 || defined PC_PLATFORM || \ defined OS2_ONLY || defined WIN_NT) ! if (port->port_ast) ISC_signal_cancel (SIGURG, inet_handler, port); #endif --- 2453,2477 ---- } + #if defined WIN_NT + + if (port->port_handle && (SOCKET)port->port_handle != INVALID_SOCKET) { shutdown ((int) port->port_handle, 2); ! } ! ! #else /* WIN_NT */ ! ! if (port->port_handle) { ! shutdown ((int) port->port_handle, 2); ! } ! ! #endif /* WIN_NT */ + #endif /* !VMS */ + #if !(defined VMS || defined NETWARE_386 || defined PC_PLATFORM || \ defined OS2_ONLY || defined WIN_NT) ! if (port->port_ast) { ISC_signal_cancel (SIGURG, inet_handler, port); + } #endif *************** *** 2453,2463 **** } SOCLOSE ((SOCKET) port->port_handle); #ifdef WINDOWS_ONLY NetworkLibraryCleanup (); ! if (port->port_msg_handle) /* close socket should flush any async postings, so its safe to destroy */ DestroyWindow (port->port_msg_handle); #endif --- 2505,2518 ---- } + if (port->port_handle) { SOCLOSE ((SOCKET) port->port_handle); + } #ifdef WINDOWS_ONLY NetworkLibraryCleanup (); ! if (port->port_msg_handle) { /* close socket should flush any async postings, so its safe to destroy */ DestroyWindow (port->port_msg_handle); + } #endif *************** *** 3253,3261 **** --- 3308,3320 ---- **************************************/ PORT port; + + #if !defined(WIN_NT) int n; + #endif #ifdef WIN_NT /* NT's socket handles are addresses */ + /* TMN: No, they are "black-box" handles. */ START_PORT_CRITICAL; *************** *** 3267,3271 **** { port->port_dummy_timeout = port->port_dummy_packet_interval; ! FD_CLR (port->port_handle, &selct->slct_fdset); --selct->slct_count; STOP_PORT_CRITICAL; --- 3326,3339 ---- { port->port_dummy_timeout = port->port_dummy_packet_interval; ! ! #define TMNchSTR(x) #x ! #define chSTR2(x) TMNchSTR(x) ! #define TMN_FILE_LINE_MESSAGE(desc) message(__FILE__ "(" chSTR2(__LINE__) "):" desc) ! #pragma TMN_FILE_LINE_MESSAGE("TODO: Make porthandle a SOCKET on Win32") ! #undef TMN_FILE_LINE_MESSAGE ! #undef chSTR2 ! #undef TMNchSTR ! ! FD_CLR ((SOCKET)port->port_handle, &selct->slct_fdset); --selct->slct_count; STOP_PORT_CRITICAL; *************** *** 3419,3423 **** --- 3487,3495 ---- { for (port = main_port; port; port = port->port_next) + #ifdef WIN_NT + FD_CLR ((SOCKET)port->port_handle, &selct->slct_fdset); + #else FD_CLR (port->port_handle, &selct->slct_fdset); + #endif } THREAD_ENTER; *************** *** 3536,3540 **** xdrs->x_base = xdrs->x_private = (SCHAR*) buffer; xdrs->x_handy = length; ! xdrs->x_ops = &inet_ops; xdrs->x_op = x_op; --- 3608,3612 ---- xdrs->x_base = xdrs->x_private = (SCHAR*) buffer; xdrs->x_handy = length; ! xdrs->x_ops = (struct xdr_ops*)&inet_ops; xdrs->x_op = x_op; *************** *** 3616,3623 **** status_vector = NULL; ! if (port->port_context != NULL) status_vector = port->port_context->rdb_status_vector; ! if (status_vector == NULL) status_vector = port->port_status_vector; if (status_vector != NULL) { --- 3688,3697 ---- status_vector = NULL; ! if (port->port_context != NULL) { status_vector = port->port_context->rdb_status_vector; ! } ! if (status_vector == NULL) { status_vector = port->port_status_vector; + } if (status_vector != NULL) { *************** *** 3823,3827 **** **************************************/ ! if (bytecount > xdrs->x_handy) return FALSE; --- 3897,3901 ---- **************************************/ ! if (bytecount > (u_int)xdrs->x_handy) return FALSE; *************** *** 4056,4060 **** **************************************/ ! if (bytecount > xdrs->x_handy) return FALSE; --- 4130,4134 ---- **************************************/ ! if (bytecount > (u_int)xdrs->x_handy) return FALSE; *************** *** 4162,4168 **** { port->port_misc1 = (port->port_misc1 + 1) % MAX_SEQUENCE; ! l = MIN (length, INET_max_data); length -= l; ! if (!packet_send (port, p, (length) ? -l : l)) return FALSE; p += l; --- 4236,4242 ---- { port->port_misc1 = (port->port_misc1 + 1) % MAX_SEQUENCE; ! l = (SSHORT)MIN (length, INET_max_data); length -= l; ! if (!packet_send (port, p, (SSHORT)((length) ? -l : l))) return FALSE; p += l; Index: property.c =================================================================== RCS file: /cvsroot/firebird/interbase/remote/property.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** property.c 2000/09/02 07:54:24 1.2 --- property.c 2001/04/05 17:05:43 1.3 *************** *** 1,27 **** ! /************* history ************ ! * ! * COMPONENT: REMOTE MODULE: PROPERTY.C ! * generated by Marion V2.5 2/6/90 ! * from dev db on 1-FEB-1996 ! ***************************************************************** ! * ! * 20959 RCURRY 1-FEB-1996 ! * Add missing break before case WM_HELP ! * ! * 20950 RMIDEKE 31-JAN-1996 ! * add whats this ! * ! * 20909 RCURRY 24-JAN-1996 ! * Move HelpCmd() from here to ibconfig.c ! * ! * 20903 RCURRY 24-JAN-1996 ! * Add a nice little help button for confused users ! * ! * 20861 jmayer 17-JAN-1996 ! * Restore code that was removed by previous change. ! * ! * 0 JKONERU 5-JAN-1996 ! * history begins ! * * The contents of this file are subject to the Interbase Public * License Version 1.0 (the "License"); you may not use this file --- 1,3 ---- ! /* * The contents of this file are subject to the Interbase Public * License Version 1.0 (the "License"); you may not use this file *************** *** 47,51 **** * DESCRIPTION: Property sheet implementation for WIN32 server * - * copyright (c) Borland International */ --- 23,26 ---- Index: property.rc =================================================================== RCS file: /cvsroot/firebird/interbase/remote/property.rc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** property.rc 2000/08/03 20:54:09 1.1.1.1 --- property.rc 2001/04/05 17:05:43 1.2 *************** *** 47,51 **** IDS_IPC, "Local Client Support" IDS_NP, "NetBEUI Client Support" ! IDS_SERVERPROD_NAME, "InterBase SQL Server for Windows 95/NT" IDS_LOCALPROD_NAME, "Local InterBase Server" IDS_STARTUP_NODLL, "REGCFG.DLL not found" --- 47,51 ---- IDS_IPC, "Local Client Support" IDS_NP, "NetBEUI Client Support" ! IDS_SERVERPROD_NAME, "InterBase SQL Server for Windows" IDS_LOCALPROD_NAME, "Local InterBase Server" IDS_STARTUP_NODLL, "REGCFG.DLL not found" |