comparison fetchnews.php @ 7:01dc7eeaf5df

Added some more checks to article data, added some commands, added 'dot stuffing' for block transfers
author Ivo Smits <Ivo@UCIS.nl>
date Tue, 12 Apr 2011 14:10:41 +0200
parents 0dcdb73cbcbf
children 005339a1b2ce
comparison
equal deleted inserted replaced
6:bc6045ed0b2e 7:01dc7eeaf5df
86 $line = NULL; 86 $line = NULL;
87 break; 87 break;
88 default: 88 default:
89 print("Sending unknown header $parts[0]\n"); 89 print("Sending unknown header $parts[0]\n");
90 } 90 }
91 if ($line !== NULL) nntp_writeline($socket, $line); 91 if ($line !== NULL) nntp_writeline_data($socket, $line);
92 } 92 }
93 nntp_writeline($socket, ''); 93 nntp_writeline($socket, '');
94 foreach (explode("\r\n", $article['body']) as $line) nntp_writeline($socket, $line); 94 foreach (explode("\r\n", $article['body']) as $line) nntp_writeline_data($socket, $line);
95 nntp_writeline($socket, '.'); 95 nntp_writeline($socket, '.');
96 $line = nntp_readline($socket); 96 $line = nntp_readline($socket);
97 $code = strtok($line, " \t"); 97 $code = strtok($line, " \t");
98 if ($code != 240) print("Article $article[messageid] was not accepted ($code)\n"); 98 if ($code != 240) print("Article $article[messageid] was not accepted ($code)\n");
99 if ($article['id'] > $peer['lastposted']) $peer['lastposted'] = $article['id']; 99 if ($article['id'] > $peer['lastposted']) $peer['lastposted'] = $article['id'];