aboutsummaryrefslogtreecommitdiff
path: root/src/mail/ngx_mail_parse.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2021-05-19 03:13:17 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2021-05-19 03:13:17 +0300
commit317223cb56f70f3fc2eb646a78a8f0161cafa70b (patch)
treeeb5a1441ea1322737ff762d81b9193b13e242ea9 /src/mail/ngx_mail_parse.c
parent204f944add09c43223de317451175d5fdb7d1fb0 (diff)
downloadnginx-317223cb56f70f3fc2eb646a78a8f0161cafa70b.tar.gz
nginx-317223cb56f70f3fc2eb646a78a8f0161cafa70b.zip
Mail: optimized discarding invalid SMTP commands.
There is no need to scan buffer from s->buffer->pos, as we already scanned the buffer till "p" and wasn't able to find an LF. There is no real need for this change in SMTP, since it is at most a microoptimization of a non-common code path. Similar code in IMAP, however, will have to start scanning from "p" to be correct, since there can be newlines in IMAP literals.
Diffstat (limited to 'src/mail/ngx_mail_parse.c')
-rw-r--r--src/mail/ngx_mail_parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mail/ngx_mail_parse.c b/src/mail/ngx_mail_parse.c
index 0712ad5dc..c4e8f0eae 100644
--- a/src/mail/ngx_mail_parse.c
+++ b/src/mail/ngx_mail_parse.c
@@ -843,7 +843,7 @@ invalid:
/* skip invalid command till LF */
- for (p = s->buffer->pos; p < s->buffer->last; p++) {
+ for ( /* void */ ; p < s->buffer->last; p++) {
if (*p == LF) {
s->state = sw_start;
s->buffer->pos = p + 1;