1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/net/smtp.rb (Net::SMTP#data): enable buffering while

'data' send for optimizing Net::SMTP#send_message.
  [ruby-dev:48329] [misc #9981]
  patch by Masahiro Tomita.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2014-07-11 19:22:19 +00:00
parent f11c30e801
commit 00eb720394
2 changed files with 18 additions and 4 deletions

View file

@ -1,3 +1,10 @@
Sat Jul 12 04:17:40 2014 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* lib/net/smtp.rb (Net::SMTP#data): enable buffering while
'data' send for optimizing Net::SMTP#send_message.
[ruby-dev:48329] [misc #9981]
patch by Masahiro Tomita.
Sat Jul 12 01:13:45 2014 Naohisa Goto <ngotogenome@gmail.com> Sat Jul 12 01:13:45 2014 Naohisa Goto <ngotogenome@gmail.com>
* test/ruby/envutil.rb (assert_no_memory_leak): On Solaris 9 or later, * test/ruby/envutil.rb (assert_no_memory_leak): On Solaris 9 or later,

View file

@ -901,11 +901,18 @@ module Net
end end
res = critical { res = critical {
check_continue get_response('DATA') check_continue get_response('DATA')
socket_sync_bak = @socket.io.sync
begin
@socket.io.sync = false
if msgstr if msgstr
@socket.write_message msgstr @socket.write_message msgstr
else else
@socket.write_message_by_block(&block) @socket.write_message_by_block(&block)
end end
ensure
@socket.io.flush
@socket.io.sync = socket_sync_bak
end
recv_response() recv_response()
} }
check_response res check_response res