diff options
Diffstat (limited to 'src/opentracker.c')
| -rw-r--r-- | src/opentracker.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/opentracker.c b/src/opentracker.c index 759a6d0..36dff71 100644 --- a/src/opentracker.c +++ b/src/opentracker.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include "ot_config.h" | 25 | #include "ot_config.h" |
| 26 | #include "ot_hex.h" | 26 | #include "ot_hex.h" |
| 27 | #include "ot_http.h" | 27 | #include "ot_http.h" |
| 28 | #include "ot_iovec.h" | ||
| 28 | #include "ot_ip.h" | 29 | #include "ot_ip.h" |
| 29 | #include "ot_livesync.h" | 30 | #include "ot_livesync.h" |
| 30 | #include "ot_mutex.h" | 31 | #include "ot_mutex.h" |
| @@ -107,6 +108,7 @@ static void *server_mainloop(void *args) { | |||
| 107 | struct iovec *iovector; | 108 | struct iovec *iovector; |
| 108 | size_t iovec_entries; | 109 | size_t iovec_entries; |
| 109 | int is_partial; | 110 | int is_partial; |
| 111 | uint32_t generation; | ||
| 110 | 112 | ||
| 111 | (void)args; | 113 | (void)args; |
| 112 | 114 | ||
| @@ -149,8 +151,13 @@ static void *server_mainloop(void *args) { | |||
| 149 | } | 151 | } |
| 150 | } | 152 | } |
| 151 | 153 | ||
| 152 | while ((sock = workqueue_popresult(&iovec_entries, &iovector, &is_partial)) != -1) | 154 | while ((sock = workqueue_popresult(&iovec_entries, &iovector, &is_partial, &generation)) != -1) { |
| 155 | if (fdstate_generation((int)sock) != generation) { | ||
| 156 | iovec_free(&iovec_entries, &iovector); | ||
| 157 | continue; | ||
| 158 | } | ||
| 153 | http_sendiovecdata(sock, &ws, iovec_entries, iovector, is_partial); | 159 | http_sendiovecdata(sock, &ws, iovec_entries, iovector, is_partial); |
| 160 | } | ||
| 154 | 161 | ||
| 155 | if (time_is_past(next_timeout_check)) { | 162 | if (time_is_past(next_timeout_check)) { |
| 156 | int cursor = 0; | 163 | int cursor = 0; |
