summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/smtp.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index 5fd4f8e5c5..64e536a12a 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -901,10 +901,17 @@ module Net
end
res = critical {
check_continue get_response('DATA')
- if msgstr
- @socket.write_message msgstr
- else
- @socket.write_message_by_block(&block)
+ socket_sync_bak = @socket.io.sync
+ begin
+ @socket.io.sync = false
+ if msgstr
+ @socket.write_message msgstr
+ else
+ @socket.write_message_by_block(&block)
+ end
+ ensure
+ @socket.io.flush
+ @socket.io.sync = socket_sync_bak
end
recv_response()
}