Merge pull request #63 from Zireael-N/master

Override a pure virtual function inherited from WindowsPipe
pull/75/head
Jeffrey Walton 2015-11-13 09:15:47 -05:00
commit 1993a8b7b9
2 changed files with 7 additions and 5 deletions

View File

@ -91,7 +91,7 @@ bool WindowsPipeReceiver::Receive(byte* buf, size_t bufLen)
{
assert(!m_resultPending && !m_eofReceived);
HANDLE h = GetHandle();
const HANDLE h = GetHandle();
// don't queue too much at once, or we might use up non-paged memory
if (ReadFile(h, buf, UnsignedMin((DWORD)128*1024, bufLen), &m_lastResult, &m_overlapped))
{
@ -128,7 +128,7 @@ unsigned int WindowsPipeReceiver::GetReceiveResult()
{
if (m_resultPending)
{
HANDLE h = GetHandle();
const HANDLE h = GetHandle();
if (GetOverlappedResult(h, &m_overlapped, &m_lastResult, false))
{
if (m_lastResult == 0)
@ -165,7 +165,7 @@ WindowsPipeSender::WindowsPipeSender()
void WindowsPipeSender::Send(const byte* buf, size_t bufLen)
{
DWORD written = 0;
HANDLE h = GetHandle();
const HANDLE h = GetHandle();
// don't queue too much at once, or we might use up non-paged memory
if (WriteFile(h, buf, UnsignedMin((DWORD)128*1024, bufLen), &written, &m_overlapped))
{
@ -193,7 +193,7 @@ unsigned int WindowsPipeSender::GetSendResult()
{
if (m_resultPending)
{
HANDLE h = GetHandle();
const HANDLE h = GetHandle();
BOOL result = GetOverlappedResult(h, &m_overlapped, &m_lastResult, false);
CheckAndHandleError("GetOverlappedResult", result);
m_resultPending = false;

View File

@ -21,7 +21,7 @@ public:
bool GetOwnership() const {return m_own;}
void SetOwnership(bool own) {m_own = own;}
operator HANDLE() {return m_h;}
operator HANDLE() const {return m_h;}
HANDLE GetHandle() const {return m_h;}
bool HandleValid() const;
void AttachHandle(HANDLE h, bool own=false);
@ -67,6 +67,7 @@ public:
unsigned int GetReceiveResult();
bool EofReceived() const {return m_eofReceived;}
HANDLE GetHandle() const {return m_event;}
unsigned int GetMaxWaitObjectCount() const {return 1;}
void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack);
@ -90,6 +91,7 @@ public:
bool MustWaitForEof() { return false; }
void SendEof() {}
HANDLE GetHandle() const {return m_event;}
unsigned int GetMaxWaitObjectCount() const {return 1;}
void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack);