robustness fixes
This commit is contained in:
parent
9e4bf9eba4
commit
8a88306070
1 changed files with 5 additions and 4 deletions
|
|
@ -82,7 +82,10 @@ end
|
|||
|
||||
def quit
|
||||
@thr.exit
|
||||
begin
|
||||
super
|
||||
rescue EOFError
|
||||
end
|
||||
end
|
||||
|
||||
private :sendka
|
||||
|
|
@ -131,6 +134,7 @@ def initialize(nntpservers, groupname, newsrc="~/.newsrc")
|
|||
set_skip_ids(server, @connections[server]["newsrc"].marked_articles(@group))
|
||||
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT
|
||||
print "Connection to #{server} failed: #{$!}\n"
|
||||
@connections[server]["nntp"].quit
|
||||
del_server(server)
|
||||
end
|
||||
}
|
||||
|
|
@ -140,9 +144,6 @@ def reconnect(server)
|
|||
retries = 0
|
||||
begin
|
||||
@connections[server]["nntp"].quit
|
||||
# helpt dit in geheugen gebruik? : Volgens mij niet
|
||||
#@connections[server].delete("nntp")
|
||||
#GC.start
|
||||
rescue Errno::EPIPE, Errno::ECONNRESET, EOFError, Errno::ETIMEDOUT
|
||||
end
|
||||
begin
|
||||
|
|
@ -152,7 +153,7 @@ def reconnect(server)
|
|||
@connections[server]["nntp"] = Net::KANNTP.new(server)
|
||||
end
|
||||
resp = @connections[server]["nntp"].mode_reader
|
||||
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT, TimeoutError
|
||||
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT, TimeoutError, Errno::ECONNREFUSED
|
||||
print "Reconnect to #{server} failed: #{$!}\n"
|
||||
if retries > 1
|
||||
del_server(server)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue