Skip to content

Commit

Permalink
preOpen should give context
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Aug 23, 2024
1 parent 31bf087 commit 7fa38c6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ struct TemplatedApp {
}

/* Register event handler for accepted FD. Can be used together with adoptSocket. */
BuilderPatternReturnType &&preOpen(LIBUS_SOCKET_DESCRIPTOR (*handler)(LIBUS_SOCKET_DESCRIPTOR)) {
BuilderPatternReturnType &&preOpen(LIBUS_SOCKET_DESCRIPTOR (*handler)(struct us_socket_context_t *, LIBUS_SOCKET_DESCRIPTOR)) {
httpContext->onPreOpen(handler);
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
}
Expand Down
2 changes: 1 addition & 1 deletion src/HttpContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ struct HttpContext {
return us_socket_context_listen_unix(SSL, getSocketContext(), path, options, sizeof(HttpResponseData<SSL>));
}

void onPreOpen(LIBUS_SOCKET_DESCRIPTOR (*handler)(LIBUS_SOCKET_DESCRIPTOR)) {
void onPreOpen(LIBUS_SOCKET_DESCRIPTOR (*handler)(struct us_socket_context_t *, LIBUS_SOCKET_DESCRIPTOR)) {
us_socket_context_on_pre_open(SSL, getSocketContext(), handler);
}

Expand Down
2 changes: 1 addition & 1 deletion src/LocalCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct LocalCluster {

cb(*app);

app->preOpen([](LIBUS_SOCKET_DESCRIPTOR fd) -> LIBUS_SOCKET_DESCRIPTOR {
app->preOpen([](struct us_socket_context_t *context, LIBUS_SOCKET_DESCRIPTOR fd) -> LIBUS_SOCKET_DESCRIPTOR {

/* Distribute this socket in round robin fashion */
//std::cout << "About to load balance " << fd << " to " << roundRobin << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion uSockets

0 comments on commit 7fa38c6

Please sign in to comment.