Browse Source

Consider DTLS premature termination as remote closing

Paul-Louis Ageneau 5 years ago
parent
commit
fcb1a2571d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/dtlstransport.cpp

+ 4 - 0
src/dtlstransport.cpp

@@ -154,6 +154,10 @@ void DtlsTransport::runRecvLoop() {
 				ret = gnutls_record_recv(mSession, buffer, bufferSize);
 			} while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
 
+			// Consider premature termination as remote closing
+			if (ret == GNUTLS_E_PREMATURE_TERMINATION)
+				break;
+
 			if (check_gnutls(ret)) {
 				if (ret == 0) {
 					// Closed