Request with malformed data; connection closed

Request with malformed data; connection closed

by Arthur Hung -
Number of replies: 2
     Hi! I'm trying to run the chat daemon on a FC1 box. Previously I was able to make it work on FC3, after opening a port through the firewall.
     I took the same steps, but I was given this message on the user list screen "Request with malformed data; connection closed." The chat room screen is blank and it doesn't respond when I type something.

Here's a copy of my /etc/rc.d/rc.local:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
ifup eth0

cd /var/www/html/moodle/mod/chat
php chatd.php --start &

These are the messages I got after I ran /etc/rc.d/rc.local to start the daemon:
[root@mysite.com]# /etc/rc.d/rc.local
/etc/rc.d/rc.local: line 7: Touch: command not found
[root@mysite.com]# Content-type: text/html
X-Powered-By: PHP/4.3.8

Moodle chat daemon v1.0 on PHP 4.3.8 ($Id: chatd.php,v 1.13.2.10 2004/12/16 00:41:50 defacer Exp $)

[2005-05-18 14:15:35] *IMPORTANT* Started Moodle chatd on port 9111, listening socket Resource id #17

[root@mysite.com]# [2005-05-18 14:16:18] *IMPORTANT* UFO with Resource id #20: Request with malformed data; connection closed
[2005-05-18 14:16:24] *IMPORTANT* UFO with Resource id #21: Request with malformed data; connection closed

Here's a copy of my apache error_log:
[client 0.0.0.197] script '/home/httpd/vhosts/mysite.com/httpdocs/moodle/mod/chat/gui_sockets/empty.php' not found or unable to stat, referer: http://mysite.com/moodle/mod/chat/gui_sockets/index.php?id=5

Any help would be greatly appreciated. big grin
Average of ratings: -
In reply to Arthur Hung

Re: Request with malformed data; connection closed

by John Papaioannou -
If you can do a little in-place diagnostic then we might be able to solve this easily. smile

Open /mod/chat/chatd.php, find the line:

if(!ereg('win=(chat|users|message|beep).*&chat_sid=([a-zA-Z0-9]*) HTTP', $data, $info)) {

Immediately afterwards, add this line:

$DAEMON->trace('Data: '.$data, E_USER_WARNING);

And after getting a few more "connection closed messages" copy paste the extra debug output here.

Jon
In reply to John Papaioannou

Re: Request with malformed data; connection closed

by Nicolás César -
I had the same problem.... replace:

if(!ereg('win=(chat|users|message|beep).*&chat_sid=([a-zA-Z0-9]*) HTTP', $data, $info)) {


with:
if(!ereg('win=(chat|users|message|beep).*&chat_sid=([a-zA-Z0-9]*).* HTTP', $data, $info)) {


because it after the chat_sid, was an anoying (and probably useless) "&groupid=0"... besides the buddy list, all the rest worked just fine...