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:
parent
a95ede0c6e
commit
8e4c187451
1 changed files with 10 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue