Changeset 317b0e5a484ca9117f00ad426d067a5ec6767236
- Timestamp:
- 08/22/08 19:57:13
(3 months ago)
- Author:
- Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
- git-committer:
- Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1219420633 +0200
- git-parent:
[235634f64decfd4c1c20574474faf0267c8772c5]
- git-author:
- Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1219420633 +0200
- Message:
iplookup plugin: fix brokage from IPv6 support
Commit ff949fe1c9dd0c179ecdce9340c04c05242d3a48 "iplookup plugin:
support IPv6 too" broke the main iplookup method by forgetting to
initialize reply correctly.
Fix it, and replace String#+= usage with String#<< which is more
efficient speed- and memory-wise.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r296cdd0 |
r317b0e5 |
|
| 189 | 189 | |
|---|
| 190 | 190 | def iplookup(m, params) |
|---|
| 191 | | debug params |
|---|
| | 191 | reply = "" |
|---|
| 192 | 192 | if params[:domain].match(/^#{Regexp::Irc::HOSTADDR}$/) |
|---|
| 193 | 193 | ip = params[:domain] |
|---|
| … | … | |
| 195 | 195 | begin |
|---|
| 196 | 196 | ip = Resolv.getaddress(params[:domain]) |
|---|
| 197 | | reply += "#{params[:domain]} | " |
|---|
| | 197 | reply << "#{params[:domain]} | " |
|---|
| 198 | 198 | rescue => e |
|---|
| 199 | 199 | m.reply "#{e.message}" |
|---|
| … | … | |
| 202 | 202 | end |
|---|
| 203 | 203 | |
|---|
| 204 | | reply += ArinWhois.lookup_info(ip) |
|---|
| | 204 | reply << ArinWhois.lookup_info(ip) |
|---|
| | 205 | |
|---|
| 205 | 206 | m.reply reply |
|---|
| 206 | 207 | end |
|---|