Mercurial > hg > freeDiameter
comparison libfdcore/peers.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 | 2557127f3c8b |
children | a8ed055a9253 |
comparison
equal
deleted
inserted
replaced
766:734bf3e1487b | 767:c47c16436f71 |
---|---|
74 p->p_eyec = EYEC_PEER; | 74 p->p_eyec = EYEC_PEER; |
75 CHECK_POSIX( pthread_mutex_init(&p->p_state_mtx, NULL) ); | 75 CHECK_POSIX( pthread_mutex_init(&p->p_state_mtx, NULL) ); |
76 | 76 |
77 fd_list_init(&p->p_actives, p); | 77 fd_list_init(&p->p_actives, p); |
78 fd_list_init(&p->p_expiry, p); | 78 fd_list_init(&p->p_expiry, p); |
79 CHECK_FCT( fd_fifo_new(&p->p_tosend) ); | 79 CHECK_FCT( fd_fifo_new(&p->p_tosend, 5) ); |
80 p->p_hbh = lrand48(); | 80 p->p_hbh = lrand48(); |
81 | 81 |
82 fd_list_init(&p->p_sr.srs, p); | 82 fd_list_init(&p->p_sr.srs, p); |
83 fd_list_init(&p->p_sr.exp, p); | 83 fd_list_init(&p->p_sr.exp, p); |
84 CHECK_POSIX( pthread_mutex_init(&p->p_sr.mtx, NULL) ); | 84 CHECK_POSIX( pthread_mutex_init(&p->p_sr.mtx, NULL) ); |