Revision 612e856d ml/ml.c

View differences:

ml/ml.c
39 39
#include <stdint.h>
40 40
#include <string.h>
41 41
#include <sys/types.h>
42
#include <event2/event.h>
43 42
#include <time.h>
44 43
#include <math.h>
45 44
#include <assert.h>
......
60 59
#include "util/udpSocket.h"
61 60
#include "util/stun.h"
62 61
#include "transmissionHandler.h"
62
#include "util/rateLimiter.h"
63
#include "util/queueManagement.h"
63 64

  
64 65
#define LOG_MODULE "[ml] "
65 66
#include "ml_log.h"
......
330 331
			}
331 332

  
332 333
			debug("ML: sending packet to %s with rconID:%d lconID:%d\n", conid_to_string(con_id), ntohl(msg_h.remote_con_id), ntohl(msg_h.local_con_id));
333
			switch(sendPacket(socketfd, iov, 4, &udpgen.udpaddr)) {
334
			int priority = 0; 
335
			if (msg_type == ML_CON_MSG) priority = HP;
336
			switch(queueOrSendPacket(socketfd, iov, 4, &udpgen.udpaddr,priority)) {
334 337
				case MSGLEN:
335 338
					info("ML: sending message failed, reducing MTU from %d to %d (to:%s conID:%d lconID:%d msgsize:%d offset:%d)\n", connectbuf[con_id]->pmtusize, pmtu_decrement(connectbuf[con_id]->pmtusize), conid_to_string(con_id), ntohl(msg_h.remote_con_id), ntohl(msg_h.local_con_id), msg_len, offset);
336 339
					// TODO: pmtu decremented here, but not in the "truncable" packet. That is currently resent without changing the claimed pmtu. Might need to be changed.
......
399 402
  {
400 403
                        char buf[SOCKETID_STRING_SIZE];
401 404
                        mlSocketIDToString(&((struct conn_msg*)connectbuf[con_id]->ctrl_msg_buf)->sock_id,buf,sizeof(buf));
402
                        debug("Local socket_address sent in INVITE: %s, sizeof msg %d\n", buf, sizeof(struct conn_msg));
405
                        debug("Local socket_address sent in INVITE: %s, sizeof msg %ld\n", buf, sizeof(struct conn_msg));
403 406
   }
404 407
	send_msg(con_id, ML_CON_MSG, connectbuf[con_id]->ctrl_msg_buf, buf_size, true, &(connectbuf[con_id]->defaultSendParams));
405 408
}
......
1355 1358
	return create_socket(port, ipaddr);
1356 1359
}
1357 1360

  
1358
void mlSetThrottle(int bucketsize, int drainrate) {
1361
void mlSetRateLimiterParams(int bucketsize, int drainrate, int maxQueueSize, int maxQueueSizeRTX, double maxTimeToHold) {
1359 1362
        setOutputRateParams(bucketsize, drainrate);
1363
	setQueuesParams (maxQueueSize, maxQueueSizeRTX, maxTimeToHold);
1360 1364
}
1361

  
1365
     
1362 1366
void mlSetVerbosity (int log_level) {
1363 1367
	setLogLevel(log_level);
1364 1368
}

Also available in: Unified diff