mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-11-04 20:47:56 +00:00
fix for socket poll() crash when (fd == -1)
This commit is contained in:
@@ -323,6 +323,8 @@ int SocketImpl::receiveFrom(void* buffer, int length, SocketAddress& address, in
|
|||||||
|
|
||||||
void SocketImpl::sendUrgent(unsigned char data)
|
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);
|
int rc = ::send(_sockfd, reinterpret_cast<const char*>(&data), sizeof(data), MSG_OOB);
|
||||||
if (rc < 0) error();
|
if (rc < 0) error();
|
||||||
}
|
}
|
||||||
@@ -338,6 +340,8 @@ int SocketImpl::available()
|
|||||||
|
|
||||||
bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
|
bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
|
||||||
{
|
{
|
||||||
|
poco_assert (_sockfd != POCO_INVALID_SOCKET);
|
||||||
|
|
||||||
fd_set fdRead;
|
fd_set fdRead;
|
||||||
fd_set fdWrite;
|
fd_set fdWrite;
|
||||||
fd_set fdExcept;
|
fd_set fdExcept;
|
||||||
|
|||||||
Reference in New Issue
Block a user