uNetworking / uSockets

Miniscule cross-platform eventing, networking & crypto for async applications
Apache License 2.0
1.29k stars 268 forks source link

us_timer_ext in libuv.c returns wrong pointer #86

Closed AdrianEddy closed 4 years ago

AdrianEddy commented 4 years ago

Looks like us_timer_ext in libuv.c returns pointer to uv_timer_t instead of a pointer past uv_timer_t, to actual ext data

I ran into issues using timers with libuv on windows and changing the us_timer_ext code to:

void *us_timer_ext(struct us_timer_t *timer) {
    return ((char *) timer) + sizeof(struct us_internal_callback_t) + sizeof(uv_timer_t);
}

fixed the issue

ghost commented 4 years ago

Fixed, thanks