Permalink
Browse files

Receiving DCC transfers fail with certain iroffer daemons. The bounce…

…dcc module ignores file name quotes sent by the server (e.g. when the file name contains spaces) and consequently parses the DCC parameters incorrectly.


Fixes #289
  • Loading branch information...
kobuki committed May 5, 2014
1 parent 2f0bc0c commit 5d13cd9da2d94fdb593aed3b7fff8e33b0535c02
Showing with 10 additions and 10 deletions.
  1. +10 −10 modules/bouncedcc.cpp
View
@@ -160,11 +160,11 @@ class CBounceDCCMod : public CModule {
virtual EModRet OnUserCTCP(CString& sTarget, CString& sMessage) {
if (sMessage.Equals("DCC ", false, 4)) {
- CString sType = sMessage.Token(1);
- CString sFile = sMessage.Token(2);
- unsigned long uLongIP = sMessage.Token(3).ToULong();
- unsigned short uPort = sMessage.Token(4).ToUShort();
- unsigned long uFileSize = sMessage.Token(5).ToULong();
+ CString sType = sMessage.Token(1, false, " ", false, "\"", "\"", true);
+ CString sFile = sMessage.Token(2, false, " ", false, "\"", "\"", false);
+ unsigned long uLongIP = sMessage.Token(3, false, " ", false, "\"", "\"", true).ToULong();
+ unsigned short uPort = sMessage.Token(4, false, " ", false, "\"", "\"", true).ToUShort();
+ unsigned long uFileSize = sMessage.Token(5, false, " ", false, "\"", "\"", true).ToULong();
CString sIP = GetLocalDCCIP();
if (!UseClientIP()) {
@@ -215,11 +215,11 @@ class CBounceDCCMod : public CModule {
virtual EModRet OnPrivCTCP(CNick& Nick, CString& sMessage) {
if (sMessage.Equals("DCC ", false, 4) && m_pNetwork->IsUserAttached()) {
// DCC CHAT chat 2453612361 44592
- CString sType = sMessage.Token(1);
- CString sFile = sMessage.Token(2);
- unsigned long uLongIP = sMessage.Token(3).ToULong();
- unsigned short uPort = sMessage.Token(4).ToUShort();
- unsigned long uFileSize = sMessage.Token(5).ToULong();
+ CString sType = sMessage.Token(1, false, " ", false, "\"", "\"", true);
+ CString sFile = sMessage.Token(2, false, " ", false, "\"", "\"", false);
+ unsigned long uLongIP = sMessage.Token(3, false, " ", false, "\"", "\"", true).ToULong();
+ unsigned short uPort = sMessage.Token(4, false, " ", false, "\"", "\"", true).ToUShort();
+ unsigned long uFileSize = sMessage.Token(5, false, " ", false, "\"", "\"", true).ToULong();
if (sType.Equals("CHAT")) {
CNick FromNick(Nick.GetNickMask());

0 comments on commit 5d13cd9

Please sign in to comment.