Mercurial > hg > pnewss
diff fetchnews.php @ 11:e0807e0b1a67
Added common.php, updated server synchronization to continue after a connection failure
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Sat, 18 Jun 2011 15:59:11 +0200 |
parents | ae0c67d72670 |
children | 7917bd536187 |
line wrap: on
line diff
--- a/fetchnews.php Thu Apr 21 00:01:32 2011 +0200 +++ b/fetchnews.php Sat Jun 18 15:59:11 2011 +0200 @@ -30,7 +30,10 @@ foreach ($db->evalAllAssoc('SELECT * FROM `peers`') as $peer) { $socket = stream_socket_client($peer['address']); - if ($socket === FALSE) die("Could not connect to peer $peer[address]\n"); + if ($socket === FALSE) { + print("Could not connect to peer $peer[address]\n"); + continue; + } $line = nntp_readline($socket); $code = strtok($line, " \t"); if ($code == 200) {