I'm trying to write a tcl script that will read information POSTed by a WWW browser (Netscape, IE, Lynx).
POST information is submitted by browsers into two parts: a head part and a body part, seperated by an empty line. What I observe is that with most browsers, the tcl script only gets the head part and not the body.
Shown below is an isolated example.
The following TCL is loaded on an eggdrop (1.6.6, 1.3.28 and 1.1.5 tested on SUN-OS):
# listen on port 4000
listen 4000 script observescript
proc observescript { idx } {
control $idx observeproc
return 0
}
proc observeproc { idx text } {
putlog "OBSERVE: ($idx) $text"
return 0
}
The following piece of HTML is loaded into lynx:
<html><head></head><body>
<form method=post action="http://vhost.at.shell:4000">
<input name=nick type=text size=20>
</form></body></html>
where vhost.at.shell should be modified to reflect the shell/vhost the bot is using.
Upon typing something in the form and submitting it, the following is OBSERVEd:
[16:33] OBSERVE: (9) POST / HTTP/1.0
[16:33] OBSERVE: (9) Host: vhost.at.shell:4000
[16:33] OBSERVE: (9) Accept: text/html, text/plain, text/sgml, text/x-sgml, application/x-wais-source,
application/html, */*;q=0.001
[16:33] OBSERVE: (9) Accept-Encoding: gzip, compress
[16:33] OBSERVE: (9) Accept-Language: en
[16:33] OBSERVE: (9) Pragma: no-cache
[16:33] OBSERVE: (9) Cache-Control: no-cache
[16:33] OBSERVE: (9) User-Agent: Lynx/2.7
[16:33] OBSERVE: (9) Referer: file://localhost/test.html
[16:33] OBSERVE: (9) Content-type: application/x-www-form-urlencoded
[16:33] OBSERVE: (9) Content-length: 9
and then the connection HANGS

On some browsers (Netscape, certain versions of IE) everything works fine. On other browsers (Lynx, certain versions of IE) it doesnt work.
Similar behaviour is observed with TCL "socket" in combination with "gets". With "reads" it seems to work fine. Nevertheless, I want to stick to the listen/control idea of eggdrop for various reasons.
I would appreciate any comments/help, as it is a killer for a TCL I'm writing. Is it a bug or is there a way to modify eggdrop source? Once again, I want to stick with the listen/control mechanism of eggdrop.
Thanks.