# HG changeset patch # User Sergey Kandaurov # Date 1619088717 -10800 # Node ID 7d40f2557a45ecbf2ca02823376c0d88dce207f0 # Parent feb754918372291962924076699de75e848f985b Tests: added smtp_client_buffer test. diff --git a/mail_smtp.t b/mail_smtp.t --- a/mail_smtp.t +++ b/mail_smtp.t @@ -47,6 +47,13 @@ mail { protocol smtp; smtp_auth login plain none cram-md5 external; } + + server { + listen 127.0.0.1:8027; + protocol smtp; + smtp_auth login plain none cram-md5 external; + smtp_client_buffer 128; + } } http { @@ -90,7 +97,7 @@ http { EOF $t->run_daemon(\&Test::Nginx::SMTP::smtp_test_daemon); -$t->run()->plan(30); +$t->run()->plan(36); $t->waitforsocket('127.0.0.1:' . port(8026)); @@ -240,6 +247,33 @@ my $s = Test::Nginx::SMTP->new(); $s->ok('pipelined rcpt to'); $s->ok('pipelined rset'); +# Pipelining longer than smtp_client_buffer + +$s = Test::Nginx::SMTP->new(PeerAddr => '127.0.0.1:' . port(8027)); +$s->read(); +$s->send('EHLO example.com'); +$s->read(); + +$s->send('MAIL FROM: SIZE=100' . CRLF + . 'RCPT TO:' . CRLF + . 'RCPT TO:' . CRLF + . 'RCPT TO:' . CRLF + . 'RCPT TO:' . CRLF + . 'RSET'); + +$s->ok('long pipelined mail from'); + +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.21.0'); + +$s->ok('long pipelined rcpt to'); +$s->ok('long pipelined rcpt to 2'); +$s->ok('long pipelined rcpt to 3'); +$s->ok('long pipelined rcpt to 4'); +$s->ok('long pipelined rset'); + +} + # Connection must stay even if error returned to rcpt to command $s = Test::Nginx::SMTP->new();