Skip to content

Commit dd38beb

Browse files
committed
Return the DTLS server to accept on close_notify so a resume is heard
1 parent 700bd50 commit dd38beb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

dtls/server-dtls.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ int main(int argc, char** argv)
187187
buff[recvLen] = 0;
188188
printf("I heard this: \"%s\"\n", buff);
189189
}
190+
else if (recvLen == 0) {
191+
/* close_notify: rebind now. Falling through to write instead
192+
* only escapes once a send fails on an ICMP round trip, and
193+
* until then this socket is still connect()ed to the old peer,
194+
* so a client resuming from a new port is never heard. */
195+
printf("Client sent close notify\n");
196+
break;
197+
}
190198
else if (recvLen < 0) {
191199
int readErr = wolfSSL_get_error(ssl, 0);
192200
if(readErr != SSL_ERROR_WANT_READ) {

0 commit comments

Comments
 (0)