Commit 833c9c8a authored by Pekka Pessi's avatar Pekka Pessi

tport_type_udp.c: use su_getmsgsize() for now.

darcs-hash:20061222153137-65a35-40ec7a8a0b48532e182bb77331e6a11575b04d01.gz
parent 91eb7b36
......@@ -215,7 +215,7 @@ static void tport_check_trunc(tport_t *tp, su_addrinfo_t *ai)
int tport_recv_dgram(tport_t *self)
{
msg_t *msg;
ssize_t n, veclen;
ssize_t n, veclen, N;
su_addrinfo_t *ai;
su_sockaddr_t *from;
socklen_t fromlen;
......@@ -232,8 +232,21 @@ int tport_recv_dgram(tport_t *self)
assert(self->tp_msg == NULL);
veclen = tport_recv_iovec(self, &self->tp_msg, iovec, 65536, 1);
if (veclen < 0)
#if nomore
/* We used to resize the buffer, but it fragments the memory */
N = 65535;
#else
N = (ssize_t)su_getmsgsize(self->tp_socket);
if (N == -1) {
int err = su_errno();
SU_DEBUG_1(("%s(%p): su_getmsgsize(): %s (%d)\n", __func__, self,
su_strerror(err), err));
return -1;
}
#endif
veclen = tport_recv_iovec(self, &self->tp_msg, iovec, N, 1);
if (veclen == -1)
return -1;
msg = self->tp_msg;
......
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