Mercurial > hg > freeDiameter-dtls
comparison libfdcore/p_dp.c @ 1186:56c36d1007b4 dtls_dev
Further preparation of the DTLS integration. Some cleanups in the GNUTLS handling.
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Fri, 07 Jun 2013 18:48:34 +0800 |
parents | 1af09cc156d6 |
children |
comparison
equal
deleted
inserted
replaced
1185:23695957bfc0 | 1186:56c36d1007b4 |
---|---|
115 if ((to_receive == 0) && (to_send == 1 /* only the DPA */)) { | 115 if ((to_receive == 0) && (to_send == 1 /* only the DPA */)) { |
116 /* No pending exchange, move to CLOSING directly */ | 116 /* No pending exchange, move to CLOSING directly */ |
117 CHECK_FCT( fd_psm_change_state(peer, STATE_CLOSING) ); | 117 CHECK_FCT( fd_psm_change_state(peer, STATE_CLOSING) ); |
118 | 118 |
119 /* Now send the DPA */ | 119 /* Now send the DPA */ |
120 CHECK_FCT( fd_out_send( msg, NULL, peer, FD_CNX_ORDERED) ); | 120 CHECK_FCT( fd_out_send( msg, NULL, peer) ); |
121 | 121 |
122 /* and move to CLOSED */ | 122 /* and move to CLOSED */ |
123 fd_psm_cleanup(peer, 0); | 123 fd_psm_cleanup(peer, 0); |
124 | 124 |
125 /* Reset the timer for next connection attempt -- we'll retry sooner or later depending on the disconnection cause */ | 125 /* Reset the timer for next connection attempt -- we'll retry sooner or later depending on the disconnection cause */ |
129 not new requests */ | 129 not new requests */ |
130 CHECK_FCT( fd_psm_change_state(peer, STATE_CLOSING_GRACE) ); | 130 CHECK_FCT( fd_psm_change_state(peer, STATE_CLOSING_GRACE) ); |
131 fd_psm_next_timeout(peer, 0, GRACE_TIMEOUT); | 131 fd_psm_next_timeout(peer, 0, GRACE_TIMEOUT); |
132 | 132 |
133 /* Now send the DPA */ | 133 /* Now send the DPA */ |
134 CHECK_FCT( fd_out_send( msg, NULL, peer, FD_CNX_ORDERED) ); | 134 CHECK_FCT( fd_out_send( msg, NULL, peer) ); |
135 } | 135 } |
136 } else { | 136 } else { |
137 /* We received a DPA */ | 137 /* We received a DPA */ |
138 int curstate = fd_peer_getstate(peer); | 138 int curstate = fd_peer_getstate(peer); |
139 if (curstate != STATE_CLOSING_GRACE) { | 139 if (curstate != STATE_CLOSING_GRACE) { |
199 /* Update the peer state and timer */ | 199 /* Update the peer state and timer */ |
200 CHECK_FCT( fd_psm_change_state(peer, STATE_CLOSING_GRACE) ); | 200 CHECK_FCT( fd_psm_change_state(peer, STATE_CLOSING_GRACE) ); |
201 fd_psm_next_timeout(peer, 0, DPR_TIMEOUT); | 201 fd_psm_next_timeout(peer, 0, DPR_TIMEOUT); |
202 | 202 |
203 /* Now send the DPR message */ | 203 /* Now send the DPR message */ |
204 CHECK_FCT_DO( fd_out_send(&msg, NULL, peer, FD_CNX_ORDERED), /* ignore since we are on timeout anyway */ ); | 204 CHECK_FCT_DO( fd_out_send(&msg, NULL, peer), /* ignore since we are on timeout anyway */ ); |
205 | 205 |
206 return 0; | 206 return 0; |
207 } | 207 } |