Skip to content

Commit

Permalink
Fix WebSocketContext::create sizeof bug
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Dec 28, 2018
1 parent 1e5bb25 commit 73b4fc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/WebSocketContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,13 @@ struct WebSocketContext : StaticDispatch<SSL> {

// we do not need SSL options as we come from adoptions
static WebSocketContext *create(Loop *loop, SOCKET_CONTEXT_TYPE *parentSocketContext) {
WebSocketContext *webSocketContext;

// todo: sizeof
webSocketContext = (WebSocketContext *) static_dispatch(us_create_child_ssl_socket_context, us_create_child_socket_context)(parentSocketContext, 100);
WebSocketContext *webSocketContext = (WebSocketContext *)static_dispatch(us_create_child_ssl_socket_context, us_create_child_socket_context)(parentSocketContext, sizeof(WebSocketContextData<SSL>));
if (!webSocketContext) {
return nullptr;
}

/* Init socket context data */
new ((WebSocketContextData<SSL> *) static_dispatch(us_ssl_socket_context_ext, us_socket_context_ext)((SOCKET_CONTEXT_TYPE *) webSocketContext)) WebSocketContextData<SSL>();
new ((WebSocketContextData<SSL> *) static_dispatch(us_ssl_socket_context_ext, us_socket_context_ext)((SOCKET_CONTEXT_TYPE *)webSocketContext)) WebSocketContextData<SSL>;
return webSocketContext->init();
}

Expand Down
2 changes: 1 addition & 1 deletion uSockets
Submodule uSockets updated 3 files
+0 −15 NOTICE
+137 −40 misc/manual.md
+2 −2 src/ssl.c

0 comments on commit 73b4fc3

Please sign in to comment.