Never block in wxSocket::Peek().
Peek() is not expected to block so ensure that it doesn't, independently of the currently used socket flags, by using wxSOCKET_NOWAIT. See #11528. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -437,6 +437,7 @@ All:
|
|||||||
- Added support for unique volume names to wxFileName (Neno Ganchev).
|
- Added support for unique volume names to wxFileName (Neno Ganchev).
|
||||||
- Correct bugs when using wxTextInputStream with wxConvAuto (Leon Buikstra).
|
- Correct bugs when using wxTextInputStream with wxConvAuto (Leon Buikstra).
|
||||||
- Don't crash when input is empty in wxFileConfig ctor (Lukasz Michalski).
|
- Don't crash when input is empty in wxFileConfig ctor (Lukasz Michalski).
|
||||||
|
- Correct wxSocket::Peek() to not block (Anders Larsen).
|
||||||
|
|
||||||
Unix:
|
Unix:
|
||||||
|
|
||||||
|
@@ -1109,6 +1109,9 @@ wxSocketBase& wxSocketBase::Peek(void* buffer, wxUint32 nbytes)
|
|||||||
{
|
{
|
||||||
wxSocketReadGuard read(this);
|
wxSocketReadGuard read(this);
|
||||||
|
|
||||||
|
// Peek() should never block
|
||||||
|
wxSocketWaitModeChanger changeFlags(this, wxSOCKET_NOWAIT);
|
||||||
|
|
||||||
m_lcount = DoRead(buffer, nbytes);
|
m_lcount = DoRead(buffer, nbytes);
|
||||||
|
|
||||||
Pushback(buffer, m_lcount);
|
Pushback(buffer, m_lcount);
|
||||||
|
Reference in New Issue
Block a user