bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug fixed in socket.cpp


From: Tommi Mäkitalo
Subject: Bug fixed in socket.cpp
Date: Thu, 25 Oct 2001 15:25:39 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:0.9.4) Gecko/20010913

Hello,

I found 2 bugs in socket.cpp. I fixed them. Here is my diff.

Description:
1. TCPStream::timeout is not initialized when creating a tcpstream
2. if timeout is set TCPStream::underflow does never read data from the socket but reinitializes the receive-buffer with random data.

This has nothing to do with the problem I reported earlier today. I use a workaround. I set throwflag in the constructor to false and check errors myself. If you want me to modify the errorhandling, please tell me.


Tommi Mäkitalo
923c923,924
<         bufsize(0),gbuf(NULL),pbuf(NULL)
---
>         bufsize(0),gbuf(NULL),pbuf(NULL),
>         timeout(0)
1044c1045
<       else if(timeout)
---
>       else if(timeout && !Socket::isPending(SOCKET_PENDING_INPUT, timeout))
1046,1051c1047,1049
<               if(!Socket::isPending(SOCKET_PENDING_INPUT, timeout))
<               {
<                       clear(ios::failbit | rdstate());
<                       Error(SOCKET_TIMEOUT_ERROR);
<                       return EOF;
<               }
---
>               clear(ios::failbit | rdstate());
>               Error(SOCKET_TIMEOUT_ERROR);
>               return EOF;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]