1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-28 02:30:05 +00:00

WebInputStream: Fixed bug preventing cancellation of streams on Linux

This commit is contained in:
tpoole 2017-06-15 15:33:57 +01:00
parent a95ede0c6e
commit 8e4c187451

View file

@ -47,7 +47,7 @@ void MACAddress::findAllAddresses (Array<MACAddress>& result)
freeifaddrs (addrs);
}
close (s);
::close (s);
}
}
@ -130,7 +130,7 @@ public:
closeSocket();
}
//==============================================================================w
//==============================================================================
bool isError() const { return socketHandle < 0; }
bool isExhausted() { return finished; }
int64 getPosition() { return position; }
@ -253,13 +253,20 @@ private:
String httpRequestCmd;
int64 chunkEnd = 0;
bool isChunked = false, readingChunk = false;
CriticalSection closeSocketLock;
void closeSocket (bool resetLevelsOfRedirection = true)
{
const ScopedLock lock (closeSocketLock);
if (socketHandle >= 0)
close (socketHandle);
{
::shutdown (socketHandle, SHUT_RDWR);
::close (socketHandle);
}
socketHandle = -1;
if (resetLevelsOfRedirection)
levelsOfRedirection = 0;
}