Mercurial > prosody-hg
comparison net/server_epoll.lua @ 7602:a4d5eec36a17
net.server_epoll: Prevent invalid FDs from being added to epoll
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 18 Aug 2016 17:16:21 +0200 |
| parents | ce20546d7714 |
| children | 4e2b019ff176 |
comparison
equal
deleted
inserted
replaced
| 7601:ce20546d7714 | 7602:a4d5eec36a17 |
|---|---|
| 244 local currentflags = self._flags; | 244 local currentflags = self._flags; |
| 245 if flags == currentflags then | 245 if flags == currentflags then |
| 246 return true; | 246 return true; |
| 247 end | 247 end |
| 248 local fd = self:getfd(); | 248 local fd = self:getfd(); |
| 249 if fd < 0 then | |
| 250 self._wantread, self._wantwrite = nil, nil; | |
| 251 return nil, "invalid fd"; | |
| 252 end | |
| 249 local op = "mod"; | 253 local op = "mod"; |
| 250 if not flags then | 254 if not flags then |
| 251 op = "del"; | 255 op = "del"; |
| 252 elseif not currentflags then | 256 elseif not currentflags then |
| 253 op = "add"; | 257 op = "add"; |
