Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: move memset out of recvmsg inner loop
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Jun 5, 2012
1 parent 738b31e commit c8c9fe1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/unix/udp.c
Expand Up @@ -210,14 +210,15 @@ static void uv__udp_recvmsg(uv_loop_t* loop, uv__io_t* w, int revents) {
*/
count = 32;

memset(&h, 0, sizeof(h));
h.msg_name = &peer;

do {
buf = handle->alloc_cb((uv_handle_t*)handle, 64 * 1024);
assert(buf.len > 0);
assert(buf.base != NULL);

memset(&h, 0, sizeof h);
h.msg_name = &peer;
h.msg_namelen = sizeof peer;
h.msg_namelen = sizeof(peer);
h.msg_iov = (struct iovec*)&buf;
h.msg_iovlen = 1;

Expand Down

0 comments on commit c8c9fe1

Please sign in to comment.