Skip to content

Conversation

@Girgias
Copy link
Member

@Girgias Girgias commented Dec 26, 2025

Commits should be reviewed in order.

This is an initial PR to refactor our email sending code as a lot of unnecessary strlen() recomputations are happening.

@Girgias Girgias force-pushed the win-mail-refactor branch 2 times, most recently from 7ef3973 to f9a22c9 Compare December 26, 2025 01:29
Input as zend_string
Use smart_str to concatenate strings
Change return type to bool
@Girgias Girgias requested a review from ndossche December 26, 2025 02:10
@Girgias Girgias marked this pull request as ready for review December 26, 2025 02:10
@Girgias Girgias requested a review from bukka as a code owner December 26, 2025 02:10
memcpy(stripped_header + (pos1 - ZSTR_VAL(headers) - 4), pos2 + 2, strlen(pos2) - 2);
stripped_header = zend_string_concat2(ZSTR_VAL(headers), header_length_prior_to_bcc, pos2 + 2, strlen(pos2) - 2);
} else {
stripped_header = zend_string_truncate(headers, header_length_prior_to_bcc, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't place a NUL byte


return (SUCCESS);
bool header_post_status = Post(ZSTR_VAL(combined_headers_str));
zend_string_release_ex(combined_headers_str, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could even be zend_string_efree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants