2023-08-26 08:12:09 (UTC-03:00)
Marcel Rodrigues <marcelgmr@gmail.com>
tcp: remove unused client_addr
diff --git a/lib/ludweb/tcp.lua b/lib/ludweb/tcp.lua index f0b8b3d..f689173 100644 --- a/lib/ludweb/tcp.lua +++ b/lib/ludweb/tcp.lua @@ -113,8 +113,6 @@ function TCP:run() local evs = ffi.new("struct epoll_event["..self.max_poll_size.."]") local curfds = 1 - local client_addr = ffi.new("struct sockaddr[1]") - local addr_size = ffi.new("socklen_t[1]", ffi.sizeof(client_addr[0])) local buflen = 4096 local buffer = ffi.new("char ["..buflen.."]") local datain = {} @@ -124,7 +122,7 @@ function TCP:run() -- the loop below will run zero times if nfds < 1, ignoring errors for n = 0, nfds-1 do if evs[n].data.fd == self.sockfd then - local newfd = C.accept(self.sockfd, client_addr, addr_size) + local newfd = C.accept(self.sockfd, nil, nil) if newfd < 0 then break end