Skip to content

Commit

Permalink
Fix tap after merge
Browse files Browse the repository at this point in the history
   * Replace lib.timer by lib.throttle
   * Replace self.sock by self.fd in read()
  • Loading branch information
alexandergall committed Jul 27, 2017
1 parent c821bf2 commit 47fa2ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apps/tap/tap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function Tap:new (conf)
sock = sock,
ifr = ifr,
name = name,
status_timer = lib.timer(0.001, 'repeating', engine.now),
status_timer = lib.throttle(0.001),
pkt = packet.allocate(),
shm = { rxbytes = {counter},
rxpackets = {counter},
Expand Down Expand Up @@ -164,7 +164,7 @@ function Tap:pull ()
self:status()
end
for i=1,engine.pull_npackets do
local len, err = S.read(self.sock, self.pkt.data, C.PACKET_PAYLOAD_SIZE)
local len, err = S.read(self.fd, self.pkt.data, C.PACKET_PAYLOAD_SIZE)
-- errno == EAGAIN indicates that the read would of blocked as there is no
-- packet waiting. It is not a failure.
if not len and err.errno == const.E.AGAIN then
Expand Down

0 comments on commit 47fa2ce

Please sign in to comment.