attempt at fixing negative bw rates in GUI that may pop up when an error is present in the SSL stream (e.g. when a peer disconnects/reconnects)

This commit is contained in:
csoler 2016-03-02 19:00:51 -05:00
parent 20fcf635e4
commit bb260696ce
2 changed files with 5 additions and 6 deletions

View File

@ -823,8 +823,6 @@ continue_packet:
std::cerr << "[" << (void*)pthread_self() << "] " << "deserializing. Size=" << pktlen << std::endl ;
#endif
inReadBytes_locked(pktlen); // only count deserialised packets, because that's what is actually been transfered.
RsItem *pkt = mRsSerialiser->deserialise(block, &pktlen);
if ((pkt != NULL) && (0 < handleincomingitem_locked(pkt,pktlen)))
@ -832,6 +830,7 @@ continue_packet:
#ifdef DEBUG_PQISTREAMER
pqioutput(PQL_DEBUG_BASIC, pqistreamerzone, "Successfully Read a Packet!");
#endif
inReadBytes_locked(pktlen); // only count deserialised packets, because that's what is actually been transfered.
}
else
{
@ -952,7 +951,7 @@ int pqistreamer::inAllowedBytes_locked()
static const float AVG_PERIOD = 5; // sec
static const float AVG_FRAC = 0.8; // for low pass filter.
void pqistreamer::outSentBytes_locked(int outb)
void pqistreamer::outSentBytes_locked(uint32_t outb)
{
#ifdef DEBUG_PQISTREAMER
{
@ -1022,7 +1021,7 @@ void pqistreamer::outSentBytes_locked(int outb)
return;
}
void pqistreamer::inReadBytes_locked(int inb)
void pqistreamer::inReadBytes_locked(uint32_t inb)
{
#ifdef DEBUG_PQISTREAMER
{

View File

@ -102,10 +102,10 @@ class pqistreamer: public PQInterface
float outTimeSlice_locked();
int outAllowedBytes_locked();
void outSentBytes_locked(int );
void outSentBytes_locked(uint32_t );
int inAllowedBytes_locked();
void inReadBytes_locked(int );
void inReadBytes_locked(uint32_t );