Talk:Server.pl
Here are some directives Apache uses when it deals with IE clients:
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0
Might give a clue to it's little quirks.
--Rob 09:44, 16 Feb 2006 (NZDT)
Currently HTTP authentication is just base64 encoded username:password which is basically just plain text, so the password can easily be discovered.
- Bugs & Notes
- Port-binding bug
- Socket can't bind to port for a minute or so after peer stops. Shutting it officially, blocking, autoflush don't work. netstat -tupl and lsof -i 1729 show that the port is freed immediately, but it still won't bind until after the delay.
- Note: server.pl now keeps retrying every 10sec instead of dying Nad 23:29, 16 Feb 2006 (NZDT)
- HTTP-Response issue
For some reason certain clients cannot receive a the content from the peer. The headers are sent, but then the client times-out waiting for the content. But the entire message is sent in one go...
The problem is that one of the clients that fails is the one used by the fopen-wrappers in PHP!
Here's what happens when we request from the peer using wget:
closet:/home/nad# wget http://localhost:1729
--13:50:01-- http://localhost:1729/
=> `index.html'
Resolving localhost... 127.0.0.1
Connecting to localhost[127.0.0.1]:1729... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3,744 [text/html]
0% [ ] 0 --.--K/s
As you can see it must have retreived the headers to know the Content-Type and Content-Length, and is now waiting for the content, not more headers - but why is it waiting when the peer code sends the whole lot...?
It works fine for curl, and Rob used: curl -vi http://organicdesign.co.nz:1729 --trace-ascii /dev/tty to obtain the results listed below (the data has been omitted for brevity).
== Info: About to connect() to www.cs.auckland.ac.nz port 80 == Info: Trying 130.216.33.106... == Info: connected == Info: Connected to www.cs.auckland.ac.nz (130.216.33.106) port 80 => Send header, 178 bytes (0xb2) 0000: GET / HTTP/1.1 0010: User-Agent: curl/7.13.2 (i386-pc-linux-gnu) libcurl/7.13.2 OpenS 0050: SL/0.9.7e zlib/1.2.2 libidn/0.5.13 0074: Host: www.cs.auckland.ac.nz 0091: Pragma: no-cache 00a3: Accept: */* 00b0: <= Recv header, 17 bytes (0x11) 0000: HTTP/1.1 200 OK <= Recv header, 37 bytes (0x25) 0000: Date: Sun, 26 Mar 2006 23:58:03 GMT <= Recv header, 30 bytes (0x1e) 0000: Server: Apache/1.3.33 (Unix) <= Recv header, 30 bytes (0x1e) 0000: Cache-Control: max-age=18000 <= Recv header, 40 bytes (0x28) 0000: Expires: Mon, 27 Mar 2006 04:58:03 GMT <= Recv header, 28 bytes (0x1c) 0000: Transfer-Encoding: chunked <= Recv header, 25 bytes (0x19) 0000: Content-Type: text/html <= Recv data, 2687 bytes (0xa7f) ============================ DATA ============================ == Info: Connection #0 to host www.cs.auckland.ac.nz left intact == Info: Closing connection #0
An here are the headers returned from another site which works fine from wget:
== Info: About to connect() to organicdesign.co.nz port 1729 == Info: Trying 58.28.135.7... == Info: connected == Info: Connected to organicdesign.co.nz (58.28.135.7) port 1729 => Send header, 181 bytes (0xb5) 0000: GET / HTTP/1.1 0010: User-Agent: curl/7.13.2 (i386-pc-linux-gnu) libcurl/7.13.2 OpenS 0050: SL/0.9.7e zlib/1.2.2 libidn/0.5.13 0074: Host: organicdesign.co.nz:1729 0094: Pragma: no-cache 00a6: Accept: */* 00b3: <= Recv header, 17 bytes (0x11) 0000: HTTP/1.1 200 OK <= Recv header, 38 bytes (0x26) 0000: Date: Mon, 27 Mar 2006 11:57:45 NZST <= Recv header, 15 bytes (0xf) 0000: Server: wikid <= Recv header, 22 bytes (0x16) 0000: Content-Length: 3744 <= Recv header, 46 bytes (0x2e) 0000: Content-Disposition: inline;filename=Gir.swf <= Recv header, 19 bytes (0x13) 0000: Connection: close <= Recv header, 25 bytes (0x19) 0000: Content-Type: text/html <= Recv data, 1264 bytes (0x4f0) ============================ DATA ============================ == Info: Closing connection #0



