logging cleanups
authorvictor <victor@e16421f0-f15b-0410-abcd-98678b794739>
Wed, 18 Nov 2009 12:31:06 +0000 (12:31 +0000)
committervictor <victor@e16421f0-f15b-0410-abcd-98678b794739>
Wed, 18 Nov 2009 12:31:06 +0000 (12:31 +0000)
git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@580 e16421f0-f15b-0410-abcd-98678b794739

p2tp.cpp
p2tp.h
transfer.cpp

index 491e04c..264e055 100644 (file)
--- a/p2tp.cpp
+++ b/p2tp.cpp
@@ -50,6 +50,7 @@ Channel::Channel      (FileTransfer* transfer, int socket, Address peer_addr) :
        this->id = channels.size();
        channels.push_back(this);
     cc_ = new PingPongController(this);
+    dprintf("%s #%i init %s\n",tintstr(),id,peer_.str().c_str());
     Schedule(NOW); // FIXME ugly
 }
 
diff --git a/p2tp.h b/p2tp.h
index 5a1a715..509179e 100644 (file)
--- a/p2tp.h
+++ b/p2tp.h
@@ -168,6 +168,8 @@ namespace p2tp {
 
         /** Messages we are accepting.    */
         uint64_t        cap_out_;
+        
+        tint            init_time_;
 
     protected:
         void            OnDataIn (bin64_t pos);
index 8c2d42d..97979b8 100644 (file)
@@ -35,6 +35,7 @@ FileTransfer::FileTransfer (const char* filename, const Sha1Hash& _root_hash) :
     files[fd()] = this;
     picker_ = new SeqPiecePicker(this);
     picker_->Randomize(rand()&63);
+    init_time_ = Datagram::Time();
 }