Source: Keep track of how many sinks are connected and enabled.

This commit is contained in:
Peter Johnson
2016-09-08 23:52:23 -07:00
parent ddb97bfafb
commit ba241cd7f9
5 changed files with 83 additions and 9 deletions

View File

@@ -290,6 +290,7 @@ void HTTPSinkImpl::SendStream(wpi::raw_socket_ostream& os) {
DEBUG("Headers send, sending stream now");
Enable();
while (m_active && !os.has_error()) {
auto source = GetSource();
if (!source) {
@@ -321,9 +322,9 @@ void HTTPSinkImpl::SendStream(wpi::raw_socket_ostream& os) {
os << "\r\n--" BOUNDARY "\r\n";
// os.flush();
}
Disable();
}
// thread for clients that connected to this server
void HTTPSinkImpl::ConnThreadMain(wpi::NetworkStream* stream) {
wpi::raw_socket_istream is{*stream};