From: <th...@us...> - 2010-04-11 14:15:00
|
Revision: 1807 http://azsmrc.svn.sourceforge.net/azsmrc/?rev=1807&view=rev Author: the8472 Date: 2010-04-11 14:14:54 +0000 (Sun, 11 Apr 2010) Log Message: ----------- handle exceptions on write Modified Paths: -------------- mldht/trunk/DHTIndexer.jar mldht/trunk/lbms/plugins/mldht/indexer/InfoHashLogger.java mldht/trunk/lbms/plugins/mldht/indexer/PullMetaDataConnection.java mldht/trunk/lbms/plugins/mldht/indexer/TorrentFinder.java Modified: mldht/trunk/DHTIndexer.jar =================================================================== (Binary files differ) Modified: mldht/trunk/lbms/plugins/mldht/indexer/InfoHashLogger.java =================================================================== --- mldht/trunk/lbms/plugins/mldht/indexer/InfoHashLogger.java 2010-04-11 12:54:21 UTC (rev 1806) +++ mldht/trunk/lbms/plugins/mldht/indexer/InfoHashLogger.java 2010-04-11 14:14:54 UTC (rev 1807) @@ -49,6 +49,7 @@ entry = new TorrentDBEntry(); entry.info_hash = hash; entry.added = System.currentTimeMillis()/1000; + //System.out.println("adding entry for "+entry.info_hash+" updated:"+entry.added); entry.status = 0; session.save(entry); } Modified: mldht/trunk/lbms/plugins/mldht/indexer/PullMetaDataConnection.java =================================================================== --- mldht/trunk/lbms/plugins/mldht/indexer/PullMetaDataConnection.java 2010-04-11 12:54:21 UTC (rev 1806) +++ mldht/trunk/lbms/plugins/mldht/indexer/PullMetaDataConnection.java 2010-04-11 14:14:54 UTC (rev 1807) @@ -371,15 +371,22 @@ public void canWriteEvent() throws IOException { ByteBuffer outBuf = outputBuffers.pollFirst(); - while(outBuf != null) + try { - channel.write(outBuf); - if(outBuf.hasRemaining()) { - outputBuffers.addFirst(outBuf); - outBuf = null; - } else { - outBuf = outputBuffers.pollFirst(); + while(outBuf != null) + { + channel.write(outBuf); + if(outBuf.hasRemaining()) { + outputBuffers.addFirst(outBuf); + outBuf = null; + } else { + outBuf = outputBuffers.pollFirst(); + } } + } catch (IOException e) + { + terminate("error on write, cause: "+e.getMessage()); + return; } if(outputBuffers.size() == 0) Modified: mldht/trunk/lbms/plugins/mldht/indexer/TorrentFinder.java =================================================================== --- mldht/trunk/lbms/plugins/mldht/indexer/TorrentFinder.java 2010-04-11 12:54:21 UTC (rev 1806) +++ mldht/trunk/lbms/plugins/mldht/indexer/TorrentFinder.java 2010-04-11 14:14:54 UTC (rev 1807) @@ -139,6 +139,8 @@ TorrentDBEntry entry = (TorrentDBEntry) entries.get(0); + //System.out.println("lookup for "+entry.info_hash+" updated:"+entry.added); + entry.added = System.currentTimeMillis()/1000; entry.status = 1; @@ -147,8 +149,8 @@ final FetchTask task = new FetchTask(); - //System.out.println("lookup for "+entry.info_hash); + task.entry = entry; task.addresses = new ArrayList<PeerAddressDBItem>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |