Revision 45cc2362 ml/util/queueManagement.c

View differences:

ml/util/queueManagement.c
86 86
		TXqueue.tail = packet;
87 87
	}
88 88
	
89
	//logQueueOccupancy();
90 89
	return OK;
91 90
}
92 91

  
93 92
PacketContainer* takePacketToSend() {			//returns pointer to packet or NULL if queue is empty
94 93

  
95
	//logQueueOccupancy();
96 94
	if (TXqueue.head != NULL) {
97 95
		PacketContainer *packet = TXqueue.head;
98 96
		
......
124 122
		else break;
125 123
	}
126 124

  
127

  
128
	if ((RTXqueue.size + packet->pktLen) > RTXmaxSize) {
125
	while ((RTXqueue.size + packet->pktLen) > RTXmaxSize) {
129 126
		removeOldestPacket();
130 127
	}
131 128

  
......
229 226
        return 0;
230 227
}
231 228

  
232
// void logQueueOccupancy() {
233
// 	struct timeval now;
234
// 	gettimeofday(&now, NULL);
235
// 	double time = now.tv_sec + ((double) now.tv_usec)/1000000;
236
// 	file = fopen("./queue.txt", "a+");
237
// 	//char *str;
238
// 	//sprintf(str,"%f",time); 
239
// 	//fputs(str, p);
240
// 	fprintf(file,"%f \t %d \n",time, TXqueue.size);	
241
// 	fprintf(stderr,"[queueManagement::logQueueOccupancy] -- Time: %f \t queueOccupancy: %d \n", time, TXqueue.size);
242
// 	fclose(file);
243
// }

Also available in: Unified diff