Message1689

Author rluse
Recipients
Date 2007-06-28.21:29:17
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Hi,

This one is a little strange and I'm not sure how serious it is, but I thought I would document it while I have recreated it.  When I run the following script on Jython 2.2b2:

import SocketServer
import socket
import string

class EchoHandler(SocketServer.BaseRequestHandler):
    def handle(self):
        f = self.request.makefile()
        self.request.send("HTTP/1.0 200 OK\r\n")
        self.request.send("Content-type text/plain\r\n\r\n")
        self.request.send("Received connection from %s\r\n\r\n" % (self.client_address,))
        
        while True:
            line = f.readline()
            self.request.send(line)
            if not string.strip(line):
                break
        f.close()
    
    
import sys
print sys.version
print sys.platform
     
serv = SocketServer.TCPServer(("", 9000), EchoHandler)
print 'Running on port 9000'
serv.serve_forever()

----------------------------------------------------

And then point my Firefox browser at http://localhost:9000  I get the following output:

-------------------------------------------------

Received connection from ('sn45g', 1037)

GET / HTTP/1.1
Host: localhost:9000
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cache-Control: max-age=0

-----------------------------------------------------

but, when I run the same script on Jython 2.2RC1, I get this output in my browser:

----------------------------------------------------

Received connection from ('localhost', 4090)

GET / HTTP/1.1

------------------------------------------------------


It gives me 'localhost' instead of 'sn45g' which is my windows system name, and then trunkates much of the remaining response.
History
Date User Action Args
2008-02-20 17:17:52adminlinkissue1745073 messages
2008-02-20 17:17:52admincreate