[Sumover-dev] [svn commit] r4289 - vic/branches/cc/rtp
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Fri Sep 5 18:24:55 BST 2008
Author: soohyunc
Date: Fri Sep 5 18:24:53 2008
New Revision: 4289
Modified:
vic/branches/cc/rtp/session.cpp
Log:
(bug fixed)
the issues were:
o previously, the head of the packete queue can be 0. and, if we try parsing
rtp header in this case, the code will do seg-fault.
o SessioniManager::cc_output() did not correctly parse the data packets in the
queue, hence the parsed seqno were wrong numbers.
--> implemented checking routine if pb is 0 or not. also, implemented a new way
to parse the data packets in the packet queue.
To-do: currently, the head pointer of the packet queue seems to be
mal-functioning.
Modified: vic/branches/cc/rtp/session.cpp
==============================================================================
--- vic/branches/cc/rtp/session.cpp (original)
+++ vic/branches/cc/rtp/session.cpp Fri Sep 5 18:24:53 2008
@@ -1211,27 +1211,39 @@
void SessionManager::cc_output()
{
- //pktbuf* pb = get_packet_queue();
- pktbuf* pb = head_;
- rtphdr* rh = (rtphdr *) pb->data;
+ pktbuf* pb = head_; // head of the packet queue
+ rtphdr* rh; // declare rtp header
+
+ // if pb is not 0, then parse rtp header
+ if (pb != 0)
+ rh = (rtphdr *) pb->data;
// cwnd value
int magic = (int) tfwc_magic();
// last acked seqno
int jack = (int) tfwc_sndr_just_acked();
- // while the packet seqno is within "cwnd + jack"
- // then send the packets
+ // while packet seqno is within "cwnd + jack", send that packet
while (ntohs(rh->rh_seqno) <= magic + jack) {
+ //debug_msg("seqno: %d\n", ntohs(rh->rh_seqno));
if (pb != 0) {
- head_ = pb->next;
- // call Transmitter::output(pb)
- output(pb);
// record seqno and timestamp at TfwcSndr side
tfwc_sndr_send(pb);
+
+ // call Transmitter::output(pb)
+ output(pb);
+
+ // trim packet buffer
+ pktbuf* nx = pb->next;
+ pb = nx;
+
+ // if pb is not 0, then parse rtp header
+ if (pb != 0)
+ rh = (rtphdr *) pb->data;
+ else
+ break;
}
- rh = (rtphdr *) pb->data;
- }
+ } // end while
}
void CtrlHandler::send_ackv(rtcp_xr* xr)
More information about the Sumover-dev
mailing list