Fix build failure when using UDPHandle::recv()

Missing const fails to compile the code
This commit is contained in:
Raoul Hecky 2017-01-15 19:31:44 +01:00
parent 067d4830b6
commit 4f7b5fc13c

View File

@ -100,7 +100,7 @@ private:
class UDPHandle final: public Handle<UDPHandle, uv_udp_t> {
template<typename I>
static void recvCallback(uv_udp_t *handle, ssize_t nread, const uv_buf_t *buf, const sockaddr *addr, unsigned flags) {
typename details::IpTraits<I>::Type *aptr = reinterpret_cast<const typename details::IpTraits<I>::Type *>(addr);
const typename details::IpTraits<I>::Type *aptr = reinterpret_cast<const typename details::IpTraits<I>::Type *>(addr);
UDPHandle &udp = *(static_cast<UDPHandle*>(handle->data));
// data will be destroyed no matter of what the value of nread is