0

I'm using the Net_NNTP ->post() function. This posts a message to a NNTP server. Sometimes however (30-50% of the cases) the lasts 1 or 2 characters of every line of the message are truncated. Sometimes this works just fine.

I really can't find any way to replicate this; it's not about the text inserted in the message or so on, it's not about server load etc... I simply don't understand it.

How do you think should I debug it?


Here is some example code, acting the same as the the PHP's class.

$sh = fsockopen('nntp-server', 119);
fwrite($sh, "POST\r\n");
fwrite($sh, $article);
fwrite($sh, "\r\n.\r\n");

$article is always the same. The server i'm connecting to a cluster of know to be reliable servers of a respectable ISP, i don't think that to be the problem!

This really has no sense to me.

4

2 回答 2

2

however (30-50% of the cases) the lasts 1 or 2 characters of every line of the message are truncated

If you had entire line last lines missing, one could say non-intentional software error. But if you are loosing few bytes from every line, this is most likely intentional behavior by some software. Like forced word wrap or when you characters in your line are suddenly wrongly encoded (like utf). Maybe there is a bytes per lime limit set by this NNTP server.

Either way, i doubt that the request packet is exactly same when it passes and when it fails.

于 2012-05-06T12:26:03.810 回答
0

If it depends on input (i.e. some input always fails), just make a testscript providing that input and step through code using xdebug or the like, inspecting variables as you go.

于 2012-05-06T09:34:15.773 回答