Mercurial > hg > freeDiameter
diff freeDiameter/sctps.c @ 543:40141acabee7
Fix behavior of TLS/SCTP when only one peer does not accept the remote certificate
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 14 Sep 2010 13:31:27 +0900 |
parents | 7250e91f0662 |
children |
line wrap: on
line diff
--- a/freeDiameter/sctps.c Mon Sep 13 18:39:22 2010 +0900 +++ b/freeDiameter/sctps.c Tue Sep 14 13:31:27 2010 +0900 @@ -597,18 +597,22 @@ return 0; } -/* Receive messages from all stream pairs */ -int fd_sctps_startthreads(struct cnxctx * conn) +/* Receive messages from others ? all other stream pairs : the master pair */ +int fd_sctps_startthreads(struct cnxctx * conn, int others) { uint16_t i; TRACE_ENTRY("%p", conn); CHECK_PARAMS( conn && conn->cc_sctps_data.array ); - for (i = 0; i < conn->cc_sctp_para.pairs; i++) { - - /* Start the decipher thread */ - CHECK_POSIX( pthread_create( &conn->cc_sctps_data.array[i].thr, NULL, decipher, &conn->cc_sctps_data.array[i] ) ); + if (others) { + for (i = 1; i < conn->cc_sctp_para.pairs; i++) { + + /* Start the decipher thread */ + CHECK_POSIX( pthread_create( &conn->cc_sctps_data.array[i].thr, NULL, decipher, &conn->cc_sctps_data.array[i] ) ); + } + } else { + CHECK_POSIX( pthread_create( &conn->cc_sctps_data.array[0].thr, NULL, decipher, &conn->cc_sctps_data.array[0] ) ); } return 0; }