I am indeed using NNTP, but really I'm not even looking at cr+lf etc...

Basically I'm sending the following command to retrieve a message:
"ARTICLE <message-id>\r\n"

Then I'm reading all the data up until \r\n.\r\n is found.... (that is, a new line, a dot, and a new line again) which marks the end of an email.... and I'm saving that data to the disk

mmm, now that I say it like that though.... a dot on a newline marks the end of a message... and my problem is that I have dot inserted on new lines? can't be a coincidence!... but then again, I'm using AsyncSocket's "readToData" function... so I don't have much control over that...



On 19-Dec-08, at 1:34 PM, glenn andreas wrote:


On Dec 19, 2008, at 12:24 PM, Jean-Nicolas Jolivet wrote:

Well after comparing the data that I am receiving with the data that I SHOULD be receiving, it turns out that dots (yes, the dot character (.) ) are added all over the place in the data.... if I have 10 extra bytes, it means 10 extra dots were added to my data, so for example, a line that SHOULD read:

.m;{äMã≈P#ü1ˆTMë&L>ÆÖ-«∏4iˇ¯àÚPë‡gêæ¯Ø

Instead reads:
..m;{äMã≈P#ü1ˆTMë&L>ÆÖ-«∏4iˇ¯àÚPë‡gêæ¯Ø

Notice the extra dot at the beginning of the line... it turns out that ALL the extra dots that gets added are at the beginning of lines, when there is already a dot there....

Now, that data is downloaded straight from the socket and saved to disk, I am not adding/merging nor doing anything with it so I wonder if it's not a bug with AsyncSocket?? but I guess if it were adding dots all over the place people would've notice it already... I'm out of ideas here really!



I could be wrong on this, but assuming you're using NNTP, ISTR it documented to have lines separated by cr+lf? And that the multi- part stuff is based lines separated by those pairs - and if you separate into lines based one only one of them, the extra will get added (erroneously) to the line?



Glenn Andreas                      gandr...@gandreas.com
<http://www.gandreas.com/> wicked fun!
Cardographer | the custom playing card designer



Jean-Nicolas Jolivet
silver...@videotron.ca
http://www.silverscripting.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to