server: minor tweaks to use more cpp features (#23785)

* misc(server): add default port to impl RAII

* misc(server): register_gcp_compat() can be const

* misc(server): use proper cpp const/auto methods

* misc(server): do not reset a unique_ptr, use make_unique instead to be exception safe
This commit is contained in:
Funtowicz Morgan
2026-05-28 14:00:25 +02:00
committed by GitHub
parent a919001134
commit 0b246862b9
2 changed files with 34 additions and 36 deletions
+2 -2
View File
@@ -73,7 +73,7 @@ struct server_http_context {
std::string path_prefix;
std::string hostname;
int port;
int port = 8080;
bool is_ssl = false;
server_http_context();
@@ -88,7 +88,7 @@ struct server_http_context {
// Register the Google Cloud Platform (Vertex AI) compat (AIP_PREDICT_ROUTE env var, or /predict)
// Must be called AFTER all other API routes are registered
void register_gcp_compat();
void register_gcp_compat() const;
// for debugging
std::string listening_address;