Karen,
Thanks for the response, but I'm unable to unquote the strings as
django does it automatically for me when I get the GET list entries.
I've tried to run it from django, insert an assert false and give you
the answer
Here's the URL that was entered:
http://127.0.0.1:8000/announce/?info_hash=%EByXm%C5%7EmfD%D8%9A%91%D4%F7%C7%86%C7%D18%A7&peer_id=-TR1210-1q4q9aomcne9&port=51413&uploaded=0&downloaded=0&corrupt=0&left=0&compact=1&numwant=80&key=jda2jjrygr&event=started
Here's the URL handler
def view_announce(request):
# request.encoding = "iso-8859-1"
request.encoding = "latin-1"
#client information
c = {}
try:
#if the client explicitly specifies its preferred IP address, then
#use that. Else just take the address.
c['addr'] = request.GET.get('ip', None) or
request.META['REMOTE_ADDR']
c['port'] = int(request.GET['port'])
c['peer_id'] = request.GET['peer_id']
# JFM, hack arond unicode issues with info_hash in django
hash = request.GET['info_hash'].encode('iso8859-1')
except KeyError:
#if any of these is not defined, then it makes little sense to
proceed.
return _fail("""One of the following is missing: IP, Port, Peer_ID
or info_hash""")
print "Got all keys..."
print "hash " + hash
assert False
Here's the dump from Assert false:
Request information
GET
Variable Value
uploaded
u'0'
compact
u'1'
numwant
u'80'
info_hash
u'\xebyXm\xc5~mfD\xd8\x9a\x91\xd4\xf7\xc7\x86\xc7\xd18\xa7'
event
u'started'
downloaded
u'0'
key
u'jda2jjrygr'
corrupt
u'0'
peer_id
u'-TR1210-1q4q9aomcne9'
port
u'51413'
left
u'0'
POST
No POST data
COOKIES
Variable Value
sessionid
'f356ef76d6c20c3be39aec3d29ff023a'
META
Variable Value
Apple_PubSub_Socket_Render
'/tmp/launch-1GTNEW/Render'
COMMAND_MODE
'unix2003'
CONTENT_LENGTH
''
CONTENT_TYPE
'text/plain'
DISPLAY
'/tmp/launch-eJizQ9/:0'
DJANGO_SETTINGS_MODULE
'tracker.settings'
GATEWAY_INTERFACE
'CGI/1.1'
HOME
'/Users/John'
HTTP_ACCEPT
'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/
plain;q=0.8,image/png,*/*;q=0.5'
HTTP_ACCEPT_ENCODING
'gzip, deflate'
HTTP_ACCEPT_LANGUAGE
'en-us'
HTTP_CACHE_CONTROL
'max-age=0'
HTTP_CONNECTION
'keep-alive'
HTTP_COOKIE
'sessionid=f356ef76d6c20c3be39aec3d29ff023a'
HTTP_HOST
'
127.0.0.1:8000'
HTTP_USER_AGENT
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2; en-us) AppleWebKit/
525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.18'
LANG
'en_US.UTF-8'
LOGNAME
'John'
MANPATH
'/usr/share/man:/usr/local/share/man:/usr/X11/man'
OLDPWD
'/Users/John/development'
PATH
'/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin'
PATH_INFO
'/announce/'
PWD
'/Users/John/development/tracker'
QUERY_STRING
'info_hash=%EByXm%C5%7EmfD%D8%9A%91%D4%F7%C7%86%C7%D18%A7&peer_id=-
TR1210-1q4q9aomcne9&port=51413&uploaded=0&downloaded=0&corrupt=0&left=0&compact=1&numwant=80&key=jda2jjrygr&event=started'
REMOTE_ADDR
'127.0.0.1'
REMOTE_HOST
''
REQUEST_METHOD
'GET'
RUN_MAIN
'true'
SCRIPT_NAME
''
SECURITYSESSIONID
'6939d0'
SERVER_NAME
'localhost'
SERVER_PORT
'8000'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SOFTWARE
'WSGIServer/0.1 Python/2.5.1'
SHELL
'/bin/bash'
SHLVL
'1'
SSH_AUTH_SOCK
'/tmp/launch-qjIQx5/Listeners'
TERM
'xterm-color'
TERM_PROGRAM
'Apple_Terminal'
TERM_PROGRAM_VERSION
'240'
TMPDIR
'/var/folders/v-/v-IkkU9PHbeIn98mRd6ZM++++TI/-Tmp-/'
TZ
'America/Los_Angeles'
USER
'John'
_
'./manage.py'
__CF_USER_TEXT_ENCODING
'0x1F5:0:0'
wsgi.errors
<open file '<stderr>', mode 'w' at 0x170b0>
wsgi.file_wrapper
<class 'django.core.servers.basehttp.FileWrapper'>
wsgi.input
<socket._fileobject object at 0x6d5bb0>
wsgi.multiprocess
False
wsgi.multithread
True
wsgi.run_once
False
wsgi.url_scheme
'http'
wsgi.version
(1, 0)
john
On May 29, 7:04 am, "Karen Tracey" <
kmtra...@gmail.com> wrote: