[Sphere-axis-commits] CVS: axissvr AxisServer.rc,1.4,1.5 AxisServer.vcproj,1.3,1.4 ClientObj.cpp,1.7
Brought to you by:
pesterle
From: Philip E. <pes...@us...> - 2003-06-19 21:37:55
|
Update of /cvsroot/sphere-axis/axissvr In directory sc8-pr-cvs1:/tmp/cvs-serv29889 Modified Files: AxisServer.rc AxisServer.vcproj ClientObj.cpp ConfigDlg.cpp ConfigDlg.h resource.h ServerConfiguration.cpp ServerConfiguration.h ServerObj.h Log Message: Added option to dump incoming packets. Index: AxisServer.rc =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.rc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** AxisServer.rc 17 Jun 2003 22:33:08 -0000 1.4 --- AxisServer.rc 19 Jun 2003 21:37:52 -0000 1.5 *************** *** 169,175 **** BS_AUTOCHECKBOX | WS_TABSTOP,13,28,69,10 CONTROL "Allow multithreading",IDC_MULTITHREAD,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,13,41,78,10 CONTROL "Readonly mode",IDC_READONLY,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,13,54,65,10 EDITTEXT IDC_MAXCONNECTIONS,141,65,36,12,ES_AUTOHSCROLL | ES_NUMBER --- 169,175 ---- BS_AUTOCHECKBOX | WS_TABSTOP,13,28,69,10 CONTROL "Allow multithreading",IDC_MULTITHREAD,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,13,38,78,10 CONTROL "Readonly mode",IDC_READONLY,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,13,48,65,10 EDITTEXT IDC_MAXCONNECTIONS,141,65,36,12,ES_AUTOHSCROLL | ES_NUMBER *************** *** 197,201 **** LTEXT "Allowed file paths",IDC_STATIC,24,147,56,8 LTEXT "Allowed file extensions",IDC_STATIC,156,147,72,8 ! GROUPBOX "General Options",IDC_STATIC,7,7,174,96 GROUPBOX "File Options",IDC_STATIC,20,137,263,80 LTEXT "Denied Hosts",IDC_STATIC,24,230,44,8 --- 197,201 ---- LTEXT "Allowed file paths",IDC_STATIC,24,147,56,8 LTEXT "Allowed file extensions",IDC_STATIC,156,147,72,8 ! GROUPBOX "General Options",IDC_STATIC,7,7,187,102 GROUPBOX "File Options",IDC_STATIC,20,137,263,80 LTEXT "Denied Hosts",IDC_STATIC,24,230,44,8 *************** *** 208,216 **** EDITTEXT IDC_SPAWNREFRESHTIME,141,87,36,12,ES_AUTOHSCROLL | ES_NUMBER ! GROUPBOX "Security Options",IDC_STATIC,7,103,292,204 CONTROL "Use Database to specify individual user permissions", ! IDC_USEDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,122, 178,10 ! PUSHBUTTON "Configure Database",IDC_CONFIGDB,205,120,74,16 END --- 208,218 ---- EDITTEXT IDC_SPAWNREFRESHTIME,141,87,36,12,ES_AUTOHSCROLL | ES_NUMBER ! GROUPBOX "Security Options",IDC_STATIC,7,112,292,195 CONTROL "Use Database to specify individual user permissions", ! IDC_USEDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,125, 178,10 ! PUSHBUTTON "Configure Database",IDC_CONFIGDB,205,123,74,16 ! CONTROL "Dump Packets",IDC_DUMPPACKETS,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,13,58,70,10 END Index: AxisServer.vcproj =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/AxisServer.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** AxisServer.vcproj 19 Jun 2003 19:13:18 -0000 1.3 --- AxisServer.vcproj 19 Jun 2003 21:37:52 -0000 1.4 *************** *** 42,46 **** Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="libxml2.lib ..\crypto51\release\cryptlib.lib" OutputFile=".\Release/AxisServer.exe" LinkIncremental="1" --- 42,46 ---- Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="libxml2.lib cryptlib.lib" OutputFile=".\Release/AxisServer.exe" LinkIncremental="1" *************** *** 99,103 **** Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="libxml2.lib ..\crypto51\debug\cryptlib.lib" OutputFile=".\Debug/AxisServer.exe" LinkIncremental="2" --- 99,103 ---- Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" ! AdditionalDependencies="libxml2.lib cryptlibd.lib" OutputFile=".\Debug/AxisServer.exe" LinkIncremental="2" Index: ClientObj.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ClientObj.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** ClientObj.cpp 19 Jun 2003 18:03:39 -0000 1.7 --- ClientObj.cpp 19 Jun 2003 21:37:52 -0000 1.8 *************** *** 132,135 **** --- 132,137 ---- sprintf((char*)szOutput, "%ld", lLength); Send(szOutput, strlen((char*)szOutput)); + char szInput[5]; + int iBytesSent; while (!feof(pFile)) { *************** *** 139,143 **** if ( iBytesRead ) { ! int iBytesSent = Send((BYTE*)bOutput, iBytesRead); #ifdef WIN32 Sleep(SLEEPTIME); --- 141,145 ---- if ( iBytesRead ) { ! iBytesSent = Send((BYTE*)bOutput, iBytesRead); #ifdef WIN32 Sleep(SLEEPTIME); *************** *** 145,149 **** sleep(SLEEPTIME/1000); #endif - char szInput[5]; memset(&szInput[0], 0x00, sizeof(szInput)); Receive((BYTE*)&szInput[0], sizeof(szInput)); --- 147,150 ---- *************** *** 157,161 **** } fclose(pFile); ! Send((BYTE*)szEOF, strlen(szEOF)); #ifdef WIN32 Sleep(SLEEPTIME); --- 158,162 ---- } fclose(pFile); ! iBytesSent = Send((BYTE*)szEOF, strlen(szEOF)); #ifdef WIN32 Sleep(SLEEPTIME); *************** *** 163,166 **** --- 164,176 ---- sleep(SLEEPTIME/1000); #endif + // Receive the final ack + memset(&szInput[0], 0x00, sizeof(szInput)); + Receive((BYTE*)&szInput[0], sizeof(szInput)); + if ( atoi(szInput) != iBytesSent ) + { + SysMessage(_T("Ack failed while sending file. %ld != %ld\n"), atoi(szInput), iBytesSent); + fclose(pFile); + return; + } memset( szOutput, 0x00, sizeof(szOutput) ); return; *************** *** 552,556 **** #endif } ! if ( m_pServer->DumpPackets() ) { BYTE outbuffer[MAX_BUFFER * 2 + 4]; --- 562,566 ---- #endif } ! if ( m_pServer->m_config.DumpPackets() ) { BYTE outbuffer[MAX_BUFFER * 2 + 4]; Index: ConfigDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ConfigDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ConfigDlg.cpp 17 Jun 2003 22:33:08 -0000 1.3 --- ConfigDlg.cpp 19 Jun 2003 21:37:52 -0000 1.4 *************** *** 58,61 **** --- 58,62 ---- DDX_Control(pDX, IDC_MULTITHREAD, m_bMultiThread); DDX_Control(pDX, IDC_READONLY, m_bReadonly); + DDX_Control(pDX, IDC_DUMPPACKETS, m_bDumpPackets); DDX_Control(pDX, IDC_MAXCONNECTIONS, m_eMaxConnections); DDX_Control(pDX, IDC_ALLOWEDPATHS, m_lAllowedPaths); *************** *** 192,195 **** --- 193,197 ---- m_cfgNew.UseService(m_bUseService.GetCheck()); m_cfgNew.UseThreads(m_bMultiThread.GetCheck()); + m_cfgNew.DumpPackets(m_bDumpPackets.GetCheck()); // Get the strings for the list boxes *************** *** 220,223 **** --- 222,226 ---- m_bUseService.SetCheck(m_cfgNew.UseService()); m_bMultiThread.SetCheck(m_cfgNew.UseThreads()); + m_bDumpPackets.SetCheck(m_cfgNew.DumpPackets()); if ( !m_cfgNew.UseDB() ) Index: ConfigDlg.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ConfigDlg.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ConfigDlg.h 17 Jun 2003 22:33:08 -0000 1.3 --- ConfigDlg.h 19 Jun 2003 21:37:52 -0000 1.4 *************** *** 63,66 **** --- 63,67 ---- CButton m_bMultiThread; CButton m_bReadonly; + CButton m_bDumpPackets; CEdit m_eMaxConnections; CListBox m_lAllowedPaths; Index: resource.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/resource.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** resource.h 23 May 2003 15:38:29 -0000 1.4 --- resource.h 19 Jun 2003 21:37:52 -0000 1.5 *************** *** 81,84 **** --- 81,86 ---- #define IDC_BUTTON4 1066 #define IDC_READWRITE 1067 + #define IDC_CHECK1 1068 + #define IDC_DUMPPACKETS 1068 #define ID_VIEW_FONTS 32771 #define ID_SERVER_STOP 32772 *************** *** 93,97 **** #define _APS_NEXT_RESOURCE_VALUE 136 #define _APS_NEXT_COMMAND_VALUE 32775 ! #define _APS_NEXT_CONTROL_VALUE 1068 #define _APS_NEXT_SYMED_VALUE 103 #endif --- 95,99 ---- #define _APS_NEXT_RESOURCE_VALUE 136 #define _APS_NEXT_COMMAND_VALUE 32775 ! #define _APS_NEXT_CONTROL_VALUE 1069 #define _APS_NEXT_SYMED_VALUE 103 #endif Index: ServerConfiguration.cpp =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ServerConfiguration.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ServerConfiguration.cpp 23 May 2003 15:38:29 -0000 1.2 --- ServerConfiguration.cpp 19 Jun 2003 21:37:52 -0000 1.3 *************** *** 29,32 **** --- 29,33 ---- m_bFontFlags = 0; m_bUseDB = FALSE; + m_bDumpPackets = FALSE; } *************** *** 272,275 **** --- 273,277 ---- m_bUseService = pSource->UseService(); m_bUseThreads = pSource->UseThreads(); + m_bDumpPackets = pSource->DumpPackets(); m_sFontName.assign(pSource->FontName()); *************** *** 376,379 **** --- 378,382 ---- ReadValue(pDoc, pRoot, _T("UseThreads"), (void*) &m_bUseThreads, 0); ReadValue(pDoc, pRoot, _T("ReadOnly"), (void*) &m_bReadOnly, 0); + ReadValue(pDoc, pRoot, _T("DumpPackets"), (void*) &m_bDumpPackets, 0); ReadValue(pDoc, pRoot, _T("SpawnRefreshTime"), (void*) &m_iSpawnRefreshtime, 5); ReadValue(pDoc, pRoot, _T("NTService"), (void*) &m_bUseService, 5); *************** *** 412,415 **** --- 415,419 ---- AddValue(pDoc, pRoot, _T("UseThreads"), (void*) &m_bUseThreads, 0); AddValue(pDoc, pRoot, _T("ReadOnly"), (void*) &m_bReadOnly, 0); + AddValue(pDoc, pRoot, _T("DumpPackets"), (void*) &m_bDumpPackets, 0); AddValue(pDoc, pRoot, _T("SpawnRefreshTime"), (void*) &m_iSpawnRefreshtime, 5); AddValue(pDoc, pRoot, _T("NTService"), (void*) &m_bUseService, 5); Index: ServerConfiguration.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ServerConfiguration.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ServerConfiguration.h 23 May 2003 15:38:29 -0000 1.2 --- ServerConfiguration.h 19 Jun 2003 21:37:52 -0000 1.3 *************** *** 94,97 **** --- 94,100 ---- virtual ~CServerConfiguration(); + void DumpPackets(BOOL b) { m_bDumpPackets = b; } + BOOL DumpPackets() { return m_bDumpPackets; } + protected: int m_iServerPort; *************** *** 99,102 **** --- 102,106 ---- BOOL m_bReadOnly; BOOL m_bUseThreads; + BOOL m_bDumpPackets; int m_iMaxConnections; int m_iReceiveTimeout; Index: ServerObj.h =================================================================== RCS file: /cvsroot/sphere-axis/axissvr/ServerObj.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ServerObj.h 16 Jun 2003 22:05:59 -0000 1.4 --- ServerObj.h 19 Jun 2003 21:37:52 -0000 1.5 *************** *** 52,61 **** void ReloadConfig(); void SetGeometry(); - void DumpPackets(BOOL b) { m_bDumpPackets = b; } - #ifdef _DEBUG - BOOL DumpPackets() { return TRUE; } - #else - BOOL DumpPackets() { return m_bDumpPackets; } - #endif // We should make these protected! --- 52,55 ---- |