jaraco / irc

Full-featured Python IRC library for Python.
MIT License
392 stars 87 forks source link

"!I" in DCCreceive.py #107

Closed igel-kun closed 8 years ago

igel-kun commented 8 years ago

hi, I noticed that dccreceive.py sends some weird characters in line 48 whenever it receives a chunk of data. I couldn't find anything hinting at that in the DCC specifications and, in my tests, this actually disturbed the file transmission. What's the reason for sending this?

jaraco commented 8 years ago

I don't know. I assume it's part of the protocol. That value is the serialization of the length of characters received. If the DCC protocol says something else should be sent in that place, then we should work out a better protocol. Can you investigate and determine what should be happening?

igel-kun commented 8 years ago

okay, so http://www.kvirc.net/doc/doc_dcc_connection.html states:

client A sends blocks of data (usually 1-2 KB) and at every block awaits confirmation from the client B, that when receiving a block should reply 4 bytes containing an positive number specifying the total size of the file received up to that moment.

and http://www.irchelp.org/protocol/dccspec.html states:

The recipient should acknowledge each packet by transmitting the total number of bytes received as an unsigned, 4 byte integer in network byte order.

finally, according to https://docs.python.org/2/library/struct.html "!I" is the correct format too, so everything seems to be in order and I'll have to repeat my experiments...

igel-kun commented 8 years ago

okay, I could not reproduce the issue, sorry to bother you with this...