it more or less works this way
authorvictor <victor@e16421f0-f15b-0410-abcd-98678b794739>
Sat, 14 Nov 2009 18:30:40 +0000 (18:30 +0000)
committervictor <victor@e16421f0-f15b-0410-abcd-98678b794739>
Sat, 14 Nov 2009 18:30:40 +0000 (18:30 +0000)
git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@556 e16421f0-f15b-0410-abcd-98678b794739

sendrecv.cpp

index c570c18..5bd424c 100644 (file)
@@ -153,7 +153,7 @@ void        Channel::AddHint (Datagram& dgram) {
     if (!peer_pps)
         peer_pps = 1;
     
-    if ( hint_out_mass < 4*peer_cwnd ) {
+    if ( hint_out_mass < peer_pps ) { //4*peer_cwnd ) {
         
         int diff = 5*peer_cwnd - hint_out_mass;
         if (diff>4 && diff>2*peer_cwnd)
@@ -228,7 +228,7 @@ void        Channel::AddTs (Datagram& dgram) {
 void   Channel::AddAck (Datagram& dgram) {
        if (data_in_.bin!=bin64_t::NONE) {
         AddTs(dgram);
-        bin64_t pos = data_in_.bin;
+        bin64_t pos = file().ack_out().cover(data_in_.bin);
                dgram.Push8(P2TP_ACK);
                dgram.Push32(pos);
                //dgram.Push64(data_in_.time);
@@ -498,4 +498,4 @@ void Channel::Schedule (tint next_time) {
         next_time = NOW + TINT_MIN; // 1min timeout
     send_queue.push(tintbin(next_time,id));
     dprintf("%s requeue #%i for %s\n",tintstr(),id,tintstr(next_time));
-}
\ No newline at end of file
+}