Skip to content

Commit f58ed81

Browse files
committed
When listening on a unix domain socket don't print http:// and port
Instead show something like this: main: server is listening on file.sock - starting the main loop Signed-off-by: Eric Curtin <[email protected]>
1 parent 97340b4 commit f58ed81

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/server/server.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4959,7 +4959,14 @@ int main(int argc, char ** argv) {
49594959
SetConsoleCtrlHandler(reinterpret_cast<PHANDLER_ROUTINE>(console_ctrl_handler), true);
49604960
#endif
49614961

4962-
LOG_INF("%s: server is listening on http://%s:%d - starting the main loop\n", __func__, params.hostname.c_str(), params.port);
4962+
std::string full_url;
4963+
if (string_ends_with(std::string(params.hostname), ".sock")) {
4964+
full_url = params.hostname;
4965+
} else {
4966+
full_url = "http://" + params.hostname + std::to_string(params.port);
4967+
}
4968+
4969+
LOG_INF("%s: server is listening on %s - starting the main loop\n", __func__, full_url.c_str());
49634970

49644971
// this call blocks the main thread until queue_tasks.terminate() is called
49654972
ctx_server.queue_tasks.start_loop();

0 commit comments

Comments
 (0)