Software / code / prosody
Comparison
util-src/poll.c @ 9437:b202aa1e2d7b
util.poll: Fix monitoring of socket exceptions in select mode
Since state->err is a set of all watched FDs, this mistake caused all
sockets to appear to have errors.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 06 Oct 2018 17:19:50 +0200 |
| parent | 9318:3429006518bf |
| child | 9440:1ddecde4ce98 |
comparison
equal
deleted
inserted
replaced
| 9436:a950f9fa9137 | 9437:b202aa1e2d7b |
|---|---|
| 291 | 291 |
| 292 struct timeval tv; | 292 struct timeval tv; |
| 293 tv.tv_sec = (time_t)timeout; | 293 tv.tv_sec = (time_t)timeout; |
| 294 tv.tv_usec = ((suseconds_t)(timeout * 1000000)) % 1000000; | 294 tv.tv_usec = ((suseconds_t)(timeout * 1000000)) % 1000000; |
| 295 | 295 |
| 296 ret = select(FD_SETSIZE, &state->readable, &state->writable, NULL, &tv); | 296 ret = select(FD_SETSIZE, &state->readable, &state->writable, &state->err, &tv); |
| 297 #endif | 297 #endif |
| 298 | 298 |
| 299 if(ret == 0) { | 299 if(ret == 0) { |
| 300 lua_pushnil(L); | 300 lua_pushnil(L); |
| 301 lua_pushstring(L, "timeout"); | 301 lua_pushstring(L, "timeout"); |