Skip to content

Commit

Permalink
smtp: remove SCMimeSmtpConfigExtractUrlsSchemeReset
Browse files Browse the repository at this point in the history
It doesn't appear to be needed. The vec being cleared is only set once
per run, so never needs to be cleared.

Removes one point where we have to supress the static_mut_refs compiler
warning.

Ticket: OISF#7417
  • Loading branch information
jasonish authored and victorjulien committed Feb 27, 2025
1 parent 97ee95c commit 9ed5b4c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
5 changes: 0 additions & 5 deletions rust/src/mime/smtp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,11 +742,6 @@ pub unsafe extern "C" fn SCMimeSmtpConfigHeaderValueDepth(val: u32) {
MIME_SMTP_CONFIG_HEADER_VALUE_DEPTH = val;
}

#[no_mangle]
pub unsafe extern "C" fn SCMimeSmtpConfigExtractUrlsSchemeReset() {
MIME_SMTP_CONFIG_EXTRACT_URL_SCHEMES.clear();
}

#[no_mangle]
pub unsafe extern "C" fn SCMimeSmtpConfigExtractUrlsSchemeAdd(
str: *const std::os::raw::c_char,
Expand Down
2 changes: 0 additions & 2 deletions src/app-layer-smtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ static void SMTPConfigure(void) {
if (extract_urls_schemes) {
ConfNode *scheme = NULL;

SCMimeSmtpConfigExtractUrlsSchemeReset();
TAILQ_FOREACH (scheme, &extract_urls_schemes->head, next) {
size_t scheme_len = strlen(scheme->val);
if (scheme_len > UINT16_MAX - SCHEME_SUFFIX_LEN) {
Expand All @@ -383,7 +382,6 @@ static void SMTPConfigure(void) {
} else {
/* Add default extract url scheme 'http' since
* extract-urls-schemes wasn't found in the config */
SCMimeSmtpConfigExtractUrlsSchemeReset();
SCMimeSmtpConfigExtractUrlsSchemeAdd("http://");
}

Expand Down

0 comments on commit 9ed5b4c

Please sign in to comment.