server : fix the log message when using SSL (#23393)
When llama-server is started with SSL key and cert, the log says that it listens on http instead of https. This patch fixes this.
This commit is contained in:
@@ -99,6 +99,7 @@ bool server_http_context::init(const common_params & params) {
|
|||||||
srv.reset(
|
srv.reset(
|
||||||
new httplib::SSLServer(params.ssl_file_cert.c_str(), params.ssl_file_key.c_str())
|
new httplib::SSLServer(params.ssl_file_cert.c_str(), params.ssl_file_key.c_str())
|
||||||
);
|
);
|
||||||
|
is_ssl = true;
|
||||||
} else {
|
} else {
|
||||||
SRV_INF("%s", "running without SSL\n");
|
SRV_INF("%s", "running without SSL\n");
|
||||||
srv.reset(new httplib::Server());
|
srv.reset(new httplib::Server());
|
||||||
@@ -379,7 +380,7 @@ bool server_http_context::start() {
|
|||||||
srv->wait_until_ready();
|
srv->wait_until_ready();
|
||||||
|
|
||||||
listening_address = is_sock ? string_format("unix://%s", hostname.c_str())
|
listening_address = is_sock ? string_format("unix://%s", hostname.c_str())
|
||||||
: string_format("http://%s:%d", hostname.c_str(), port);
|
: string_format("%s://%s:%d", is_ssl ? "https" : "http", hostname.c_str(), port);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ struct server_http_context {
|
|||||||
std::string path_prefix;
|
std::string path_prefix;
|
||||||
std::string hostname;
|
std::string hostname;
|
||||||
int port;
|
int port;
|
||||||
|
bool is_ssl = false;
|
||||||
|
|
||||||
server_http_context();
|
server_http_context();
|
||||||
~server_http_context();
|
~server_http_context();
|
||||||
|
|||||||
Reference in New Issue
Block a user