Software / code / verse
Comparison
client.lua @ 171:741f5311d30c
verse.client: Fix two cases where we called methods on the base stream object instead of the current one
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 30 Dec 2010 20:18:47 +0000 |
| parent | 166:3499b4ea3277 |
| child | 199:33b54389ed9c |
comparison
equal
deleted
inserted
replaced
| 170:cb03e8ae2e30 | 171:741f5311d30c |
|---|---|
| 66 self:add_plugin("session"); | 66 self:add_plugin("session"); |
| 67 | 67 |
| 68 function self.data(conn, data) | 68 function self.data(conn, data) |
| 69 local ok, err = self.stream:feed(data); | 69 local ok, err = self.stream:feed(data); |
| 70 if ok then return; end | 70 if ok then return; end |
| 71 stream:debug("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " ")); | 71 self:debug("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " ")); |
| 72 stream:close("xml-not-well-formed"); | 72 self:close("xml-not-well-formed"); |
| 73 end | 73 end |
| 74 | 74 |
| 75 self:hook("incoming-raw", function (data) return self.data(self.conn, data); end); | 75 self:hook("incoming-raw", function (data) return self.data(self.conn, data); end); |
| 76 | 76 |
| 77 self.curr_id = 0; | 77 self.curr_id = 0; |