Mercurial > hg > freeDiameter
comparison libfdcore/sctps.c @ 767:c47c16436f71
Added a limit on fifo queues to avoid memory exaustion when messages are received faster than handled
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Sun, 23 Oct 2011 23:43:32 +0200 |
parents | 4a9f08d6b6ba |
children | ca8e30a2426d |
comparison
equal
deleted
inserted
replaced
766:734bf3e1487b | 767:c47c16436f71 |
---|---|
494 /* First, alloc the array and initialize the non-TLS data */ | 494 /* First, alloc the array and initialize the non-TLS data */ |
495 CHECK_MALLOC( conn->cc_sctps_data.array = calloc(conn->cc_sctp_para.pairs, sizeof(struct sctps_ctx)) ); | 495 CHECK_MALLOC( conn->cc_sctps_data.array = calloc(conn->cc_sctp_para.pairs, sizeof(struct sctps_ctx)) ); |
496 for (i = 0; i < conn->cc_sctp_para.pairs; i++) { | 496 for (i = 0; i < conn->cc_sctp_para.pairs; i++) { |
497 conn->cc_sctps_data.array[i].parent = conn; | 497 conn->cc_sctps_data.array[i].parent = conn; |
498 conn->cc_sctps_data.array[i].strid = i; | 498 conn->cc_sctps_data.array[i].strid = i; |
499 CHECK_FCT( fd_fifo_new(&conn->cc_sctps_data.array[i].raw_recv) ); | 499 CHECK_FCT( fd_fifo_new(&conn->cc_sctps_data.array[i].raw_recv, 10) ); |
500 } | 500 } |
501 | 501 |
502 /* Set push/pull functions in the master session, using fifo in array[0] */ | 502 /* Set push/pull functions in the master session, using fifo in array[0] */ |
503 set_sess_transport(conn->cc_tls_para.session, &conn->cc_sctps_data.array[0]); | 503 set_sess_transport(conn->cc_tls_para.session, &conn->cc_sctps_data.array[0]); |
504 | 504 |