You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Throughout our code base, we do something like this:
staticintatclient_get_self_key_validate_arguments(constatclient*atclient, constatclient_atkey*atkey,
constchar**value, constatclient_get_self_key_request_options*request_options) {
intret=1;
if (atclient==NULL) {
ret=1;
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient is NULL\n");
goto exit;
}
if (!atclient_is_atsign_initialized(atclient)) {
ret=1;
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_is_atsign_initialized is false\n");
goto exit;
}
if (!atclient_is_atserver_connection_started(atclient)) {
ret=1;
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_is_atserver_connection_started is false\n");
goto exit;
}
if (atclient->async_read) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR,
"atclient_get_self_key cannot be called from an async_read atclient, it will cause a race condition\n");
return1;
}
if (atkey==NULL) {
ret=1;
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atkey is NULL\n");
goto exit;
}
if (!atclient_atkey_is_key_initialized(atkey)) {
ret=1;
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atkey.key is not initialized when it should be\n");
goto exit;
}
if (!atclient_atkey_is_shared_by_initialized(atkey)) {
ret=1;
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atkey.shared_by is not initialized when it should be\n");
goto exit;
}
ret=0;
exit: { returnret; }
}
We should follow the same pattern to avoid segfaults in notify/monitor
The text was updated successfully, but these errors were encountered:
JeremyTubongbanua
changed the title
at_c: clean up notify and monitor with optimizations and arguments validation
at_c: clean up notify and monitor with optimizations and arguments validation and use atclient_connection_read/write
Jul 30, 2024
JeremyTubongbanua
changed the title
at_c: clean up notify and monitor with optimizations and arguments validation and use atclient_connection_read/write
at_c: notify/monitor: optimizations, arguments validation, and use atclient_connection_read/write
Jul 30, 2024
JeremyTubongbanua
changed the title
at_c: notify/monitor: optimizations, arguments validation, and use atclient_connection_read/write
at_c: use atclient_connection_read/write in notify/monitor
Jul 30, 2024
Throughout our code base, we do something like this:
We should follow the same pattern to avoid segfaults in notify/monitor
The text was updated successfully, but these errors were encountered: