Browse Source

Merge branch 'v0.18'

Paul-Louis Ageneau 2 years ago
parent
commit
ad8ae3eb5d
5 changed files with 9 additions and 7 deletions
  1. 1 0
      examples/streamer/dispatchqueue.hpp
  2. 1 1
      src/capi.cpp
  3. 3 2
      src/impl/pollservice.cpp
  4. 1 4
      src/impl/tls.cpp
  5. 3 0
      src/impl/wshandshake.hpp

+ 1 - 0
examples/streamer/dispatchqueue.hpp

@@ -15,6 +15,7 @@
 #include <condition_variable>
 #include <condition_variable>
 #include <queue>
 #include <queue>
 #include <functional>
 #include <functional>
+#include <string>
 
 
 class DispatchQueue {
 class DispatchQueue {
     typedef std::function<void(void)> fp_t;
     typedef std::function<void(void)> fp_t;

+ 1 - 1
src/capi.cpp

@@ -1035,7 +1035,7 @@ int rtcAddTrackEx(int pc, const rtcTrackInit *init) {
 				desc.addVP8Codec(init->payloadType);
 				desc.addVP8Codec(init->payloadType);
 				break;
 				break;
 			case RTC_CODEC_VP9:
 			case RTC_CODEC_VP9:
-				desc.addVP8Codec(init->payloadType);
+				desc.addVP9Codec(init->payloadType);
 				break;
 				break;
 			default:
 			default:
 				break;
 				break;

+ 3 - 2
src/impl/pollservice.cpp

@@ -124,13 +124,14 @@ void PollService::process(std::vector<struct pollfd> &pfds) {
 					mSocks->erase(sock);
 					mSocks->erase(sock);
 					callback(Event::Error);
 					callback(Event::Error);
 
 
-				} else if (it->revents & POLLIN || it->revents & POLLOUT) {
+				} else if (it->revents & POLLIN || it->revents & POLLOUT || it->revents & POLLHUP) {
 					entry.until = params.timeout
 					entry.until = params.timeout
 					                  ? std::make_optional(clock::now() + *params.timeout)
 					                  ? std::make_optional(clock::now() + *params.timeout)
 					                  : nullopt;
 					                  : nullopt;
 
 
 					auto callback = params.callback;
 					auto callback = params.callback;
-					if (it->revents & POLLIN) {
+					if (it->revents & POLLIN ||
+					    it->revents & POLLHUP) { // Windows does not set POLLIN on close
 						PLOG_VERBOSE << "Poll in event";
 						PLOG_VERBOSE << "Poll in event";
 						callback(Event::In);
 						callback(Event::In);
 					}
 					}

+ 1 - 4
src/impl/tls.cpp

@@ -176,15 +176,12 @@ bool check(int success, const string &message) {
 }
 }
 
 
 bool check(SSL *ssl, int ret, const string &message) {
 bool check(SSL *ssl, int ret, const string &message) {
-	if (ret == BIO_EOF)
-		return true;
-
 	unsigned long err = SSL_get_error(ssl, ret);
 	unsigned long err = SSL_get_error(ssl, ret);
 	if (err == SSL_ERROR_NONE || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
 	if (err == SSL_ERROR_NONE || err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
 		return true;
 		return true;
 	}
 	}
 	if (err == SSL_ERROR_ZERO_RETURN) {
 	if (err == SSL_ERROR_ZERO_RETURN) {
-		PLOG_DEBUG << "DTLS connection cleanly closed";
+		PLOG_DEBUG << "OpenSSL connection cleanly closed";
 		return false;
 		return false;
 	}
 	}
 	string str = error_string(err);
 	string str = error_string(err);

+ 3 - 0
src/impl/wshandshake.hpp

@@ -13,6 +13,9 @@
 
 
 #if RTC_ENABLE_WEBSOCKET
 #if RTC_ENABLE_WEBSOCKET
 
 
+#include <list>
+#include <map>
+#include <stdexcept>
 #include <vector>
 #include <vector>
 
 
 namespace rtc::impl {
 namespace rtc::impl {