Skip to content

Commit

Permalink
also adding a default config option for newly generated sbi connections
Browse files Browse the repository at this point in the history
  • Loading branch information
spencersevilla committed Feb 13, 2025
1 parent 24ff3e0 commit ff20738
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/sbi/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ ogs_sbi_client_t *ogs_sbi_client_add(
client->sslkeylog =
ogs_strdup(ogs_sbi_self()->tls.client.sslkeylog);

if (ogs_sbi_self()->local_if)
client->local_if = ogs_strdup(ogs_sbi_self()->local_if);

ogs_debug("ogs_sbi_client_add [%s]", OpenAPI_uri_scheme_ToString(scheme));
OGS_OBJECT_REF(client);

Expand Down
4 changes: 3 additions & 1 deletion lib/sbi/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ int ogs_sbi_context_parse_config(
const char *default_key =
ogs_yaml_iter_key(&default_iter);
ogs_assert(default_key);
if (!strcmp(default_key, "tls")) {
if (!strcmp(default_key, "interface")) {
self.local_if = ogs_yaml_iter_value(&default_iter);
} else if (!strcmp(default_key, "tls")) {
ogs_yaml_iter_t tls_iter;
ogs_yaml_iter_recurse(&default_iter, &tls_iter);
while (ogs_yaml_iter_next(&tls_iter)) {
Expand Down
2 changes: 2 additions & 0 deletions lib/sbi/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ typedef struct ogs_sbi_context_s {
} client;
} tls;

const char *local_if;

ogs_list_t server_list;
ogs_list_t client_list;

Expand Down

0 comments on commit ff20738

Please sign in to comment.