summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2004-11-04 20:04:19 (UTC)
committer Michael Krelin <hacker@klever.net>2004-11-04 20:04:19 (UTC)
commita494b6d595059d6fb6464935e429176a714d490d (patch) (side-by-side diff)
tree20b82b6d6512ace8abcc7774d0a9c9d7c0bcfbb2
parent5f552506513653f08acc6921b8c158489a7ebbbb (diff)
downloadpumpkin-a494b6d595059d6fb6464935e429176a714d490d.zip
pumpkin-a494b6d595059d6fb6464935e429176a714d490d.tar.gz
pumpkin-a494b6d595059d6fb6464935e429176a714d490d.tar.bz2
invalid opcode during xfer message shows the opcode itself now.
git-svn-id: http://svn.klever.net/kin/pumpkin/trunk@48 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--PumpKINDlg.cpp12
-rw-r--r--pumpkin.rc2
2 files changed, 11 insertions, 3 deletions
diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp
index fc24596..b6b8a36 100644
--- a/PumpKINDlg.cpp
+++ b/PumpKINDlg.cpp
@@ -920,51 +920,55 @@ BOOL rv = TRUE;
}
}
UpdateList();
DoXfer();
}
break;
case tftp::opACK:
m_ACK=p->data.m_ACK.Block();
if(state!=stateFinish){
UpdateList();
DoXfer();
}
break;
case tftp::opERROR:
{
ASSERT(m_Daddy);
CString tmp;
tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage());
m_Daddy->LogLine(tmp);
}
Destroy(FALSE);
rv = FALSE;
break;
default:
+ {
ASSERT(m_Daddy);
- m_Daddy->LogLine(IDS_LOG_XFEROPCODE);
+ CString tmp;
+ tmp.Format(IDS_LOG_XFEROPCODE,p->Opcode());
+ m_Daddy->LogLine(tmp);
// *** Self destruct maybe??
+ }
break;
}
return rv;
}
BOOL CWRQSocket::OnTFTP(tftp* p)
{
switch(p->Opcode()){
case tftp::opOACK:
ASSERT(state!=stateFinish);
{
if(m_bResume)
m_ACK=m_File.GetLength()/m_blkSize;
else
m_ACK=0;
tftp::tftpOptions o;
if(p->GetOptions(&o)){
CString v;
if(o.Lookup(tftpoBSize,v)){
m_blkSize=atoi(v);
if(!m_blkSize){ // *** More sanity checks
Deny(tftp::errOption,IDS_TFTP_ERROR_BSIZE);
return TRUE;
}
@@ -1000,51 +1004,55 @@ BOOL CWRQSocket::OnTFTP(tftp* p)
ASSERT(m_Daddy);
CString tmp;
tmp.Format(IDS_LOG_XFERWRQFINISHED,(LPCTSTR)m_FileName);
m_Daddy->LogLine(tmp);
}
m_ACK=block;
m_LastSlack=m_blkSize-bytes;
UpdateList();
DoXfer();
}CATCH(CFileException,e){
Deny(e);
}END_CATCH
}
break;
case tftp::opERROR:
{
ASSERT(m_Daddy);
CString tmp;
tmp.Format(IDS_LOG_GOTTFTPERROR,p->data.m_ERROR.Code(),(LPCTSTR)p->errMessage());
m_Daddy->LogLine(tmp);
}
Destroy(FALSE);
return FALSE;
default:
+ {
ASSERT(m_Daddy);
- m_Daddy->LogLine(IDS_LOG_XFEROPCODE);
+ CString tmp;
+ tmp.Format(IDS_LOG_XFEROPCODE,p->Opcode());
+ m_Daddy->LogLine(tmp);
// *** Self destruct maybe??
+ }
break;
}
return TRUE;
}
void tftp::SetOpcode(WORD op)
{
opcode = REVERSEBYTES(op);
}
void tftp::tftpDATA::SetBlock(WORD b)
{
block=REVERSEBYTES(b);
}
WORD tftp::tftpDATA::Block()
{
return REVERSEBYTES(block);
}
WORD tftp::tftpACK::Block()
{
return REVERSEBYTES(block);
}
void tftp::tftpACK::SetBlock(WORD b)
{
block = REVERSEBYTES(b);
diff --git a/pumpkin.rc b/pumpkin.rc
index 7f3bbde..1bf0fd3 100644
--- a/pumpkin.rc
+++ b/pumpkin.rc
@@ -474,49 +474,49 @@ BEGIN
IDS_FMT_BYTES "%lu"
IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
IDS_TFTP_ERROR_ACCESS "Access violation"
IDS_TFTP_ERROR_NOTFOUND "File not found"
IDS_TFTP_ERROR_DIRFULL "Directory is full"
IDS_TFTP_ERROR_SHARING "Sharing violation"
IDS_TFTP_ERROR_DISKFULL "Disk full"
IDS_TFTP_ERROR_UNDEFINED "Undefined error"
IDS_LOG_START "PumpKIN started"
IDS_LOG_LISTENRECEIVEERROR "Error listening for incoming connections"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_LOG_LISTENACCEPTERROR "Error accepting incoming connection"
IDS_LOG_RRQSERVE "'%s' of type '%s' is requested from %s"
IDS_LOG_LISTENOPCODE "Invalid opcode in initial connection request"
IDS_LOG_XFERUDPSEND "UDP packet send failed"
IDS_LOG_XFERRECEIVE "Error on xfer socket"
IDS_LOG_XFERSEND "Error on xfer socket"
IDS_LOG_XFERUDPRECEIVE "UDP packet receive failed"
IDS_LOG_XFERSOURCETID "Packet from unexpected source"
IDS_LOG_SENTTFTPERROR ":%u: %s"
IDS_LOG_GOTTFTPERROR "TFTP:%u: %s"
- IDS_LOG_XFEROPCODE "Invalid opcode during transfer received"
+ IDS_LOG_XFEROPCODE "Invalid opcode (%u) during transfer received"
IDS_LOG_XFERRRQFINISHED "Transfer of '%s' has successfully completed"
IDS_TITLE_OPTIONS "Options"
IDS_LOG_WRQSERVE "Writing of '%s' of type '%s' is requested by %s"
IDS_TFTP_ERROR_FAILEDTORENAME "Too many clones of the file"
IDS_RENAME_TITLE "Save As"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_LOG_TIMEDOUT "Transmission of '%s' is timed out"
IDS_CONFIRMEXIT_TITLE "Exit"
IDS_CONFIRMEXIT_TEXT "File transmission is currently in progress. Are you sure you want to exit?"
IDS_LOG_XFERWRQFINISHED "Transfer of '%s' has successfully completed"
IDS_LOG_XFERABORTED "Transfer of '%s' was aborted"
IDS_TITLE_PUTREQUEST "Send file"
IDS_TITLE_GETREQUEST "Fetch file"
IDS_WTALKHEADING "Talk with "
IDS_TITLE_BROWSEFILE "Browse"
IDS_LOG_RESOLVEFAILED "Failed to resolve host address for '%s'"
IDS_LOG_FAILEDLOCALFILE "Failed to open local file '%s'"
IDS_LOG_FAILEDTOOPEN "Failed to open '%s'"
IDS_OTALXHEADING "Open Talks: talking to "
IDS_REGISTRYKEY "Klever Group"
IDS_KLEVERNET_URL "http://www.klever.net/"