From: SourceForge.net <no...@so...> - 2007-06-28 21:29:18
|
Bugs item #1745073, was opened at 2007-06-28 21:29 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1745073&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Bob Luse (rluse) Assigned to: Nobody/Anonymous (nobody) Summary: Minor Problem with SocketServer Initial Comment: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1745073&group_id=12867 |