[prev in list] [next in list] [prev in thread] [next in thread]
List: mojonation-devel
Subject: [Mojonation-devel] CVS: evil/common BlockFinder.py,1.51,1.52 SingleReassembly.py,1.77,1.78
From: Zooko de Tovenaar <zooko () users ! sourceforge ! net>
Date: 2001-06-29 20:52:02
[Download RAW message or body]
Update of /cvsroot/mojonation/evil/common
In directory usw-pr-cvs1:/tmp/cvs-serv16280/common
Modified Files:
BlockFinder.py SingleReassembly.py
Log Message:
* bugfix -- broker ids are ASCIIfied in BlockFinder
diff -d -u -r1.51 -r1.52
--- BlockFinder.py 2001/06/29 17:58:45 1.51
+++ BlockFinder.py 2001/06/29 20:52:00 1.52
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2000 Autonomous Zone Industries
+# Copyright (c) 2001 Autonomous Zone Industries
# This file is licensed under the
# GNU Lesser General Public License v2.1.
# See the file COPYING or visit http://www.gnu.org/ for details.
@@ -270,7 +270,7 @@
debug.mojolog.write('asking server %s about %s blocks %s\n', \
args=(server_id, len(block_ids_for_this_server), block_ids_for_this_server), v=4, \
vs='BlockFinder')
# XXX store block ids for each server in a hash as well as a list to \
prevent it from having # duplicates yet preserving order (a HashQueue perhaps?).
- self.waiting_requests.setdefault(server_id, (info, \
[]))[1].extend(block_ids_for_this_server) + \
self.waiting_requests.setdefault(idlib.to_ascii(server_id), (info, \
[]))[1].extend(block_ids_for_this_server)
def add_callback(self, block_id, found_callback, finished_callback):
assert callable(found_callback)
diff -d -u -r1.77 -r1.78
--- SingleReassembly.py 2001/06/29 19:54:57 1.77
+++ SingleReassembly.py 2001/06/29 20:52:00 1.78
@@ -221,6 +221,7 @@
return self.piece
def consolidate(self):
+ debug.mojolog.write("%s.consolidate()\n", args=(self,), v=4, \
vs='SingleReassembly') assert self.broker.doq.is_currently_doq()
if self._finflag.isSet():
return
@@ -231,9 +232,14 @@
if len(blocks) < self.num_blocks_needed:
raise ReassemblyError, 'not enough blocks found - need \
'+str(self.num_blocks_needed)+', have ' + str(len(blocks))
result = unsplit(blocks, self.piece_id, length = self.piece_length, \
totalsharesneeded=self.num_blocks_needed, totalsharesinpiece=self.num_blocks_total) + \
debug.mojolog.write("%s.consolidate() successfully unsplit\n", args=(self,), v=4, \
vs='SingleReassembly') +
+ self.piece = result
+ self.blocks = [None] * len(self.block_positions)
+
if self.download_monitor:
self.download_monitor.ev_finished_reassembly(self.piece_id)
-
+
# check the list of shares, if any of the shares in this
# piece match our block servers mask but we did -not- download
# them, use split to regenerate them here and store the
@@ -262,9 +268,6 @@
debug.mojolog.write(" storing %s after reassembly\n", \
args=(splitblocks[sharenum][0],), v=4, vs='SingleReassembly')
\
self.broker.blobserver.try_to_store_blob(splitblocks[sharenum][0], \
splitblocks[sharenum][1])
- self.piece = result
- self.blocks = [None] * len(self.block_positions)
-
def is_finished(self):
return self._finflag.isSet()
@@ -288,6 +291,7 @@
if self.download_monitor:
self.download_monitor.ev_failed_reassembly(self.piece_id, \
reasonstr=reason) self.failure_reason = reason
+ debug.mojolog.write("%s.reassemble(): cancelling\n", args=(self,), v=4, \
vs='SingleReassembly') self._finflag.set()
for block_id in self.block_positions:
if block_id is not None:
_______________________________________________
Mojonation-devel mailing list
Mojonation-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mojonation-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic