summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2006-10-13 19:13:18 (UTC)
committer Michael Krelin <hacker@klever.net>2006-10-13 19:13:18 (UTC)
commit325e7fc43721df3efaa8539190fada6e6e3aa8fa (patch) (unidiff)
treeec03bf74e17eb497e0fcd31b521192b0b14bd83e
parent577427e68ef10a4d2b75d28e42b22952ae3bcf23 (diff)
downloadpumpkin-325e7fc43721df3efaa8539190fada6e6e3aa8fa.zip
pumpkin-325e7fc43721df3efaa8539190fada6e6e3aa8fa.tar.gz
pumpkin-325e7fc43721df3efaa8539190fada6e6e3aa8fa.tar.bz2
Enabled logging of outgoing errors, added reject with explicit error message
when file is too large for the block size set. git-svn-id: http://svn.klever.net/kin/pumpkin/trunk@192 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--PumpKINDlg.cpp7
-rw-r--r--pumpkin.rc5
-rw-r--r--resource.h2
3 files changed, 10 insertions, 4 deletions
diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp
index 2a01918..bb15211 100644
--- a/PumpKINDlg.cpp
+++ b/PumpKINDlg.cpp
@@ -778,6 +778,11 @@ CFileException e;
778 o[tftpoTOut]=v; 778 o[tftpoTOut]=v;
779 } 779 }
780 } 780 }
781 // XXX: see if we can enforce our preference regarding block size here.
782 if(m_xferSize >= (m_blkSize<<16)) {
783 Deny(tftp::errUndefined,IDS_TFTP_ERROR_TOOBIG);
784 return TRUE;
785 }
781 state = stateXfer; 786 state = stateXfer;
782 m_ACK=0; 787 m_ACK=0;
783 if(o.GetCount()){ 788 if(o.GetCount()){
@@ -878,11 +883,9 @@ void CXferSocket::PostError(UINT errCode,UINT errID)
878CString msg; 883CString msg;
879 msg.LoadString(errID); 884 msg.LoadString(errID);
880 ASSERT(m_Daddy); 885 ASSERT(m_Daddy);
881 /*// ***
882CString tmp; 886CString tmp;
883 tmp.Format(IDS_LOG_SENTTFTPERROR,errCode,(LPCTSTR)msg); 887 tmp.Format(IDS_LOG_SENTTFTPERROR,errCode,(LPCTSTR)msg);
884 m_Daddy->LogLine(tmp); 888 m_Daddy->LogLine(tmp);
885 */
886tftp* err = tftp::Allocate(tftp::tftpERROR::tftpSize(msg)); 889tftp* err = tftp::Allocate(tftp::tftpERROR::tftpSize(msg));
887err->SetOpcode(tftp::opERROR); 890err->SetOpcode(tftp::opERROR);
888 err->errSet(errCode,msg); 891 err->errSet(errCode,msg);
diff --git a/pumpkin.rc b/pumpkin.rc
index 5ce2438..adca112 100644
--- a/pumpkin.rc
+++ b/pumpkin.rc
@@ -97,7 +97,7 @@ IDD_PUMPKIN_DIALOG DIALOGEX 0, 0, 362, 193
97STYLE DS_3DLOOK | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME 97STYLE DS_3DLOOK | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
98EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW 98EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW
99CAPTION " PumpKIN" 99CAPTION " PumpKIN"
100FONT 8, "MS Sans Serif" 100FONT 8, "MS Sans Serif", 0, 0, 0x1
101BEGIN 101BEGIN
102 CONTROL "List1",IDC_CONNECTIONS,"SysListView32",LVS_REPORT | 102 CONTROL "List1",IDC_CONNECTIONS,"SysListView32",LVS_REPORT |
103 LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP,7,7,295,108, 103 LVS_AUTOARRANGE | WS_BORDER | WS_TABSTOP,7,7,295,108,
@@ -562,7 +562,7 @@ BEGIN
562 IDS_LOG_XFERSEND "Error on xfer socket" 562 IDS_LOG_XFERSEND "Error on xfer socket"
563 IDS_LOG_XFERUDPRECEIVE "UDP packet receive failed" 563 IDS_LOG_XFERUDPRECEIVE "UDP packet receive failed"
564 IDS_LOG_XFERSOURCETID "Packet from unexpected source" 564 IDS_LOG_XFERSOURCETID "Packet from unexpected source"
565 IDS_LOG_SENTTFTPERROR ":%u: %s" 565 IDS_LOG_SENTTFTPERROR ">> %u: %s"
566 IDS_LOG_GOTTFTPERROR "TFTP:%u: %s" 566 IDS_LOG_GOTTFTPERROR "TFTP:%u: %s"
567 IDS_LOG_XFEROPCODE "Invalid opcode (%u) during transfer received" 567 IDS_LOG_XFEROPCODE "Invalid opcode (%u) during transfer received"
568 IDS_LOG_XFERRRQFINISHED "Transfer of '%s' has successfully completed" 568 IDS_LOG_XFERRRQFINISHED "Transfer of '%s' has successfully completed"
@@ -656,6 +656,7 @@ STRINGTABLE DISCARDABLE
656BEGIN 656BEGIN
657 IDS_INVALID_RULE "Invalid access rule." 657 IDS_INVALID_RULE "Invalid access rule."
658 IDS_LOG_LOGERROR "Error logging to '%s'" 658 IDS_LOG_LOGERROR "Error logging to '%s'"
659 IDS_TFTP_ERROR_TOOBIG "File is too big, try increasing block size"
659END 660END
660 661
661#endif // English (U.S.) resources 662#endif // English (U.S.) resources
diff --git a/resource.h b/resource.h
index 1bdce59..7961e5e 100644
--- a/resource.h
+++ b/resource.h
@@ -88,6 +88,8 @@
88#define IDS_INVALID_NETMASK 159 88#define IDS_INVALID_NETMASK 159
89#define IDS_INVALID_RULE 160 89#define IDS_INVALID_RULE 160
90#define IDS_LOG_LOGERROR 161 90#define IDS_LOG_LOGERROR 161
91#define IDS_TFTP_ERROR_TOOBIG 162
92#define IDS_LOG_DENYING 163
91#define IDC_KLEVERNET 1000 93#define IDC_KLEVERNET 1000
92#define IDC_CONNECTIONS 1001 94#define IDC_CONNECTIONS 1001
93#define IDC_LOG 1003 95#define IDC_LOG 1003