projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5154059
)
* Modified the XMPP service to use client_read_random_blob(). However, I noticed...
author
Art Cancro
<ajc@citadel.org>
Fri, 7 May 2010 21:53:11 +0000
(21:53 +0000)
committer
Art Cancro
<ajc@citadel.org>
Fri, 7 May 2010 21:53:11 +0000
(21:53 +0000)
citadel/modules/xmpp/serv_xmpp.c
patch
|
blob
|
history
diff --git
a/citadel/modules/xmpp/serv_xmpp.c
b/citadel/modules/xmpp/serv_xmpp.c
index 067faa0a1997ba915c5b5c6440d3f40c127cfb39..c553f24194a26ba22aba1cf5b1fcf82304fb42c1 100644
(file)
--- a/
citadel/modules/xmpp/serv_xmpp.c
+++ b/
citadel/modules/xmpp/serv_xmpp.c
@@
-476,23
+476,21
@@
void xmpp_greeting(void) {
/*
* Main command loop for XMPP sessions.
/*
* Main command loop for XMPP sessions.
- * Right now we're reading one byte at a time and sending it to the XML parser.
- * There's got to be a better way to do this.
*/
void xmpp_command_loop(void) {
*/
void xmpp_command_loop(void) {
-
char cmdbuf[2]
;
-
int retval
;
+
int rc
;
+
StrBuf *stream_input = NewStrBuf()
;
time(&CC->lastcmd);
time(&CC->lastcmd);
- memset(cmdbuf, 0, sizeof cmdbuf);
- retval = client_read(cmdbuf, 1);
- if (retval != 1) {
+ rc = client_read_random_blob(stream_input, 30);
+ if (rc > 0) {
+ XML_Parse(XMPP->xp, ChrPtr(stream_input), rc, 0);
+ }
+ else {
CtdlLogPrintf(CTDL_ERR, "Client disconnected: ending session.\n");
CC->kill_me = 1;
CtdlLogPrintf(CTDL_ERR, "Client disconnected: ending session.\n");
CC->kill_me = 1;
- return;
}
}
-
- XML_Parse(XMPP->xp, cmdbuf, 1, 0);
+ FreeStrBuf(&stream_input);
}
}