-rwxr-xr-x | PumpKINDlg.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp index 3ff1500..0c5c19b 100755 --- a/PumpKINDlg.cpp +++ b/PumpKINDlg.cpp | |||
@@ -1225,12 +1225,13 @@ CPropsACL acl; | |||
1225 | server.m_TFTPSubdirs=m_bTFTPSubdirs; | 1225 | server.m_TFTPSubdirs=m_bTFTPSubdirs; |
1226 | server.m_WRQMode=m_WRQMode; | 1226 | server.m_WRQMode=m_WRQMode; |
1227 | server.m_PromptTimeOut=m_PromptTimeOut; | 1227 | server.m_PromptTimeOut=m_PromptTimeOut; |
1228 | server.m_LogFile=m_LogFile; | 1228 | server.m_LogFile=m_LogFile; |
1229 | 1229 | ||
1230 | network.m_ListenPort=m_ListenPort; | 1230 | network.m_ListenPort=m_ListenPort; |
1231 | network.m_ListenAddress=m_ListenAddress; | ||
1231 | network.m_SpeakPort=m_SpeakPort; | 1232 | network.m_SpeakPort=m_SpeakPort; |
1232 | network.m_TimeOut=m_TFTPTimeOut.GetTotalSeconds(); | 1233 | network.m_TimeOut=m_TFTPTimeOut.GetTotalSeconds(); |
1233 | network.m_BlockSize=m_BlockSize; | 1234 | network.m_BlockSize=m_BlockSize; |
1234 | 1235 | ||
1235 | sounds.m_Request = m_bnwRequest; | 1236 | sounds.m_Request = m_bnwRequest; |
1236 | sounds.m_Success = m_bnwSuccess; | 1237 | sounds.m_Success = m_bnwSuccess; |
@@ -1248,12 +1249,13 @@ CPropsACL acl; | |||
1248 | m_bTFTPSubdirs=server.m_TFTPSubdirs; | 1249 | m_bTFTPSubdirs=server.m_TFTPSubdirs; |
1249 | m_WRQMode=server.m_WRQMode; | 1250 | m_WRQMode=server.m_WRQMode; |
1250 | m_PromptTimeOut=server.m_PromptTimeOut; | 1251 | m_PromptTimeOut=server.m_PromptTimeOut; |
1251 | m_LogFile=server.m_LogFile; | 1252 | m_LogFile=server.m_LogFile; |
1252 | 1253 | ||
1253 | m_ListenPort=network.m_ListenPort; | 1254 | m_ListenPort=network.m_ListenPort; |
1255 | m_ListenAddress=network.m_ListenAddress; | ||
1254 | m_SpeakPort=network.m_SpeakPort; | 1256 | m_SpeakPort=network.m_SpeakPort; |
1255 | m_TFTPTimeOut=CTimeSpan(network.m_TimeOut); | 1257 | m_TFTPTimeOut=CTimeSpan(network.m_TimeOut); |
1256 | m_BlockSize=network.m_BlockSize; | 1258 | m_BlockSize=network.m_BlockSize; |
1257 | 1259 | ||
1258 | m_bnwRequest = sounds.m_Request; | 1260 | m_bnwRequest = sounds.m_Request; |
1259 | m_bnwSuccess = sounds.m_Success; | 1261 | m_bnwSuccess = sounds.m_Success; |
@@ -1872,12 +1874,13 @@ CWinApp *app = AfxGetApp(); | |||
1872 | m_bListen=app->GetProfileInt("TFTPSettings","Listen",m_bListen); | 1874 | m_bListen=app->GetProfileInt("TFTPSettings","Listen",m_bListen); |
1873 | m_bnwRequest=app->GetProfileString("BellsNWhistles","Request",m_bnwRequest); | 1875 | m_bnwRequest=app->GetProfileString("BellsNWhistles","Request",m_bnwRequest); |
1874 | m_bnwSuccess=app->GetProfileString("BellsNWhistles","Success",m_bnwSuccess); | 1876 | m_bnwSuccess=app->GetProfileString("BellsNWhistles","Success",m_bnwSuccess); |
1875 | m_bnwAbort=app->GetProfileString("BellsNWhistles","Abort",m_bnwAbort); | 1877 | m_bnwAbort=app->GetProfileString("BellsNWhistles","Abort",m_bnwAbort); |
1876 | m_bTFTPSubdirs=app->GetProfileInt("TFTPSettings","Subdirs",m_bTFTPSubdirs); | 1878 | m_bTFTPSubdirs=app->GetProfileInt("TFTPSettings","Subdirs",m_bTFTPSubdirs); |
1877 | m_ListenPort=app->GetProfileInt("TFTPSettings","ListenPort",m_ListenPort); | 1879 | m_ListenPort=app->GetProfileInt("TFTPSettings","ListenPort",m_ListenPort); |
1880 | m_ListenAddress=app->GetProfileString("TFTPSettings","ListenAddress",m_ListenAddress); | ||
1878 | m_LogLength=app->GetProfileInt("UISettings","LogLength",m_LogLength); | 1881 | m_LogLength=app->GetProfileInt("UISettings","LogLength",m_LogLength); |
1879 | m_PromptTimeOut=app->GetProfileInt("UISettings","PromptTimeout",m_PromptTimeOut); | 1882 | m_PromptTimeOut=app->GetProfileInt("UISettings","PromptTimeout",m_PromptTimeOut); |
1880 | m_RRQMode=app->GetProfileInt("TFTPSettings","RRQMode",m_RRQMode); | 1883 | m_RRQMode=app->GetProfileInt("TFTPSettings","RRQMode",m_RRQMode); |
1881 | m_SpeakPort=app->GetProfileInt("TFTPSettings","SpeakPort",m_SpeakPort); | 1884 | m_SpeakPort=app->GetProfileInt("TFTPSettings","SpeakPort",m_SpeakPort); |
1882 | m_TFTPRoot=app->GetProfileString("TFTPSettings","TFTPRoot",m_TFTPRoot); | 1885 | m_TFTPRoot=app->GetProfileString("TFTPSettings","TFTPRoot",m_TFTPRoot); |
1883 | m_LogFile=app->GetProfileString("General","LogFile",m_LogFile); | 1886 | m_LogFile=app->GetProfileString("General","LogFile",m_LogFile); |
@@ -1902,12 +1905,13 @@ CWinApp *app = AfxGetApp(); | |||
1902 | app->WriteProfileInt("TFTPSettings","Listen",m_bListen); | 1905 | app->WriteProfileInt("TFTPSettings","Listen",m_bListen); |
1903 | app->WriteProfileString("BellsNWhistles","Request",m_bnwRequest); | 1906 | app->WriteProfileString("BellsNWhistles","Request",m_bnwRequest); |
1904 | app->WriteProfileString("BellsNWhistles","Success",m_bnwSuccess); | 1907 | app->WriteProfileString("BellsNWhistles","Success",m_bnwSuccess); |
1905 | app->WriteProfileString("BellsNWhistles","Abort",m_bnwAbort); | 1908 | app->WriteProfileString("BellsNWhistles","Abort",m_bnwAbort); |
1906 | app->WriteProfileInt("TFTPSettings","Subdirs",m_bTFTPSubdirs); | 1909 | app->WriteProfileInt("TFTPSettings","Subdirs",m_bTFTPSubdirs); |
1907 | app->WriteProfileInt("TFTPSettings","ListenPort",m_ListenPort); | 1910 | app->WriteProfileInt("TFTPSettings","ListenPort",m_ListenPort); |
1911 | app->WriteProfileString("TFTPSettings","ListenAddress",m_ListenAddress); | ||
1908 | app->WriteProfileInt("UISettings","LogLength",m_LogLength); | 1912 | app->WriteProfileInt("UISettings","LogLength",m_LogLength); |
1909 | app->WriteProfileInt("UISettings","PromptTimeout",m_PromptTimeOut); | 1913 | app->WriteProfileInt("UISettings","PromptTimeout",m_PromptTimeOut); |
1910 | app->WriteProfileInt("TFTPSettings","RRQMode",m_RRQMode); | 1914 | app->WriteProfileInt("TFTPSettings","RRQMode",m_RRQMode); |
1911 | app->WriteProfileInt("TFTPSettings","SpeakPort",m_SpeakPort); | 1915 | app->WriteProfileInt("TFTPSettings","SpeakPort",m_SpeakPort); |
1912 | app->WriteProfileString("TFTPSettings","TFTPRoot",m_TFTPRoot); | 1916 | app->WriteProfileString("TFTPSettings","TFTPRoot",m_TFTPRoot); |
1913 | app->WriteProfileString("General","LogFile",m_LogFile); | 1917 | app->WriteProfileString("General","LogFile",m_LogFile); |
@@ -2064,22 +2068,20 @@ void CPumpKINDlg::OnHelp() | |||
2064 | { | 2068 | { |
2065 | AfxGetApp()->WinHelp(0,HELP_FINDER); | 2069 | AfxGetApp()->WinHelp(0,HELP_FINDER); |
2066 | } | 2070 | } |
2067 | 2071 | ||
2068 | BOOL CListenSocket::SetListen(BOOL b) { | 2072 | BOOL CListenSocket::SetListen(BOOL b) { |
2069 | ASSERT(m_Daddy); | 2073 | ASSERT(m_Daddy); |
2070 | if(b==m_bListen) | 2074 | if(b==m_bListen) return TRUE; |
2071 | return TRUE; | 2075 | if(!b) { |
2072 | if(b) { | ||
2073 | if(!Create(m_Daddy->m_ListenPort,SOCK_DGRAM)) | ||
2074 | return FALSE; | ||
2075 | return m_bListen=TRUE; | ||
2076 | }else{ | ||
2077 | Close(); m_bListen=FALSE; | 2076 | Close(); m_bListen=FALSE; |
2078 | return TRUE; | 2077 | return TRUE; |
2079 | } | 2078 | } |
2079 | return m_bListen=Create(m_Daddy->m_ListenPort,SOCK_DGRAM, | ||
2080 | FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT|FD_CLOSE, | ||
2081 | m_Daddy->m_ListenAddress.IsEmpty()?NULL:(LPCTSTR)m_Daddy->m_ListenAddress); | ||
2080 | } | 2082 | } |
2081 | 2083 | ||
2082 | void CPumpKINDlg::OnListening() | 2084 | void CPumpKINDlg::OnListening() |
2083 | { | 2085 | { |
2084 | if(!m_Listener.SetListen(m_ListenCtl.GetCheck()==1)) { | 2086 | if(!m_Listener.SetListen(m_ListenCtl.GetCheck()==1)) { |
2085 | TRACE0("Failed to create socket\n"); | 2087 | TRACE0("Failed to create socket\n"); |