Commit cc1a532a authored by John Selbie's avatar John Selbie

fix some compile issues for older operating systems

parent 182a3182
......@@ -42,7 +42,7 @@ const option* CCmdLineParser::GenerateOptions()
_options.push_back(zero);
return _options.data();
return &_options.front();
}
......
......@@ -86,7 +86,9 @@ uint32_t CEpoll::ToNativeFlags(uint32_t eventflags)
if (eventflags & IPOLLING_READ) result |= EPOLLIN;
if (eventflags & IPOLLING_WRITE) result |= EPOLLOUT;
if (eventflags & IPOLLING_EDGETRIGGER) result |= EPOLLET;
#ifdef EPOLLRDHUP
if (eventflags & IPOLLING_RDHUP) result |= EPOLLRDHUP;
#endif
if (eventflags & IPOLLING_HUP) result |= EPOLLHUP;
if (eventflags & IPOLLING_PRI) result |= EPOLLPRI;
if (eventflags & IPOLLING_ERROR) result |= EPOLLERR;
......@@ -102,7 +104,9 @@ uint32_t CEpoll::FromNativeFlags(uint32_t eventflags)
if (eventflags & EPOLLIN) result |= IPOLLING_READ;
if (eventflags & EPOLLOUT) result |= IPOLLING_WRITE;
if (eventflags & EPOLLET) result |= IPOLLING_EDGETRIGGER;
#ifdef EPOLLRDHUP
if (eventflags & EPOLLRDHUP) result |= IPOLLING_RDHUP;
#endif
if (eventflags & EPOLLHUP) result |= IPOLLING_HUP;
if (eventflags & EPOLLPRI) result |= IPOLLING_PRI;
if (eventflags & EPOLLERR) result |= IPOLLING_ERROR;
......@@ -328,9 +332,6 @@ uint32_t CPoll::FromNativeFlags(uint32_t eventflags)
HRESULT CPoll::Initialize(size_t maxSockets)
{
pollfd pfd = {};
pfd.fd = -1;
_fds.reserve(maxSockets);
_rotation = 0;
_unreadcount = 0;
......@@ -338,8 +339,6 @@ HRESULT CPoll::Initialize(size_t maxSockets)
_hashtable.InitTable(maxSockets, 0);
_fInitialized = true;
return S_OK;
}
......@@ -465,7 +464,7 @@ HRESULT CPoll::WaitForNextEvent(PollEvent* pPollEvent, int timeoutMilliseconds)
_unreadcount = 0;
list = _fds.data();
list = &_fds.front();
ret = poll(list, size, timeoutMilliseconds);
......@@ -488,7 +487,7 @@ bool CPoll::FindNextEvent(PollEvent* pEvent)
{
size_t size = _fds.size();
ASSERT(size > 0);
pollfd* list = _fds.data();
pollfd* list = &_fds.front();
bool fFound = false;
if (_unreadcount == 0)
......
......@@ -19,16 +19,8 @@
#include "server.h"
#include "stunsocket.h"
#include "stunsocketthread.h"
// client sockets are edge triggered
const uint32_t EPOLL_CLIENT_READ_EVENT_SET = IPOLLING_EDGETRIGGER | IPOLLING_READ | IPOLLING_RDHUP;
......
......@@ -524,6 +524,8 @@ HRESULT CStunMessageBuilder::AddMessageIntegrityLongTerm(const char* pszUserName
size_t lenRealm = pszRealm ? strlen(pszRealm) : 0;
size_t lenPassword = pszPassword ? strlen(pszPassword) : 0;
size_t lenTotal = lenUserName + lenRealm + lenPassword + 2; // +2 for the two colons
UNREFERENCED_VARIABLE(pResult);
ChkIfA(lenTotal > MAX_KEY_SIZE, E_INVALIDARG); // if we ever hit this limit, just increase MAX_STUN_AUTH_STRING_SIZE
......
......@@ -144,6 +144,8 @@ void CTestMessageHandler::ToAddr(const char* pszIP, uint16_t port, CSocketAddres
{
sockaddr_in addr={};
int result;
UNREFERENCED_VARIABLE(result);
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment