From cc07bc12727efc9a1b4dd8c91ce021da94b9a3a7 Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 8 Sep 2003 17:15:26 +0000 Subject: [PATCH] Switched pgpkey from using .read() to .readline() since there's possibly a large amount of results. --- plugins/Http.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Http.py b/plugins/Http.py index 198dab3fd..9361e2950 100644 --- a/plugins/Http.py +++ b/plugins/Http.py @@ -394,18 +394,19 @@ class Http(callbacks.Privmsg): host = 'http://pgp.mit.edu:11371' url = '%s/pks/lookup?op=index&search=%s' % (host, urlClean) fd = urllib2.urlopen(url) - html = fd.read().split('\n') - fd.close() pgpkeys = '' - for line in html: + line = fd.readline() + while len(line) != 0: info = self._pgpkeyre.search(line) if info: pgpkeys += '%s <%s> :: ' % (info.group(3), '%s%s' % (host, info.group(1))) + line = fd.readline() if len(pgpkeys) == 0: irc.reply(msg, 'No results found for %s.' % search) else: irc.reply(msg, 'Matches found for %s: %s' % (search, pgpkeys[:-4])) + fd.close() Class = Http