Skip to content

Commit e11d4bd

Browse files
fix: Software caused connection abort errors due fast open and close connections
1 parent d955cbb commit e11d4bd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/midi-smtp-server.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def serve(io)
189189
# handle connection
190190
begin
191191
# reply welcome
192-
io.print "220 #{Thread.current[:ctx][:server][:local_host]} says welcome!\r\n"
192+
io.print "220 #{Thread.current[:ctx][:server][:local_host]} says welcome!\r\n" unless io.closed?
193193
# while data handle communication
194194
begin
195195
loop do
@@ -224,7 +224,7 @@ def serve(io)
224224
# log smtp dialog // message data is stored separate
225225
logger.debug(">>> #{output}")
226226
# smtp dialog response
227-
io.print("#{output}\r\n")
227+
io.print("#{output}\r\n") unless io.closed?
228228
end
229229

230230
end

midi-smtp-server.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22
s.name = 'midi-smtp-server'
3-
s.version = '2.1.2'
4-
s.date = '2015-09-12'
3+
s.version = '2.1.3'
4+
s.date = '2018-04-19'
55
s.summary = "MidiSmtpServer Class"
66
s.description = "A small and highly customizable ruby SMTP-Server."
77
s.authors = ["Tom Freudenberg"]

0 commit comments

Comments
 (0)