⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perform.cpp

📁 mini http server,可以集成嵌入到程序中,实现简单的web功能
💻 CPP
📖 第 1 页 / 共 2 页
字号:
						};

					iTest = atoi( szBuf );
					if ( iTest<1 && iTest!=-1 )
						{
						/*
						** Give message and abort change
						*/
						MessageBox( hDlg, "Receive timeout must be in the range [-1,1..n]",
							"Configuration Error", MB_OK );
						SetFocus( hWndRecv );
						SendMessage( hWndRecv, EM_SETSEL, 0, -1 );
						SetWindowLong( hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE );
						return (TRUE);
						};
					AD_replaceValue( __pConfig, "General", "RecvTimeout", szBuf ); 

					/*
					** Send Timeout
					*/
					*szBuf = 0;
					::SendMessage( hWndSend, WM_GETTEXT, BUF_SIZE, (LPARAM)szBuf );
					iLen = strlen(szBuf);
					for( iTest=0; iTest<iLen; iTest++)
						{
						if ( isalpha( szBuf[iTest] ) )
							{
							/*
							** Give message and abort change
							*/
							MessageBox( hDlg, "Field contains alphanumeric characters.",
								"Configuration Error", MB_OK | MB_ICONEXCLAMATION );
							SetFocus( hWndSend );
							SendMessage( hWndSend, EM_SETSEL, 0, -1 );
							SetWindowLong( hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE );
							return (TRUE);
							};
						};

					iTest = atoi( szBuf );
					if ( iTest<1 && iTest!=-1 )
						{
						/*
						** Give message and abort change
						*/
						MessageBox( hDlg, "Send timeout must be in the range [-1,1..n]",
							"Configuration Error", MB_OK );
						SetFocus( hWndSend );
						SendMessage( hWndSend, EM_SETSEL, 0, -1 );
						SetWindowLong( hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE );
						return (TRUE);
						};
					AD_replaceValue( __pConfig, "General", "SendTimeout", szBuf ); 

					/*
					** Keep-Alive
					*/
					if ( ::SendMessage( hWndKeepOpen, BM_GETCHECK, 0, 0 )==BST_CHECKED )
						{ AD_replaceValue( __pConfig, "General", "KeepOpen", "On" ); }
					else
						{ AD_replaceValue( __pConfig, "General", "KeepOpen", "Off" ); };

					/*
					** Keep-Alive Count
					*/
					*szBuf = 0;
					::SendMessage( hWndAliveCount, WM_GETTEXT, BUF_SIZE, (LPARAM)szBuf );
					iTest = atoi( szBuf );
					if ( iTest<1 )
						{
						/*
						** Give message and abort change
						*/
						MessageBox( hDlg, "Keep-alive count must be in the range [1..n]",
							"Configuration Error", MB_OK );
						SetFocus( hWndAliveCount );
						SendMessage( hWndAliveCount, EM_SETSEL, 0, -1 );
						SetWindowLong( hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE );
						return (TRUE);
						};
					AD_replaceValue( __pConfig, "General", "KeepOpenCount", szBuf );

					/*
					** Keep-Alive Timeout
					*/
					*szBuf = 0;
					::SendMessage( hWndAliveTimeout, WM_GETTEXT, BUF_SIZE, (LPARAM)szBuf );
					iLen = strlen(szBuf);
					for( iTest=0; iTest<iLen; iTest++)
						{
						if ( isalpha( szBuf[iTest] ) )
							{
							/*
							** Give message and abort change
							*/
							MessageBox( hDlg, "Field contains alphanumeric characters.",
								"Configuration Error", MB_OK | MB_ICONEXCLAMATION );
							SetFocus( hWndAliveTimeout );
							SendMessage( hWndAliveTimeout, EM_SETSEL, 0, -1 );
							SetWindowLong( hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE );
							return (TRUE);
							};
						};

					iTest = atoi( szBuf );
					if ( iTest<1 && iTest!=-1 )
						{
						/*
						** Give message and abort change
						*/
						MessageBox( hDlg, "Keep-alive timeout must be in the range [-1,1..n]",
							"Configuration Error", MB_OK );
						SetFocus( hWndAliveTimeout );
						SendMessage( hWndAliveTimeout, EM_SETSEL, 0, -1 );
						SetWindowLong( hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE );
						return (TRUE);
						};
					AD_replaceValue( __pConfig, "General", "KeepOpenTimeout", szBuf );

					/*
					** DNS Reverse Lookup
					*/
					if ( ::SendMessage( hWndReverse, BM_GETCHECK, 0, 0 )==BST_CHECKED )
						{ AD_replaceValue( __pConfig, "General", "DNSReverseLookup", "On" ); }
					else
						{ AD_replaceValue( __pConfig, "General", "DNSReverseLookup", "" ); };

					/*
					** Debug-Log
					*/
					if ( ::SendMessage( hWndDebug, BM_GETCHECK, 0, 0 )==BST_CHECKED )
						{
						AD_replaceValue( __pConfig, "General", "Debug", "On" );
						/*
						** Give warning message
						*/
						MessageBox( hDlg, "Debug log is extremely verbose. Don't even \
think about using it in a production server.", "Debug Log Warning", MB_OK | MB_ICONWARNING );
						}
					else
						{ AD_replaceValue( __pConfig, "General", "Debug", "" ); };

					/*
					** Error-Log
					*/
					if ( ::SendMessage( hWndErrorLog, BM_GETCHECK, 0, 0 )==BST_CHECKED )
						{ AD_replaceValue( __pConfig, "General", "ErrorLog", "On" ); }
					else
						{ AD_replaceValue( __pConfig, "General", "ErrorLog", "" ); };

					/*
					** Processes
					*/
					*szBuf = 0;
					SendMessage( hWndProcs, WM_GETTEXT, BUF_SIZE, (LPARAM)szBuf );
					iTest = atoi( szBuf );
					if ( iTest<1 || iTest>512 )
						{
						/*
						** Give message and abort change
						*/
						MessageBox( hDlg, "Processes must be in the range [1..512]",
							"Configuration Error", MB_OK );
						SetFocus( hWndProcs );
						SendMessage( hWndProcs, EM_SETSEL, 0, -1 );
						SetWindowLong( hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE );
						return (TRUE);
						};
					AD_replaceValue( __pConfig, "General", "Processes", szBuf ); 

					/*
					** ExitAfter
					*/
					*szBuf = 0;
					SendMessage( hWndExitAfter, WM_GETTEXT, BUF_SIZE, (LPARAM)szBuf );
					iLen = strlen(szBuf);
					for( iTest=0; iTest<iLen; iTest++)
						{
						if ( isalpha( szBuf[iTest] ) )
							{
							/*
							** Give message and abort change
							*/
							MessageBox( hDlg, "Field contains alphanumeric characters.",
								"Configuration Error", MB_OK | MB_ICONEXCLAMATION );
							SetFocus( hWndExitAfter );
							SendMessage( hWndExitAfter, EM_SETSEL, 0, -1 );
							SetWindowLong( hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE );
							return (TRUE);
							};
						};

					iTest = atoi( szBuf );
					if ( iTest<1 && iTest!=-1 )
						{
						/*
						** Give message and abort change
						*/
						MessageBox( hDlg, "Exit-after must be in the range [-1,1..n]",
							"Configuration Error", MB_OK );
						SetFocus( hWndExitAfter );
						SendMessage( hWndExitAfter, EM_SETSEL, 0, -1 );
						SetWindowLong( hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE );
						return (TRUE);
						};
					AD_replaceValue( __pConfig, "General", "ExitAfter", szBuf ); 

					/*
					** Reuse Threads
					*/
					if ( ::SendMessage( hWndReuse, BM_GETCHECK, 0, 0 )==BST_CHECKED )
						{ AD_replaceValue( __pConfig, "General", "ReuseThreads", "On" ); }
					else
						{ AD_replaceValue( __pConfig, "General", "ReuseThreads", "" ); };
					}
					SetWindowLong( hDlg, DWL_MSGRESULT, FALSE );
					return (TRUE);

				default:
					return (FALSE);
				};
			break;

		default:
			return (FALSE);
		};

	return (TRUE);
}

/*____________________________________________________________________________*\
 *
 Description:
	Definitions and global values
\*____________________________________________________________________________*/
DLGPROC fnPerformance = (DLGPROC)DialogProc;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -