Mercurial > hg > freeDiameter
comparison freeDiameter/tests/testsctp.c @ 479:a186743b89a3
Allow FDEVP_CNX_EP_CHANGE to occur in the test
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Mon, 09 Aug 2010 18:13:50 +0900 |
parents | b65f32c20e6d |
children | 3b7d579e9507 |
comparison
equal
deleted
inserted
replaced
478:b65f32c20e6d | 479:a186743b89a3 |
---|---|
99 /* Send a first message */ | 99 /* Send a first message */ |
100 CHECK( 0, fd_sctp_sendstr(srvsock, 1, (uint8_t *)buf1, sizeof(buf1), &status) ); | 100 CHECK( 0, fd_sctp_sendstr(srvsock, 1, (uint8_t *)buf1, sizeof(buf1), &status) ); |
101 CHECK( 0, status); | 101 CHECK( 0, status); |
102 | 102 |
103 /* Receive this message */ | 103 /* Receive this message */ |
104 redo1: | |
104 CHECK( 0, fd_sctp_recvmeta(clisock, &str, (uint8_t **)&buf2, &sz, &ev, &status) ); | 105 CHECK( 0, fd_sctp_recvmeta(clisock, &str, (uint8_t **)&buf2, &sz, &ev, &status) ); |
106 if (ev == FDEVP_CNX_EP_CHANGE) | |
107 goto redo1; | |
105 CHECK( FDEVP_CNX_MSG_RECV, ev); | 108 CHECK( FDEVP_CNX_MSG_RECV, ev); |
106 CHECK( 0, status); | 109 CHECK( 0, status); |
107 CHECK( 1, str); | 110 CHECK( 1, str); |
108 CHECK( sizeof(buf1), sz ); | 111 CHECK( sizeof(buf1), sz ); |
109 CHECK( 0, memcmp(buf1, buf2, sz) ); | 112 CHECK( 0, memcmp(buf1, buf2, sz) ); |
112 /* Send in the other direction */ | 115 /* Send in the other direction */ |
113 CHECK( 0, fd_sctp_sendstr(clisock, 2, (uint8_t *)buf1, sizeof(buf1), &status) ); | 116 CHECK( 0, fd_sctp_sendstr(clisock, 2, (uint8_t *)buf1, sizeof(buf1), &status) ); |
114 CHECK( 0, status); | 117 CHECK( 0, status); |
115 | 118 |
116 /* Receive this message */ | 119 /* Receive this message */ |
120 redo2: | |
117 CHECK( 0, fd_sctp_recvmeta(srvsock, &str, (uint8_t **)&buf2, &sz, &ev, &status) ); | 121 CHECK( 0, fd_sctp_recvmeta(srvsock, &str, (uint8_t **)&buf2, &sz, &ev, &status) ); |
122 if (ev == FDEVP_CNX_EP_CHANGE) | |
123 goto redo2; | |
118 CHECK( FDEVP_CNX_MSG_RECV, ev); | 124 CHECK( FDEVP_CNX_MSG_RECV, ev); |
119 CHECK( 0, status); | 125 CHECK( 0, status); |
120 CHECK( 2, str); | 126 CHECK( 2, str); |
121 CHECK( sizeof(buf1), sz ); | 127 CHECK( sizeof(buf1), sz ); |
122 CHECK( 0, memcmp(buf1, buf2, sz) ); | 128 CHECK( 0, memcmp(buf1, buf2, sz) ); |