Revision 1859b483

View differences:

ml/util/rateLimiter.c
44 44

  
45 45
	fprintf(stderr,"Event scheduled in: %d microseconds\n",us);*/
46 46

  
47
	while(outputRateControl(getFirstPacketSize()) == OK) {	
47
	while((!isQueueEmpty()) && (outputRateControl(getFirstPacketSize()) == OK)) {	
48 48

  
49 49

  
50 50
		PacketContainer* packet = takePacketToSend();
......
115 115
		return OK;
116 116
	} else {
117 117
		long leaked;
118
		int total_drain_secs = bytes_in_bucket / (drain_rate) + 1; 
118
		int total_drain_secs = bytes_in_bucket / (drain_rate) + 1;
119 119

  
120 120
		if(now.tv_sec - bib_then.tv_sec - 1 > total_drain_secs) {
121 121
				bytes_in_bucket = 0;

Also available in: Unified diff