-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DCC Send fails on filenames with whitespace #318
Comments
@dahlend feel free to take a stab at it! We will assist you if you run into any issues. Thanks for the bug report, great to catch this before we ship it. |
Thanks for the report @dahlend. Yeah I didn't attempt to address this initially. Halloy sanitizes file names before trying to send them, so I assume this is something sent from another client which doesn't (unfortunate). Considering in your example the filename isn't quoted, then it's going to come down to collecting the iterator into a vec (unless we have an exact sized iterator) to see how many items it has and take appropriate action off that info. After checking size, if it's > 4 or 5 we know the filename probably has spaces. We should instead process the items in reverse order, so size, port, host then the rest is filename. If it's a reverse send request, we may have the token at the very end and port is 0, so we will need to account for that. |
These are bots I am interfacing with which send files like this (and have a single space char before the " DCC SEND", which is why i mention @tarkah Yeah that was roughly the outline I had also considered. I am not sure I have the cycles for a bit. |
So the space you're seeing before DCC is probably the 0x01 byte which denotes this is a ctcp message, which is how we know to parse the PRIVMSG as such. We discard this so we're good on this front 👍 I can take a look but it might be a little bit before I get to it as well. |
I have had issues with bots sending files and nothing arriving my end as well, some bots send files fine though |
Is this a different issue than filenames with whitespace? If so feel free to open a new issue with some information around the issue :) |
These lines linked below, if the filename contains a space such as:
"DCC SEND Example file name.txt (127.0.0.1)"
The iterator spits out "Example" as the filename, then attempts to parse the rest as an IP.
halloy/data/src/dcc.rs
Lines 69 to 70 in 698eef8
Also on line 11 I'm unsure but you may want to throw a
.trim()
to strip white space before the iterator call?I may take a stab at putting a PR in for this, but I'm a little unclear of all the surrounding logic still. No promises.
Good stuff though, nicely written!
The text was updated successfully, but these errors were encountered: