diff options
Diffstat (limited to 'ot_udp.c')
| -rw-r--r-- | ot_udp.c | 21 |
1 files changed, 6 insertions, 15 deletions
| @@ -220,26 +220,17 @@ int handle_udp6(int64_t serversocket, struct ot_workstruct *ws) { | |||
| 220 | static void *udp_worker(void *args) { | 220 | static void *udp_worker(void *args) { |
| 221 | struct udp_worker *me = args; | 221 | struct udp_worker *me = args; |
| 222 | struct ot_workstruct ws; | 222 | struct ot_workstruct ws; |
| 223 | memset(&ws, 0, sizeof(ws)); | ||
| 224 | 223 | ||
| 225 | stats_counters_register(&ws); | 224 | if (workstruct_init(&ws) == -1) { |
| 226 | ws.inbuf = malloc(G_INBUF_SIZE); | 225 | fprintf(stderr, "Warning: a udp worker could not get its buffers and will not run.\n"); |
| 227 | ws.outbuf = malloc(G_OUTBUF_SIZE); | 226 | atomic_store(&me->left, 1); |
| 228 | #ifdef _DEBUG_HTTPERROR | 227 | return NULL; |
| 229 | ws.debugbuf = malloc(G_DEBUGBUF_SIZE); | 228 | } |
| 230 | #endif | ||
| 231 | 229 | ||
| 232 | while (g_opentracker_running) | 230 | while (g_opentracker_running) |
| 233 | handle_udp6(me->sock, &ws); | 231 | handle_udp6(me->sock, &ws); |
| 234 | 232 | ||
| 235 | stats_counters_retire(&ws); | 233 | workstruct_deinit(&ws); |
| 236 | |||
| 237 | free(ws.inbuf); | ||
| 238 | free(ws.outbuf); | ||
| 239 | #ifdef _DEBUG_HTTPERROR | ||
| 240 | free(ws.debugbuf); | ||
| 241 | #endif | ||
| 242 | |||
| 243 | atomic_store(&me->left, 1); | 234 | atomic_store(&me->left, 1); |
| 244 | return NULL; | 235 | return NULL; |
| 245 | } | 236 | } |
