From 2f8805acce784519a2913d34a9aa1fb23854f968 Mon Sep 17 00:00:00 2001 From: secwall Date: Wed, 4 Dec 2024 11:17:45 +0100 Subject: [PATCH] Fix some minor typos --- CMakeLists.txt | 2 +- .../odyssey-dev-with-watchdog.conf | 2 +- docker/lagpolling/lag-conf.conf | 2 +- docker/ody_integration_test/pkg/util.go | 6 +-- docker/shell-test/conf.conf | 2 +- docker/shell-test/conf2.conf | 2 +- documentation/configuration.md | 4 +- documentation/internals.md | 2 +- odyssey.conf | 18 ++++---- scripts/pgsql_benchmark.sh | 2 +- scripts/pgsql_check.sh | 2 +- sources/auth.c | 8 ++-- sources/auth_query.c | 8 ++-- sources/auth_query.h | 2 +- sources/backend.c | 12 ++--- sources/config.c | 2 +- sources/config_reader.c | 46 +++++++++---------- sources/config_reader.h | 2 +- sources/console.c | 8 ++-- sources/ejection.c | 2 +- sources/extension.h | 33 +++++++++++++ sources/extention.h | 33 ------------- sources/frontend.c | 18 ++++---- sources/global.h | 6 +-- sources/grac_shutdown_worker.c | 2 +- sources/hashmap.c | 6 +-- sources/hashmap.h | 4 +- sources/instance.c | 16 +++---- sources/ldap.c | 2 +- sources/logger.c | 2 +- sources/logger.h | 2 +- sources/mdb_iamproxy.c | 10 ++-- sources/module.c | 2 +- sources/odyssey.h | 2 +- sources/pool.c | 2 +- sources/relay.h | 2 +- sources/reset.c | 6 +-- sources/router.c | 6 +-- sources/rules.c | 6 +-- sources/rules.h | 2 +- sources/scram.c | 2 +- sources/server.h | 2 +- sources/sighandler.c | 2 +- sources/storage.c | 2 +- sources/system.c | 6 +-- sources/tdigest.h | 2 +- sources/thread_global.h | 2 +- sources/worker.c | 2 +- third_party/machinarium/gdb/README.md | 2 +- .../machinarium/gdb/machinarium-gdb.py | 2 +- 50 files changed, 160 insertions(+), 160 deletions(-) create mode 100644 sources/extension.h delete mode 100644 sources/extention.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fd16af99..921edf429 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,7 +195,7 @@ message(STATUS "Odyssey (version: ${OD_VERSION_NUMBER}-${OD_VERSION_GIT}-${OD_VE message(STATUS "") message(STATUS "using compiler: ${CMAKE_C_COMPILER} version ${OD_COMPILER_VERSION}") -message(STATUS "c lang standart: ${CLANGCOMPILERSTANDART}") +message(STATUS "c lang standard: ${CLANGCOMPILERSTANDARD}") message(STATUS " ") message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") message(STATUS "BUILD_DEBIAN: ${BUILD_DEBIAN}") diff --git a/config-examples/odyssey-dev-with-watchdog.conf b/config-examples/odyssey-dev-with-watchdog.conf index 2150145cd..1ecf137a4 100644 --- a/config-examples/odyssey-dev-with-watchdog.conf +++ b/config-examples/odyssey-dev-with-watchdog.conf @@ -53,7 +53,7 @@ storage "postgres_server" { watchdog { authentication "none" -# makes no sence +# makes no sense storage "postgres_server" storage_db "postgres" storage_user "lag_usr" diff --git a/docker/lagpolling/lag-conf.conf b/docker/lagpolling/lag-conf.conf index 159a5ba5e..7fb6212f8 100644 --- a/docker/lagpolling/lag-conf.conf +++ b/docker/lagpolling/lag-conf.conf @@ -52,7 +52,7 @@ storage "postgres_server" { watchdog { authentication "none" -# makes no sence +# makes no sense storage "postgres_server" storage_db "postgres" storage_user "postgres" diff --git a/docker/ody_integration_test/pkg/util.go b/docker/ody_integration_test/pkg/util.go index 1ac0a9bb6..ff42eaee8 100644 --- a/docker/ody_integration_test/pkg/util.go +++ b/docker/ody_integration_test/pkg/util.go @@ -87,7 +87,7 @@ func pidNyName(procName string) (int, error) { func signalToProc(sig syscall.Signal, procName string) (*os.Process, error) { pid, err := pidNyName(procName) if err != nil { - err = fmt.Errorf("error due sending singal %s to process %s %w", sig.String(), procName, err) + err = fmt.Errorf("error due sending signal %s to process %s %w", sig.String(), procName, err) fmt.Println(err) return nil, err } @@ -95,14 +95,14 @@ func signalToProc(sig syscall.Signal, procName string) (*os.Process, error) { p, err := os.FindProcess(pid) if err != nil { - err = fmt.Errorf("error due sending singal %s to process %s %w", sig.String(), procName, err) + err = fmt.Errorf("error due sending signal %s to process %s %w", sig.String(), procName, err) fmt.Println(err) return p, err } err = p.Signal(sig) if err != nil { - err = fmt.Errorf("error due sending singal %s to process %s %w", sig.String(), procName, err) + err = fmt.Errorf("error due sending signal %s to process %s %w", sig.String(), procName, err) fmt.Println(err) return p, err } diff --git a/docker/shell-test/conf.conf b/docker/shell-test/conf.conf index c7e765bcb..31c1435ad 100644 --- a/docker/shell-test/conf.conf +++ b/docker/shell-test/conf.conf @@ -58,7 +58,7 @@ storage "postgres_server" { watchdog { authentication "none" -# makes no sence +# makes no sense storage "postgres_server" storage_db "postgres" storage_user "postgres" diff --git a/docker/shell-test/conf2.conf b/docker/shell-test/conf2.conf index 9695e8a22..3791c4d15 100644 --- a/docker/shell-test/conf2.conf +++ b/docker/shell-test/conf2.conf @@ -52,7 +52,7 @@ storage "postgres_server" { watchdog { authentication "none" -# makes no sence +# makes no sense storage "postgres_server" storage_db "postgres" storage_user "postgres" diff --git a/documentation/configuration.md b/documentation/configuration.md index f1dd01902..bf8ad755b 100644 --- a/documentation/configuration.md +++ b/documentation/configuration.md @@ -246,7 +246,7 @@ TCP keep-alive probes to send before giving up and killing the connection i When the value is greater than 0, it specifies the maximum amount of time in milliseconds that transmitted data may remain unacknowledged before TCP will forcibly close the corresponding connection. -When the value is negaive, the default system user timeout will be used. +When the value is negative, the default system user timeout will be used. When no value or 0 is provided `1000 * (keepalive + keepalive_keep_interval * keepalive_probes) - 500` is used. @@ -392,7 +392,7 @@ If specified, odyssey will bind socket with SO_REUSEPORT option. ##### graceful_die_on_errors *yes|no* -If specified, after receiving the singal SIGUSR2, +If specified, after receiving the signal SIGUSR2, Odyssey will shutdown the socket for receptions and continue working only with old connections #### tls *string* diff --git a/documentation/internals.md b/documentation/internals.md index b3641d2a2..24a255230 100644 --- a/documentation/internals.md +++ b/documentation/internals.md @@ -155,7 +155,7 @@ Free client context. #### Client error codes -In the most scenarios PostgreSQL error messages `ErrorResponce` are copied to a client as-is. Yet, there are some +In the most scenarios PostgreSQL error messages `ErrorResponse` are copied to a client as-is. Yet, there are some cases, when Odyssey has to provide its own error message and SQLCode to client. Function `od_frontend_error()` is used for formatting and sending error message to client. diff --git a/odyssey.conf b/odyssey.conf index 3fe42a81f..d7808fd13 100644 --- a/odyssey.conf +++ b/odyssey.conf @@ -69,9 +69,9 @@ locks_dir "/tmp/odyssey" graceful_die_on_errors no # -# Online restart feauture. +# Online restart feature. # When setting to yes, restart odyssey simply with -# running new version (old one will automaticly perform graceful shutdown) +# running new version (old one will automatically perform graceful shutdown) # enable_online_restart no @@ -177,7 +177,7 @@ log_query no log_stats yes # -# Statistics update inverval. +# Statistics update interval. # # Set interval in seconds for internal statistics update and log report. # @@ -434,8 +434,8 @@ storage "postgres_server" { # Target session attrs feature. Odyssey will lookup for primary/standby, depending on # value set. # Possible values are: -# * read-write - always select host, avalible for write -# * read-only - never select host, avalible for write +# * read-write - always select host, available for write +# * read-only - never select host, available for write # * any (the default one) - select host randomly # # Odyssey will traverse host and execute pg_is_in_recovery against them, to check if @@ -465,7 +465,7 @@ storage "postgres_server" { # Storage lag-polling watchdog # # Defines storage lag-polling watchdog options and actually enables cron-like -# watchdog for this storage. This routine will execute `watchdog_lag_query` againts +# watchdog for this storage. This routine will execute `watchdog_lag_query` against # storage server and send return value to all routes, to decide, if connecting is desirable # with particular lag value. @@ -485,7 +485,7 @@ storage "postgres_server" { log_debug no -# Watchdog will execute this query to get underlaying server lag. +# Watchdog will execute this query to get underlying server lag. # Consider something like now() - pg_last_xact_replay_timestamp() or # git@github.com:man-brain/repl_mon.git for production usages watchdog_lag_query "SELECT TRUNC(EXTRACT(EPOCH FROM NOW())) - 100" @@ -510,7 +510,7 @@ database default { # # Authentication certificate CN. # -# Specify common names to check for "cert" authentification method. +# Specify common names to check for "cert" authentication method. # If there are more then one common name is defined, all of them # will be checked until match. # @@ -661,7 +661,7 @@ database default { reserve_session_server_connection yes # -# Server lifetime - maximum number of seconds for a server connetion to live. Prevents cache bloat. +# Server lifetime - maximum number of seconds for a server connection to live. Prevents cache bloat. # Defaults to 3600 (1 hour) # diff --git a/scripts/pgsql_benchmark.sh b/scripts/pgsql_benchmark.sh index 177c78304..6b4669617 100755 --- a/scripts/pgsql_benchmark.sh +++ b/scripts/pgsql_benchmark.sh @@ -30,7 +30,7 @@ fi if [ -z "$(ls -A $PGSRC)" ]; then START_WD=$PWD - echo "PGSRC dir is empty, aquiring PostgreSQL sources REL_11_STABLE" + echo "PGSRC dir is empty, acquiring PostgreSQL sources REL_11_STABLE" git clone --depth=5 --single-branch --branch=REL_11_STABLE https://github.com/postgres/postgres $PGSRC cd $PGSRC echo "configure" diff --git a/scripts/pgsql_check.sh b/scripts/pgsql_check.sh index 272ffea7b..438897e98 100755 --- a/scripts/pgsql_check.sh +++ b/scripts/pgsql_check.sh @@ -30,7 +30,7 @@ fi if [ -z "$(ls -A $PGSRC)" ]; then START_WD=$PWD - echo "PGSRC dir is empty, aquiring PostgreSQL sources REL_11_STABLE" + echo "PGSRC dir is empty, acquiring PostgreSQL sources REL_11_STABLE" git clone --depth=5 --single-branch --branch=REL_11_STABLE https://github.com/postgres/postgres $PGSRC cd $PGSRC echo "configure" diff --git a/sources/auth.c b/sources/auth.c index f87a65e65..59fd6f387 100644 --- a/sources/auth.c +++ b/sources/auth.c @@ -65,7 +65,7 @@ static inline int od_auth_frontend_cleartext(od_client_t *client) "saved user password to perform backend auth"); } - od_extention_t *extentions = client->global->extentions; + od_extension_t *extensions = client->global->extensions; /* support mdb_iamproxy authentication */ if (client->rule->enable_mdb_iamproxy_auth) { @@ -75,7 +75,7 @@ static inline int od_auth_frontend_cleartext(od_client_t *client) kiwi_password_free(&client_token); machine_msg_free(msg); if (authentication_result != OK_RESPONSE) { - goto auth_failed; // refence at line 80, 100 and etc + goto auth_failed; // reference at line 80, 100 and etc } return OK_RESPONSE; } @@ -96,7 +96,7 @@ static inline int od_auth_frontend_cleartext(od_client_t *client) } #endif if (client->rule->auth_module) { - od_module_t *modules = extentions->modules; + od_module_t *modules = extensions->modules; /* auth callback */ od_module_t *module; @@ -1055,7 +1055,7 @@ int od_auth_backend(od_server_t *server, machine_msg_t *msg, } od_debug(&instance->logger, "auth", NULL, server, - "recieved msg type %u", auth_type); + "received msg type %u", auth_type); msg = NULL; diff --git a/sources/auth_query.c b/sources/auth_query.c index 51c914dfe..b28a2eb29 100644 --- a/sources/auth_query.c +++ b/sources/auth_query.c @@ -69,7 +69,7 @@ static inline int od_auth_parse_passwd_from_datarow(od_logger_t *logger, goto success; } - if (password_len > ODYSSEY_AUTH_QUERY_MAX_PASSSWORD_LEN) { + if (password_len > ODYSSEY_AUTH_QUERY_MAX_PASSWORD_LEN) { goto error; } @@ -253,20 +253,20 @@ int od_auth_query(od_client_t *client, char *peer) if (od_auth_parse_passwd_from_datarow(&instance->logger, msg, password) == NOT_OK_RESPONSE) { od_debug(&instance->logger, "auth_query", auth_client, server, - "auth query returned datarow in incompatable format"); + "auth query returned datarow in incompatible format"); od_router_close(router, auth_client); od_router_unroute(router, auth_client); od_client_free(auth_client); goto error; } - /* save received password and recieve timestamp */ + /* save received password and receive timestamp */ if (cache_value->passwd != NULL) { /* drop previous value */ free(cache_value->passwd); // there should be cache_value->passwd = NULL for sanity - // but this is meaninigless sinse we assing new value just below + // but this is meaninigless since we assign new value just below } cache_value->passwd_len = password->password_len; cache_value->passwd = malloc(password->password_len); diff --git a/sources/auth_query.h b/sources/auth_query.h index cb126bf52..a57b6c4eb 100644 --- a/sources/auth_query.h +++ b/sources/auth_query.h @@ -7,7 +7,7 @@ * Scalable PostgreSQL connection pooler. */ -#define ODYSSEY_AUTH_QUERY_MAX_PASSSWORD_LEN 4096 +#define ODYSSEY_AUTH_QUERY_MAX_PASSWORD_LEN 4096 int od_auth_query(od_client_t *, char *); diff --git a/sources/backend.c b/sources/backend.c index 573eba2dd..4d0a62fe0 100644 --- a/sources/backend.c +++ b/sources/backend.c @@ -474,7 +474,7 @@ static inline int od_storage_parse_rw_check_response(machine_msg_t *msg) return NOT_OK_RESPONSE; } -static inline od_retcode_t od_backend_attemp_connect_with_tsa( +static inline od_retcode_t od_backend_attempt_connect_with_tsa( od_server_t *server, char *context, kiwi_params_t *route_params, char *host, int port, od_tls_opts_t *opts, od_target_session_attrs_t attrs, od_client_t *client) @@ -545,14 +545,14 @@ int od_backend_connect(od_server_t *server, char *context, switch (storage->target_session_attrs) { case OD_TARGET_SESSION_ATTRS_RW: for (i = 0; i < storage->endpoints_count; ++i) { - if (od_backend_attemp_connect_with_tsa( + if (od_backend_attempt_connect_with_tsa( server, context, route_params, storage->endpoints[i].host, storage->endpoints[i].port, storage->tls_opts, OD_TARGET_SESSION_ATTRS_RW, client) == NOT_OK_RESPONSE) { - /*backend connection not macthed by TSA */ + /*backend connection not matched by TSA */ assert(server->io.io == NULL); continue; } @@ -573,14 +573,14 @@ int od_backend_connect(od_server_t *server, char *context, return NOT_OK_RESPONSE; case OD_TARGET_SESSION_ATTRS_RO: for (i = 0; i < storage->endpoints_count; ++i) { - if (od_backend_attemp_connect_with_tsa( + if (od_backend_attempt_connect_with_tsa( server, context, route_params, storage->endpoints[i].host, storage->endpoints[i].port, storage->tls_opts, OD_TARGET_SESSION_ATTRS_RO, client) == NOT_OK_RESPONSE) { - /*backend connection not macthed by TSA */ + /*backend connection not matched by TSA */ assert(server->io.io == NULL); continue; } @@ -600,7 +600,7 @@ int od_backend_connect(od_server_t *server, char *context, return NOT_OK_RESPONSE; case OD_TARGET_SESSION_ATTRS_ANY: - /* fall throught */ + /* fall through */ default:; /* use rr_counter here */ char *host = NULL; /* For UNIX socket */ diff --git a/sources/config.c b/sources/config.c index 8f28262f2..e6801df77 100644 --- a/sources/config.c +++ b/sources/config.c @@ -323,7 +323,7 @@ void od_config_print(od_config_t *config, od_logger_t *logger) "socket bind with: SO_REUSEPORT"); } #ifdef USE_SCRAM - od_log(logger, "config", NULL, NULL, "SCRAM auth metod: OK"); + od_log(logger, "config", NULL, NULL, "SCRAM auth method: OK"); #endif od_log(logger, "config", NULL, NULL, ""); diff --git a/sources/config_reader.c b/sources/config_reader.c index 5fe09ab3a..6f80182a8 100644 --- a/sources/config_reader.c +++ b/sources/config_reader.c @@ -343,7 +343,7 @@ static od_keyword_t od_role_keywords[] = { static inline int od_config_reader_watchdog(od_config_reader_t *reader, od_storage_watchdog_t *watchdog, - od_extention_t *extentions); + od_extension_t *extensions); static int od_config_reader_open(od_config_reader_t *reader, char *config_file) { @@ -658,7 +658,7 @@ static int od_config_reader_storage_host(od_config_reader_t *reader, storage->endpoints[storage->endpoints_count].port = 0; /* ]:1234 */ /* ^ ^ */ - /* iter betwwen this two localtions */ + /* iter between this two locations */ for (tmp = closing_bracked_indx + 2; tmp <= j; ++tmp) { if (!isdigit(storage->host[tmp])) { @@ -804,7 +804,7 @@ static int od_config_reader_listen(od_config_reader_t *reader) } static int od_config_reader_storage(od_config_reader_t *reader, - od_extention_t *extentions) + od_extension_t *extensions) { char *tmp = NULL; od_rule_storage_t *storage; @@ -943,7 +943,7 @@ static int od_config_reader_storage(od_config_reader_t *reader, if (storage->watchdog == NULL) goto error; if (od_config_reader_watchdog(reader, storage->watchdog, - extentions) == + extensions) == NOT_OK_RESPONSE) goto error; continue; @@ -1259,7 +1259,7 @@ od_config_reader_ldap_storage_credentials(od_config_reader_t *reader, static int od_config_reader_rule_settings(od_config_reader_t *reader, od_rule_t *rule, - od_extention_t *extentions, + od_extension_t *extensions, od_storage_watchdog_t *watchdog) { rule->mdb_iamproxy_socket_path = NULL; @@ -1290,7 +1290,7 @@ static int od_config_reader_rule_settings(od_config_reader_t *reader, if (keyword == NULL) { od_list_t *i; bool token_ok = false; - od_list_foreach(&extentions->modules->link, i) + od_list_foreach(&extensions->modules->link, i) { od_module_t *curr_module; curr_module = @@ -1855,7 +1855,7 @@ static int od_config_reader_address(od_config_reader_t *reader, } static int od_config_reader_route(od_config_reader_t *reader, char *db_name, int db_name_len, int db_is_default, - od_extention_t *extentions) + od_extension_t *extensions) { char *user_name = NULL; int user_name_len = 0; @@ -1918,12 +1918,12 @@ static int od_config_reader_route(od_config_reader_t *reader, char *db_name, return NOT_OK_RESPONSE; /* unreach */ - return od_config_reader_rule_settings(reader, rule, extentions, NULL); + return od_config_reader_rule_settings(reader, rule, extensions, NULL); } static int od_config_reader_group(od_config_reader_t *reader, char *db_name, int db_name_len, int db_is_default, - od_group_t *group, od_extention_t *extentions) + od_group_t *group, od_extension_t *extensions) { /* group name */ char *group_name = NULL; @@ -1980,7 +1980,7 @@ static int od_config_reader_group(od_config_reader_t *reader, char *db_name, return NOT_OK_RESPONSE; /* unreach */ - if (od_config_reader_rule_settings(reader, rule, extentions, NULL) == + if (od_config_reader_rule_settings(reader, rule, extensions, NULL) == NOT_OK_RESPONSE) { goto error; } @@ -2002,7 +2002,7 @@ static int od_config_reader_group(od_config_reader_t *reader, char *db_name, static inline int od_config_reader_watchdog(od_config_reader_t *reader, od_storage_watchdog_t *watchdog, - od_extention_t *extentions) + od_extension_t *extensions) { watchdog->route_usr = "watchdog_int"; watchdog->route_db = "watchdog_int"; @@ -2042,7 +2042,7 @@ static inline int od_config_reader_watchdog(od_config_reader_t *reader, return NOT_OK_RESPONSE; /* unreach */ - if (od_config_reader_rule_settings(reader, rule, extentions, + if (od_config_reader_rule_settings(reader, rule, extensions, watchdog) == NOT_OK_RESPONSE) { return NOT_OK_RESPONSE; } @@ -2199,7 +2199,7 @@ od_config_reader_ldap_endpoint(od_config_reader_t *reader) #endif static inline od_retcode_t od_config_reader_module(od_config_reader_t *reader, - od_extention_t *ext) + od_extension_t *ext) { char *module_path = NULL; int rc; @@ -2259,7 +2259,7 @@ static inline od_retcode_t od_config_reader_module(od_config_reader_t *reader, } static int od_config_reader_database(od_config_reader_t *reader, - od_extention_t *extentions) + od_extension_t *extensions) { char *db_name = NULL; int db_name_len = 0; @@ -2320,7 +2320,7 @@ static int od_config_reader_database(od_config_reader_t *reader, case OD_LUSER: rc = od_config_reader_route(reader, db_name, db_name_len, db_is_default, - extentions); + extensions); if (rc == -1) goto error; continue; @@ -2332,7 +2332,7 @@ static int od_config_reader_database(od_config_reader_t *reader, } rc = od_config_reader_group(reader, db_name, db_name_len, db_is_default, - group, extentions); + group, extensions); if (rc == -1) goto error; continue; @@ -2380,7 +2380,7 @@ static void od_config_setup_default_tcp_usr_timeout(od_config_t *config) } static int od_config_reader_parse(od_config_reader_t *reader, - od_extention_t *extentions) + od_extension_t *extensions) { od_config_t *config = reader->config; for (;;) { @@ -2414,7 +2414,7 @@ static int od_config_reader_parse(od_config_reader_t *reader, return NOT_OK_RESPONSE; rc = od_config_reader_import( reader->config, reader->rules, reader->error, - extentions, reader->global, reader->hba_rules, + extensions, reader->global, reader->hba_rules, config_file); free(config_file); if (rc == -1) { @@ -2763,14 +2763,14 @@ static int od_config_reader_parse(od_config_reader_t *reader, continue; /* storage */ case OD_LSTORAGE: - rc = od_config_reader_storage(reader, extentions); + rc = od_config_reader_storage(reader, extensions); if (rc == -1) { goto error; } continue; /* database */ case OD_LDATABASE: - rc = od_config_reader_database(reader, extentions); + rc = od_config_reader_database(reader, extensions); if (rc == -1) { goto error; } @@ -2792,7 +2792,7 @@ static int od_config_reader_parse(od_config_reader_t *reader, } /* module */ case OD_LMODULE: { - rc = od_config_reader_module(reader, extentions); + rc = od_config_reader_module(reader, extensions); if (rc == -1) { goto error; } @@ -2834,7 +2834,7 @@ static int od_config_reader_parse(od_config_reader_t *reader, } int od_config_reader_import(od_config_t *config, od_rules_t *rules, - od_error_t *error, od_extention_t *extentions, + od_error_t *error, od_extension_t *extensions, od_global_t *global, od_hba_rules_t *hba_rules, char *config_file) { @@ -2851,7 +2851,7 @@ int od_config_reader_import(od_config_t *config, od_rules_t *rules, return NOT_OK_RESPONSE; } - rc = od_config_reader_parse(&reader, extentions); + rc = od_config_reader_parse(&reader, extensions); od_config_reader_close(&reader); return rc; diff --git a/sources/config_reader.h b/sources/config_reader.h index 905d7a607..b6c6868b4 100644 --- a/sources/config_reader.h +++ b/sources/config_reader.h @@ -8,7 +8,7 @@ */ extern int od_config_reader_import(od_config_t *, od_rules_t *, od_error_t *, - od_extention_t *, od_global_t *, + od_extension_t *, od_global_t *, od_hba_rules_t *, char *); #define OD_READER_ERROR_MAX_LEN 1 << 8 diff --git a/sources/console.c b/sources/console.c index ffefa3863..97b91041d 100644 --- a/sources/console.c +++ b/sources/console.c @@ -661,7 +661,7 @@ static inline int od_console_show_pools_add_cb(od_route_t *route, void **argv) goto error; if (*extended) { - /* bytes recived */ + /* bytes received */ data_len = od_snprintf(data, sizeof(data), "%" PRIu64, route->stats.recv_client); rc = kiwi_be_write_data_row_add(stream, offset, data, data_len); @@ -869,7 +869,7 @@ static inline int od_console_show_pools(od_client_t *client, return NOT_OK_RESPONSE; if (extended) { - char *bytes_rcv = "bytes_recieved"; + char *bytes_rcv = "bytes_received"; rc = kiwi_be_write_row_description_add(msg, 0, bytes_rcv, strlen(bytes_rcv), 0, 0, 23 /* INT4OID */, 4, 0, @@ -1832,7 +1832,7 @@ static inline int od_console_add_module(od_client_t *client, "loading module with path %s", module_path); int retcode = od_target_module_add( &instance->logger, - ((od_extention_t *)client->global->extentions)->modules, + ((od_extension_t *)client->global->extensions)->modules, module_path); if (retcode == 0) { od_frontend_infof(client, stream, @@ -1869,7 +1869,7 @@ static inline int od_console_unload_module(od_client_t *client, NULL, "unloading module with path %s", module_path); int retcode = od_target_module_unload( &instance->logger, - ((od_extention_t *)client->global->extentions)->modules, + ((od_extension_t *)client->global->extensions)->modules, module_path); if (retcode == 0) { od_frontend_infof(client, stream, diff --git a/sources/ejection.c b/sources/ejection.c index 2b5aaf95b..d059094d0 100644 --- a/sources/ejection.c +++ b/sources/ejection.c @@ -13,7 +13,7 @@ od_retcode_t od_conn_eject_info_init(od_conn_eject_info **info) { *info = (od_conn_eject_info *)malloc(sizeof(od_conn_eject_info)); if (*info == NULL) { - /* TODO: set errno propely */ + /* TODO: set errno properly */ return NOT_OK_RESPONSE; } diff --git a/sources/extension.h b/sources/extension.h new file mode 100644 index 000000000..fe16e59c2 --- /dev/null +++ b/sources/extension.h @@ -0,0 +1,33 @@ +#ifndef ODYSSEY_ADDON_H +#define ODYSSEY_ADDON_H + +typedef struct od_extension od_extension_t; + +struct od_extension { + od_module_t *modules; + + od_global_t *glob; +}; + +static inline od_retcode_t od_extensions_init(od_extension_t *extensions) +{ + extensions->modules = malloc(sizeof(od_module_t)); + od_modules_init(extensions->modules); + + return OK_RESPONSE; +} + +static inline od_retcode_t od_extension_free(od_logger_t *l, + od_extension_t *extensions) +{ + if (extensions->modules) { + od_modules_unload(l, extensions->modules); + } + + free(extensions->modules); + extensions->modules = NULL; + + return OK_RESPONSE; +} + +#endif /* ODYSSEY_ADDON_H */ diff --git a/sources/extention.h b/sources/extention.h deleted file mode 100644 index 94c9fea08..000000000 --- a/sources/extention.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ODYSSEY_ADDON_H -#define ODYSSEY_ADDON_H - -typedef struct od_extention od_extention_t; - -struct od_extention { - od_module_t *modules; - - od_global_t *glob; -}; - -static inline od_retcode_t od_extentions_init(od_extention_t *extentions) -{ - extentions->modules = malloc(sizeof(od_module_t)); - od_modules_init(extentions->modules); - - return OK_RESPONSE; -} - -static inline od_retcode_t od_extention_free(od_logger_t *l, - od_extention_t *extentions) -{ - if (extentions->modules) { - od_modules_unload(l, extentions->modules); - } - - free(extentions->modules); - extentions->modules = NULL; - - return OK_RESPONSE; -} - -#endif /* ODYSSEY_ADDON_H */ diff --git a/sources/frontend.c b/sources/frontend.c index 5209c5b06..52df1cb80 100644 --- a/sources/frontend.c +++ b/sources/frontend.c @@ -374,7 +374,7 @@ static inline od_frontend_status_t od_frontend_setup(od_client_t *client) od_instance_t *instance = client->global->instance; od_route_t *route = client->route; - /* set paremeters */ + /* set parameters */ od_frontend_status_t status; status = od_frontend_setup_params(client); if (status != OD_OK) @@ -605,7 +605,7 @@ static inline bool od_should_drop_connection(od_client_t *client, if (server->state == OD_SERVER_ACTIVE /* we can drop client that are just connected and do not perform any queries */ && !od_server_synchronized(server)) { - /* most probably we are not in transcation, but still executing some stmt */ + /* most probably we are not in transaction, but still executing some stmt */ return false; } if (od_unlikely(!server->is_transaction)) { @@ -634,7 +634,7 @@ static od_frontend_status_t od_frontend_local(od_client_t *client) for (;;) { machine_msg_t *msg = NULL; for (;;) { - /* local server is alwys null */ + /* local server is always null */ if (od_should_drop_connection(client, NULL)) { /* Odyssey is in a state of completion, we done * the last client's request and now we can drop the connection */ @@ -1361,7 +1361,7 @@ static od_frontend_status_t od_frontend_remote_client(od_relay_t *relay, retstatus = OD_SKIP; od_debug( &instance->logger, - "ingore closing prepared statement, report its closed", + "ignore closing prepared statement, report its closed", client, server, "statement: %.*s", name_len, name); @@ -1737,7 +1737,7 @@ static od_frontend_status_t od_frontend_remote(od_client_t *client) break; } - /* enter sync piont mode */ + /* enter sync point mode */ server->sync_point = 1; od_server_sync_request(server, 1); @@ -1985,8 +1985,8 @@ void od_frontend(void *arg) od_client_t *client = arg; od_instance_t *instance = client->global->instance; od_router_t *router = client->global->router; - od_extention_t *extentions = client->global->extentions; - od_module_t *modules = extentions->modules; + od_extension_t *extensions = client->global->extensions; + od_module_t *modules = extensions->modules; /* log client connection */ if (instance->config.log_session) { @@ -2195,7 +2195,7 @@ void od_frontend(void *arg) if (od_frontend_status_is_err(catchup_status)) { od_error( &instance->logger, "catchup", client, NULL, - "replicaion lag too big, connection rejected: %s %s", + "replication lag too big, connection rejected: %s %s", client->rule->db_is_default ? "(unknown database)" : client->startup.database.value, @@ -2206,7 +2206,7 @@ void od_frontend(void *arg) od_frontend_fatal( client, KIWI_INVALID_AUTHORIZATION_SPECIFICATION, - "replicaion lag too big, connection rejected: %s %s", + "replication lag too big, connection rejected: %s %s", client->rule->db_is_default ? "(unknown database)" : client->startup.database.value, diff --git a/sources/global.h b/sources/global.h index 480cc1556..7e44f1b85 100644 --- a/sources/global.h +++ b/sources/global.h @@ -15,13 +15,13 @@ struct od_global { void *router; void *cron; void *worker_pool; - void *extentions; + void *extensions; void *hba; }; static inline void od_global_init(od_global_t *global, void *instance, void *system, void *router, void *cron, - void *worker_pool, void *extentions, + void *worker_pool, void *extensions, void *hba) { global->instance = instance; @@ -29,7 +29,7 @@ static inline void od_global_init(od_global_t *global, void *instance, global->router = router; global->cron = cron; global->worker_pool = worker_pool; - global->extentions = extentions; + global->extensions = extensions; global->hba = hba; } diff --git a/sources/grac_shutdown_worker.c b/sources/grac_shutdown_worker.c index 349fcb004..acbf70d3c 100644 --- a/sources/grac_shutdown_worker.c +++ b/sources/grac_shutdown_worker.c @@ -51,7 +51,7 @@ void od_grac_shutdown_worker(void *arg) od_dbg_printf_on_dvl_lvl(1, "servers closed, errors: %d\n", 0); - /* wait for all servers to complete old transations */ + /* wait for all servers to complete old transactions */ od_list_foreach(&router->servers, i) { #if OD_DEVEL_LVL != OD_RELEASE_MODE diff --git a/sources/hashmap.c b/sources/hashmap.c index 83d0c9b71..497f9e33f 100644 --- a/sources/hashmap.c +++ b/sources/hashmap.c @@ -190,7 +190,7 @@ int od_hashmap_insert(od_hashmap_t *hm, od_hash_t keyhash, return -1; } } else { - /* element alrady exists, + /* element already exists, * copy *value content to ptr data * free previous value */ free(ptr->data); @@ -220,7 +220,7 @@ od_hashmap_elt_t *od_hashmap_lock_key(od_hashmap_t *hm, od_hash_t keyhash, { size_t bucket_index = keyhash % hm->size; /* - * This function is used to aquire long locks in auth_query. + * This function is used to acquire long locks in auth_query. * To avoid intra-machine locks we must yield cpu slice from time to time * even if waiting for other lock. */ @@ -242,7 +242,7 @@ od_hashmap_elt_t *od_hashmap_lock_key(od_hashmap_t *hm, od_hash_t keyhash, return NULL; } } else { - /* element alrady exists, simpty return locked key */ + /* element already exists, simpty return locked key */ return ptr; } } diff --git a/sources/hashmap.h b/sources/hashmap.h index 2ab6776e3..f315120e6 100644 --- a/sources/hashmap.h +++ b/sources/hashmap.h @@ -45,7 +45,7 @@ od_hashmap_elt_t *od_hashmap_find(od_hashmap_t *hm, od_hash_t keyhash, od_hashmap_elt_t *key); /* This function insert new key into hashmap -* If hashmap already contains value assotiated with key, +* If hashmap already contains value associated with key, * it will be rewritten. */ int od_hashmap_insert(od_hashmap_t *hm, od_hash_t keyhash, @@ -53,7 +53,7 @@ int od_hashmap_insert(od_hashmap_t *hm, od_hash_t keyhash, /* LOCK-UNLOCK API */ /* given key and its -* keyhash (murmurhash etc) return poitner +* keyhash (murmurhash etc) return pointer * to hashmap mutex-locked value pointer */ od_hashmap_elt_t *od_hashmap_lock_key(od_hashmap_t *hm, od_hash_t keyhash, od_hashmap_elt_t *key); diff --git a/sources/instance.c b/sources/instance.c index de3cd81d9..32674a3d2 100644 --- a/sources/instance.c +++ b/sources/instance.c @@ -56,16 +56,16 @@ void od_config_testing(od_instance_t *instance) od_router_t router; od_hba_t hba; od_global_t global; - od_extention_t extentions; + od_extension_t extensions; od_error_init(&error); od_router_init(&router, &global); od_hba_init(&hba); - od_extentions_init(&extentions); + od_extensions_init(&extensions); int rc; rc = od_config_reader_import(&instance->config, &router.rules, &error, - &extentions, &global, &hba.rules, + &extensions, &global, &hba.rules, instance->config_file); if (rc == -1) { od_error(&instance->logger, "config", NULL, NULL, "%s", @@ -124,7 +124,7 @@ int od_instance_main(od_instance_t *instance, int argc, char **argv) } instance->exec_path = strdup(argv[0]); /* validate command line options */ - int argindx; // index of fisrt unparsed indx + int argindx; // index of first unparsed indx if (argp_parse(&argp, argc, argv, 0, &argindx, &args) != OK_RESPONSE) { return NOT_OK_RESPONSE; } @@ -136,7 +136,7 @@ int od_instance_main(od_instance_t *instance, int argc, char **argv) od_router_t router; od_cron_t cron; od_worker_pool_t worker_pool; - od_extention_t extentions; + od_extension_t extensions; od_global_t global; od_hba_t hba; @@ -144,17 +144,17 @@ int od_instance_main(od_instance_t *instance, int argc, char **argv) od_router_init(&router, &global); od_cron_init(&cron); od_worker_pool_init(&worker_pool); - od_extentions_init(&extentions); + od_extensions_init(&extensions); od_hba_init(&hba); od_global_init(&global, instance, &system, &router, &cron, &worker_pool, - &extentions, &hba); + &extensions, &hba); /* read config file */ od_error_t error; od_error_init(&error); int rc; rc = od_config_reader_import(&instance->config, &router.rules, &error, - &extentions, &global, &hba.rules, + &extensions, &global, &hba.rules, instance->config_file); if (rc == -1) { od_error(&instance->logger, "config", NULL, NULL, "%s", diff --git a/sources/ldap.c b/sources/ldap.c index 5bde11340..1c2ac72b1 100644 --- a/sources/ldap.c +++ b/sources/ldap.c @@ -91,7 +91,7 @@ od_retcode_t od_ldap_endpoint_prepare(od_ldap_endpoint_t *le) le->ldapurl = NULL; if (!le->ldapserver) { - // TODO: support mulitple ldap servers + // TODO: support multiple ldap servers return NOT_OK_RESPONSE; } diff --git a/sources/logger.c b/sources/logger.c index d33ea924b..7b7204340 100644 --- a/sources/logger.c +++ b/sources/logger.c @@ -226,7 +226,7 @@ od_logger_format(od_logger_t *logger, od_logger_level_t level, char *context, break; } - // fall throught fix (if client is not defined will write 'none' to log file) + // fall through fix (if client is not defined will write 'none' to log file) len = od_snprintf(dst_pos, dst_end - dst_pos, "none"); dst_pos += len; diff --git a/sources/logger.h b/sources/logger.h index 766f106b3..faea192ae 100644 --- a/sources/logger.h +++ b/sources/logger.h @@ -25,7 +25,7 @@ struct od_logger { int loaded; int64_t machine; - /* makes sence only with use_asynclog option on */ + /* makes sense only with use_asynclog option on */ machine_channel_t *task_channel; }; diff --git a/sources/mdb_iamproxy.c b/sources/mdb_iamproxy.c index dce7c85fc..e19e8d914 100644 --- a/sources/mdb_iamproxy.c +++ b/sources/mdb_iamproxy.c @@ -122,7 +122,7 @@ int mdb_iamproxy_authenticate_user( int32_t authentication_result = MDB_IAMPROXY_CONN_DENIED; // stores authenticate status for user (default value: CONN_DENIED) int32_t correct_sending = - MDB_IAMPROXY_CONN_ACCEPTED; // stores stutus of sending data to iam-auth-proxy + MDB_IAMPROXY_CONN_ACCEPTED; // stores status of sending data to iam-auth-proxy char *auth_status_char; machine_msg_t *msg_username = NULL, *msg_token = NULL, *auth_status = NULL, *external_user = NULL; @@ -134,7 +134,7 @@ int mdb_iamproxy_authenticate_user( memset(&exchange_socket, 0, sizeof(exchange_socket)); exchange_socket.sun_family = AF_UNIX; saddr = (struct sockaddr *)&exchange_socket; - // if socket path setted use config value, if it's NULL use default + // if socket path set use config value, if it's NULL use default if (client->rule->mdb_iamproxy_socket_path == NULL) { od_snprintf(exchange_socket.sun_path, sizeof(exchange_socket.sun_path), "%s", @@ -216,8 +216,8 @@ int mdb_iamproxy_authenticate_user( /*COMMUNUCATE WITH SOCKET*/ auth_status = - mdb_iamproxy_io_read(io); // recieve auth_status from socket - if (auth_status == NULL) { // recieving is not completed successfully + mdb_iamproxy_io_read(io); // receive auth_status from socket + if (auth_status == NULL) { // receiving is not completed successfully od_error(&instance->logger, "auth", client, NULL, "failed to receive auth_status from iam-auth-proxy"); authentication_result = MDB_IAMPROXY_CONN_ERROR; @@ -232,7 +232,7 @@ int mdb_iamproxy_authenticate_user( } external_user = - mdb_iamproxy_io_read(io); // recieve subject_id from socket + mdb_iamproxy_io_read(io); // receive subject_id from socket if (external_user == NULL) { od_error(&instance->logger, "auth", client, NULL, "failed to receive external_user from iam-auth-proxy"); diff --git a/sources/module.c b/sources/module.c index dcbefc29d..5174c07d8 100644 --- a/sources/module.c +++ b/sources/module.c @@ -48,7 +48,7 @@ int od_target_module_add(od_logger_t *logger, od_module_t *modules, if (!handle) { if (logger) { od_log(logger, "load_module", NULL, NULL, - "errors while openning %s module: %s", + "errors while opening %s module: %s", target_module_path, dlerror()); } else { printf("errors while opening %s module: %s", diff --git a/sources/odyssey.h b/sources/odyssey.h index 847c0f6bd..75274c03e 100644 --- a/sources/odyssey.h +++ b/sources/odyssey.h @@ -98,7 +98,7 @@ /* modules */ #include "sources/module.h" -#include "sources/extention.h" +#include "sources/extension.h" #include "sources/hba_reader.h" #include "sources/config_reader.h" diff --git a/sources/pool.c b/sources/pool.c index 3fabcfc0d..bf26eca92 100644 --- a/sources/pool.c +++ b/sources/pool.c @@ -102,7 +102,7 @@ int od_rule_matches_client(od_rule_pool_t *pool, od_pool_client_type_t t) case OD_POOL_CLIENT_EXTERNAL: return pool->routing == OD_RULE_POOL_CLIENT_VISIBLE; default: - // no macthes + // no matches return 0; } } diff --git a/sources/relay.h b/sources/relay.h index e473403ab..e43c6ca48 100644 --- a/sources/relay.h +++ b/sources/relay.h @@ -114,7 +114,7 @@ od_relay_start(od_relay_t *relay, machine_cond_t *base, rc = od_relay_read_pending_aware(relay); if (rc != OD_OK) return rc; - // signal machine condition immidiatelly if we are not requested for pending data wait + // signal machine condition immediately if we are not requested for pending data wait if (od_likely(!reserve_session_server_connection || od_relay_data_pending(relay))) { // Seems like some data arrived diff --git a/sources/reset.c b/sources/reset.c index 35047ef3f..3c8fcd468 100644 --- a/sources/reset.c +++ b/sources/reset.c @@ -17,10 +17,10 @@ int od_reset(od_server_t *server) /* server left in copy mode * check that number of received CopyIn/CopyOut Responses * is equal to number received CopyDone msgs. - * it is indeed very strange situation if this numbers diffence + * it is indeed very strange situation if this numbers difference * is more that 1 (in absolute value). * - * However, during client relay step this diffence may be negative, + * However, during client relay step this difference may be negative, * if msg pipelining is used by driver. * Else drop connection, to avoid complexness of state maintenance */ @@ -64,7 +64,7 @@ int od_reset(od_server_t *server) int wait_cancel_limit = 1; od_retcode_t rc = 0; for (;;) { - /* check that msg syncronization is not broken*/ + /* check that msg synchronization is not broken*/ if (server->relay.packet > 0) goto error; diff --git a/sources/router.c b/sources/router.c index 0a690c5ef..9cd16ca11 100644 --- a/sources/router.c +++ b/sources/router.c @@ -130,10 +130,10 @@ int od_router_reconfigure(od_router_t *router, od_rules_t *rules) &to_drop); if (updates > 0) { - od_extention_t *extentions = router->global->extentions; + od_extension_t *extensions = router->global->extensions; od_list_t *i; od_list_t *j; - od_module_t *modules = extentions->modules; + od_module_t *modules = extensions->modules; od_list_foreach(&added, i) { @@ -556,7 +556,7 @@ bool od_should_not_spun_connection_yet(int connections_in_pool, int pool_size, * in parallel. Meanwhile when we have no server connections we go at * maximum configured parallelism. * - * This equation means that we gradualy reduce parallelism until we reach + * This equation means that we gradually reduce parallelism until we reach * half of possible connections in the pool. */ max_routing = diff --git a/sources/rules.c b/sources/rules.c index 66f5f2b54..c99c10142 100644 --- a/sources/rules.c +++ b/sources/rules.c @@ -1266,7 +1266,7 @@ int od_pool_validate(od_logger_t *logger, od_rule_pool_t *pool, char *db_name, pool->pool == OD_RULE_POOL_SESSION) { od_error( logger, "rules", NULL, NULL, - "rule '%s.%s %s': prepared statements support in session pool makes no sence", + "rule '%s.%s %s': prepared statements support in session pool makes no sense", db_name, user_name, address_range->string_value); return NOT_OK_RESPONSE; } @@ -1445,7 +1445,7 @@ int od_rules_validate(od_rules_t *rules, od_config_t *config, for (size_t i = 0; i < storage->endpoints_count; ++i) { if (storage->endpoints[i].port == 0) { - /* forse default port */ + /* force default port */ storage->endpoints[i].port = storage->port; } @@ -1928,4 +1928,4 @@ bool od_name_in_rule(od_rule_t *rule, char *name) } else { return strcmp(rule->user_name, name) == 0; } -} \ No newline at end of file +} diff --git a/sources/rules.h b/sources/rules.h index d32a50fb6..857d1aedd 100644 --- a/sources/rules.h +++ b/sources/rules.h @@ -91,7 +91,7 @@ struct od_rule { char *mdb_iamproxy_socket_path; #ifdef PAM_FOUND - /* PAM parametrs */ + /* PAM parameters */ char *auth_pam_service; od_pam_auth_data_t *auth_pam_data; #endif diff --git a/sources/scram.c b/sources/scram.c index 9ce147018..69f4c148e 100644 --- a/sources/scram.c +++ b/sources/scram.c @@ -644,7 +644,7 @@ int od_scram_read_client_final_message(machine_io_t *io, /* Fetch hash data of server's SSL certificate */ scram_rc = machine_tls_cert_hash( io, &cbind_data, - (uint32_t *)&cbind_data_len); // TODO: maybe rework of machinarium beacuse it's strange that we use size_t here and uint32_t in machinarium + (uint32_t *)&cbind_data_len); // TODO: maybe rework of machinarium because it's strange that we use size_t here and uint32_t in machinarium /* should not happen */ if (scram_rc != OK_RESPONSE) { diff --git a/sources/server.h b/sources/server.h index 5edf3a8af..51dde7495 100644 --- a/sources/server.h +++ b/sources/server.h @@ -164,7 +164,7 @@ static inline int od_server_grac_shutdown(od_server_t *server) static inline int od_server_reload(od_attribute_unused() od_server_t *server) { - // TODO: set offline to 1 if storage/auth rules chaged + // TODO: set offline to 1 if storage/auth rules changed return 0; } diff --git a/sources/sighandler.c b/sources/sighandler.c index d8f0a02e9..032f5909e 100644 --- a/sources/sighandler.c +++ b/sources/sighandler.c @@ -61,7 +61,7 @@ od_attribute_noreturn() void od_system_shutdown(od_system_t *system, #ifdef OD_SYSTEM_SHUTDOWN_CLEANUP od_router_free(system->global->router); - od_extention_free(&instance->logger, system->global->extentions); + od_extension_free(&instance->logger, system->global->extensions); od_system_cleanup(system); diff --git a/sources/storage.c b/sources/storage.c index bdb0153c8..4173c5e49 100644 --- a/sources/storage.c +++ b/sources/storage.c @@ -252,7 +252,7 @@ void od_storage_watchdog_watch(void *arg) /* create internal auth client */ od_client_t *watchdog_client; watchdog_client = - od_client_allocate_internal(global, "storage-watchog"); + od_client_allocate_internal(global, "storage-watchdog"); if (watchdog_client == NULL) { od_error(&instance->logger, "watchdog", NULL, NULL, "route storage watchdog failed to allocate client"); diff --git a/sources/system.c b/sources/system.c index bb73fd26e..b54970b0b 100644 --- a/sources/system.c +++ b/sources/system.c @@ -365,7 +365,7 @@ void od_system_config_reload(od_system_t *system) { od_instance_t *instance = system->global->instance; od_router_t *router = system->global->router; - od_extention_t *extentions = system->global->extentions; + od_extension_t *extensions = system->global->extensions; od_hba_t *hba = system->global->hba; od_list_t *i; @@ -389,7 +389,7 @@ void od_system_config_reload(od_system_t *system) od_hba_rules_init(&hba_rules); int rc; - rc = od_config_reader_import(&config, &rules, &error, extentions, + rc = od_config_reader_import(&config, &rules, &error, extensions, system->global, &hba_rules, instance->config_file); if (rc == -1) { @@ -476,7 +476,7 @@ void od_system_config_reload(od_system_t *system) if (server->config->tls_opts->tls_mode != OD_CONFIG_TLS_DISABLE) { machine_tls_t *tls = od_tls_frontend(server->config); - /* TODO: suppport changing cert files */ + /* TODO: support changing cert files */ if (tls != NULL) { server->tls = tls; } diff --git a/sources/tdigest.h b/sources/tdigest.h index d5474054e..cf5d2abf9 100644 --- a/sources/tdigest.h +++ b/sources/tdigest.h @@ -62,7 +62,7 @@ double td_total_count(td_histogram_t *h); // td_total_sum returns the sum of all the data added to h. double td_total_sum(td_histogram_t *h); -// td_decay multiplies all countes by factor. +// td_decay multiplies all counters by factor. void td_decay(td_histogram_t *h, double factor); #endif /* ODYSSEY_TDIGEST_H */ diff --git a/sources/thread_global.h b/sources/thread_global.h index 2d8109e89..5f268e5b7 100644 --- a/sources/thread_global.h +++ b/sources/thread_global.h @@ -5,7 +5,7 @@ typedef struct { od_conn_eject_info *info; int wid; /* worker id */ - /* TODO: store here some metainfo about incomming connections flow and use in somehow */ + /* TODO: store here some metainfo about incoming connections flow and use in somehow */ } od_thread_global; extern od_retcode_t od_thread_global_init(od_thread_global **gl); diff --git a/sources/worker.c b/sources/worker.c index f3eeb0386..0ebd7d0c7 100644 --- a/sources/worker.c +++ b/sources/worker.c @@ -18,7 +18,7 @@ static inline void od_worker(void *arg) od_instance_t *instance = worker->global->instance; od_router_t *router = worker->global->router; - /* thread global initializtion */ + /* thread global initialization */ od_thread_global **gl = od_thread_global_get(); od_retcode_t rc = od_thread_global_init(gl); diff --git a/third_party/machinarium/gdb/README.md b/third_party/machinarium/gdb/README.md index 92e4a72e2..5098586f7 100644 --- a/third_party/machinarium/gdb/README.md +++ b/third_party/machinarium/gdb/README.md @@ -7,7 +7,7 @@ Run gdb and then initialize the script: (gdb) source ~/odyssey/third_party/machinarium/gdb/machinarium-gdb.py ``` -## Commnands +## Commands ### info mmcoros List all machinarium coroutines for threads. diff --git a/third_party/machinarium/gdb/machinarium-gdb.py b/third_party/machinarium/gdb/machinarium-gdb.py index cca6788c2..36bc894e8 100644 --- a/third_party/machinarium/gdb/machinarium-gdb.py +++ b/third_party/machinarium/gdb/machinarium-gdb.py @@ -447,7 +447,7 @@ def _execute_in_coroutine_context(self, thread: gdb.InferiorThread, coroutine: g gdb.execute(gdbcmd) return - # To switch tood_auth_frontend the coroutine context, we can use the frame unwider. + # To switch to od_auth_frontend the coroutine context, we can use the frame unwider. # However, this will cause the first frame to be the frame of the current thread. # And then we unwides to the coroutine context. # Therefore, we should use a frame filter to skip the first frame.