summaryrefslogtreecommitdiffabout
path: root/PumpKINDlg.cpp
Side-by-side diff
Diffstat (limited to 'PumpKINDlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--PumpKINDlg.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp
index 2a01918..bb15211 100644
--- a/PumpKINDlg.cpp
+++ b/PumpKINDlg.cpp
@@ -769,24 +769,29 @@ CFileException e;
if(m_Options.Lookup(tftpoTSize,v)){
v.Format("%lu",m_xferSize);
o[tftpoTSize]=v;
}
if(m_Options.Lookup(tftpoTOut,v)){
m__timeOut=atoi(v);
if(m__timeOut){
m_timeOut=m__timeOut;
v.Format("%u",m_timeOut);
o[tftpoTOut]=v;
}
}
+ // XXX: see if we can enforce our preference regarding block size here.
+ if(m_xferSize >= (m_blkSize<<16)) {
+ Deny(tftp::errUndefined,IDS_TFTP_ERROR_TOOBIG);
+ return TRUE;
+ }
state = stateXfer;
m_ACK=0;
if(o.GetCount()){
tftp *p = tftp::Allocate(tftp::tftpOACK::tftpSize(&o));
ASSERT(p);
p->SetOpcode(tftp::opOACK);
p->data.m_OACK.Set(&o);
PostTFTP(p,TRUE);
}else
DoXfer();
}
return TRUE;
@@ -869,29 +874,27 @@ UINT tftp::tftpDATA::tftpSize(UINT blkSize)
void CXferSocket::Deny(CFileException* e)
{
PostError(e);
state=stateDeny;
}
void CXferSocket::PostError(UINT errCode,UINT errID)
{
CString msg;
msg.LoadString(errID);
ASSERT(m_Daddy);
-/* // ***
CString tmp;
tmp.Format(IDS_LOG_SENTTFTPERROR,errCode,(LPCTSTR)msg);
m_Daddy->LogLine(tmp);
- */
tftp* err = tftp::Allocate(tftp::tftpERROR::tftpSize(msg));
err->SetOpcode(tftp::opERROR);
err->errSet(errCode,msg);
PostTFTP(err);
}
void CXferSocket::PostError(CFileException* e)
{
UINT eCode;
UINT eMsgID;
switch(e->m_cause){
case CFileException::fileNotFound: