Skip to content

Commit 7fa38c6

Browse files
committed
preOpen should give context
1 parent 31bf087 commit 7fa38c6

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/App.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ struct TemplatedApp {
571571
}
572572

573573
/* Register event handler for accepted FD. Can be used together with adoptSocket. */
574-
BuilderPatternReturnType &&preOpen(LIBUS_SOCKET_DESCRIPTOR (*handler)(LIBUS_SOCKET_DESCRIPTOR)) {
574+
BuilderPatternReturnType &&preOpen(LIBUS_SOCKET_DESCRIPTOR (*handler)(struct us_socket_context_t *, LIBUS_SOCKET_DESCRIPTOR)) {
575575
httpContext->onPreOpen(handler);
576576
return std::move(static_cast<BuilderPatternReturnType &&>(*this));
577577
}

src/HttpContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ struct HttpContext {
489489
return us_socket_context_listen_unix(SSL, getSocketContext(), path, options, sizeof(HttpResponseData<SSL>));
490490
}
491491

492-
void onPreOpen(LIBUS_SOCKET_DESCRIPTOR (*handler)(LIBUS_SOCKET_DESCRIPTOR)) {
492+
void onPreOpen(LIBUS_SOCKET_DESCRIPTOR (*handler)(struct us_socket_context_t *, LIBUS_SOCKET_DESCRIPTOR)) {
493493
us_socket_context_on_pre_open(SSL, getSocketContext(), handler);
494494
}
495495

src/LocalCluster.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct LocalCluster {
3434

3535
cb(*app);
3636

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

3939
/* Distribute this socket in round robin fashion */
4040
//std::cout << "About to load balance " << fd << " to " << roundRobin << std::endl;

0 commit comments

Comments
 (0)