author | Michael Krelin <hacker@klever.net> | 2006-10-13 20:52:05 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2006-10-13 20:52:05 (UTC) |
commit | c47fbc86d50a0199fe9000a7df07609bb0a3bc77 (patch) (side-by-side diff) | |
tree | 87da1735014b97ce01ac754adc5843ecde33cd97 | |
parent | 325e7fc43721df3efaa8539190fada6e6e3aa8fa (diff) | |
download | pumpkin-c47fbc86d50a0199fe9000a7df07609bb0a3bc77.zip pumpkin-c47fbc86d50a0199fe9000a7df07609bb0a3bc77.tar.gz pumpkin-c47fbc86d50a0199fe9000a7df07609bb0a3bc77.tar.bz2 |
Increased default blocksize and added reject with explicit error message for
WRQ request in case I can see the file is too big for us.
git-svn-id: http://svn.klever.net/kin/pumpkin/trunk@193 fe716a7a-6dde-0310-88d9-d003556173a8
-rw-r--r-- | PumpKINDlg.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp index bb15211..f41b69f 100644 --- a/PumpKINDlg.cpp +++ b/PumpKINDlg.cpp @@ -98,3 +98,3 @@ CPumpKINDlg::CPumpKINDlg(CWnd* pParent /*=NULL*/) m_bExiting=FALSE;
- m_BlockSize=1024;
+ m_BlockSize=2048;
m_bnw.AssignSound("(bang)",IDR_WAVE_RING,CBellsNWhistles::CBang::bangResource);
@@ -1035,2 +1035,6 @@ BOOL CWRQSocket::OnTFTP(tftp* p) }
+ if(m_xferSize>=0 && m_xferSize>=(m_blkSize<<16)) {
+ Deny(tftp::errUndefined,IDS_TFTP_ERROR_TOOBIG);
+ return TRUE;
+ }
}
@@ -1411,2 +1415,7 @@ tftp::tftpOptions oack; m_ACK=0;
+ // XXX: see if we can negotiate the right block size somehow
+ if(m_xferSize>=0 && m_xferSize>=(m_blkSize<<16)) {
+ Deny(tftp::errUndefined,IDS_TFTP_ERROR_TOOBIG);
+ return TRUE;
+ }
state=stateXfer;
|