add MODE READER command

This commit is contained in:
Ward Wouts 2005-01-30 14:24:13 +00:00
parent 1369e6ac4f
commit bb4ae13cfa
2 changed files with 9 additions and 3 deletions

View file

@ -229,6 +229,10 @@ class NNTP
return shortcmd("SLAVE")
end
def mode_reader()
return shortcmd("MODE READER")
end
def xhdr(hdr, str)
pat = Regexp.new '^([0-9]+) ?(.*)\n?'
resp, lines = longcmd "XHDR #{hdr} #{str}"

View file

@ -1,8 +1,8 @@
# $Dwarf: article.rb,v 1.93 2004/10/15 13:48:04 ward Exp $
# $Dwarf: article.rb,v 1.94 2004/11/21 14:21:03 ward Exp $
# $Source$
#
# Copyright (c) 2002, 2003, 2004 Ward Wouts <ward@wouts.nl>
# Copyright (c) 2002, 2003, 2004, 2005 Ward Wouts <ward@wouts.nl>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@ -56,6 +56,7 @@ def initialize(nntpservers, groupname, newsrc="~/.newsrc")
timeout(60) do
@connections[server]["nntp"] = Net::NNTP.new(server)
end
resp = @connections[server]["nntp"].mode_reader
rescue TimeoutError
sleep 3
retry
@ -86,6 +87,7 @@ def reconnect(server)
timeout(60) do
@connections[server]["nntp"] = Net::NNTP.new(server)
end
resp = @connections[server]["nntp"].mode_reader
rescue SocketError, Errno::EINVAL, EOFError, Errno::ETIMEDOUT, TimeoutError
print "Reconnect to #{server} failed: #{$!}\n"
if retries > 1
@ -753,7 +755,7 @@ end
def rechunk_runlist(runlist)
return nil if runlist == nil
chunksize = 1000
chunksize = 500
blalist = runlist.split(',')
# hmmm, als het aantal articles wat tussen de komma's ligt < pak um beet 3