118 cb_error(session, "stream-error", stanza); |
118 cb_error(session, "stream-error", stanza); |
119 else |
119 else |
120 cb_error(session, "parse-error", "unexpected-element-close", name); |
120 cb_error(session, "parse-error", "unexpected-element-close", name); |
121 end |
121 end |
122 end |
122 end |
123 if stanza then |
123 if #chardata > 0 then |
124 if #chardata > 0 then |
124 -- We have some character data in the buffer |
125 -- We have some character data in the buffer |
125 stanza:text(t_concat(chardata)); |
126 stanza:text(t_concat(chardata)); |
126 chardata = {}; |
127 chardata = {}; |
127 end |
128 end |
128 -- Complete stanza |
129 -- Complete stanza |
129 if #stanza.last_add == 0 then |
130 if #stanza.last_add == 0 then |
130 cb_handlestanza(session, stanza); |
131 cb_handlestanza(session, stanza); |
131 stanza = nil; |
132 stanza = nil; |
132 else |
133 else |
133 stanza:up(); |
134 stanza:up(); |
|
135 end |
|
136 end |
134 end |
137 end |
135 end |
138 return xml_handlers; |
136 return xml_handlers; |
139 end |
137 end |
140 |
138 |