diff --git a/lib/socket.cpp b/lib/socket.cpp index 1b1c6ace..1d5e2e68 100644 --- a/lib/socket.cpp +++ b/lib/socket.cpp @@ -1137,7 +1137,11 @@ Socket::Connection::Connection(const Connection &rhs){ clear(); if (!rhs){return;} #if DEBUG >= DLVL_DEVEL +#ifdef SSL HIGH_MSG("Copying %s socket", rhs.sslConnected ? "SSL" : "regular"); +#else + HIGH_MSG("Copying regular socket"); +#endif #endif conntime = rhs.conntime; isTrueSocket = rhs.isTrueSocket; @@ -1166,7 +1170,11 @@ Socket::Connection &Socket::Connection::operator=(const Socket::Connection &rhs) clear(); if (!rhs){return *this;} #if DEBUG >= DLVL_DEVEL +#ifdef SSL HIGH_MSG("Assigning %s socket", rhs.sslConnected ? "SSL" : "regular"); +#else + HIGH_MSG("Assigning regular socket"); +#endif #endif conntime = rhs.conntime; isTrueSocket = rhs.isTrueSocket; @@ -1766,6 +1774,11 @@ uint16_t Socket::UDPConnection::bind(int port, std::string iface, const std::str sockaddr_in *addr4 = (sockaddr_in *)(rp->ai_addr); // multicast has a "1110" bit prefix multicast = (((char *)&(addr4->sin_addr))[0] & 0xF0) == 0xE0; +#ifdef __CYGWIN__ + if (multicast){ + ((sockaddr_in*)rp->ai_addr)->sin_addr.s_addr = htonl(INADDR_ANY); + } +#endif } if (multicast){ const int optval = 1; diff --git a/src/io.cpp b/src/io.cpp index 17eb4fc5..ecd46937 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -664,6 +664,9 @@ namespace Mist { DEBUG_MSG(DLVL_FAIL, "Failed to negotiate for incoming track %lu, there does not seem to be a connection with the buffer", tid); return; } + #if defined(__CYGWIN__) || defined(_WIN32) + static std::map preservedTempMetas; + #endif unsigned long offset = 6 * trackOffset[tid]; //If we have a new track to negotiate if (!trackState.count(tid)) { @@ -691,9 +694,10 @@ namespace Mist { std::string tmpStr = tmpVal.toNetPacked(); memcpy(metaPages[tid].mapped, tmpStr.data(), tmpStr.size()); - - - + #if defined(__CYGWIN__) || defined(_WIN32) + IPC::preservePage(pageName); + preservedTempMetas[tid] = pageName; + #endif snprintf(pageName, NAME_BUFFER_SIZE, SHM_TRACK_INDEX, streamName.c_str(), finalTid); metaPages[tid].init(pageName, SHM_TRACK_INDEX_SIZE, true); @@ -710,9 +714,6 @@ namespace Mist { } return; } - #if defined(__CYGWIN__) || defined(_WIN32) - static std::map preservedTempMetas; - #endif switch (trackState[tid]) { case FILL_NEW: { unsigned long newTid = ((long)(tmp[offset]) << 24) | ((long)(tmp[offset + 1]) << 16) | ((long)(tmp[offset + 2]) << 8) | tmp[offset + 3];