From 3a3b433849b2088aaceeac6d258b3ade029ff9e3 Mon Sep 17 00:00:00 2001 From: Dmitry Frank Date: Fri, 9 Jun 2017 14:16:14 +0100 Subject: [PATCH] Don't ignore userdata in mg_bind PUBLISHED_FROM=0ffcd770535efa66ff1b6f9201f2caf832bd5055 --- mongoose.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mongoose.c b/mongoose.c index 9dbc4943..18467af7 100644 --- a/mongoose.c +++ b/mongoose.c @@ -2783,6 +2783,10 @@ struct mg_connection *mg_bind_opt(struct mg_mgr *mgr, const char *address, struct mg_add_sock_opts add_sock_opts; char host[MG_MAX_HOST_LEN]; +#if MG_ENABLE_CALLBACK_USERDATA + opts.user_data = user_data; +#endif + MG_COPY_COMMON_CONNECTION_OPTIONS(&add_sock_opts, &opts); #if MG_ENABLE_TUN @@ -2846,9 +2850,6 @@ struct mg_connection *mg_bind_opt(struct mg_mgr *mgr, const char *address, } mg_add_conn(nc->mgr, nc); -#if MG_ENABLE_CALLBACK_USERDATA - (void) user_data; -#endif return nc; }