fix for socket poll() crash when (fd == -1)

This commit is contained in:
Marian Krivos
2009-03-12 12:59:29 +00:00
parent 9f0b63646b
commit 88cfd56f6d

View File

@@ -323,6 +323,8 @@ int SocketImpl::receiveFrom(void* buffer, int length, SocketAddress& address, in
void SocketImpl::sendUrgent(unsigned char data)
{
poco_assert (_sockfd != POCO_INVALID_SOCKET);
int rc = ::send(_sockfd, reinterpret_cast<const char*>(&data), sizeof(data), MSG_OOB);
if (rc < 0) error();
}
@@ -338,6 +340,8 @@ int SocketImpl::available()
bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
{
poco_assert (_sockfd != POCO_INVALID_SOCKET);
fd_set fdRead;
fd_set fdWrite;
fd_set fdExcept;