+ when 'getnode_history'; results[index]=AMF.putdata(index,getnode_history(args[0].to_i))
+ when 'findrelations'; results[index]=AMF.putdata(index,findrelations(*args))
+ when 'getpoi'; results[index]=AMF.putdata(index,getpoi(*args))
+ end
+ end
+ sendresponse(results)
+ end
+
+ def amf_write
+ req=StringIO.new(request.raw_post+0.chr)
+ req.read(2)
+ results={}
+ renumberednodes={} # Shared across repeated putways
+ renumberedways={} # Shared across repeated putways
+
+ headers=AMF.getint(req) # Read number of headers
+ headers.times do # Read each header
+ name=AMF.getstring(req) # |
+ req.getc # | skip boolean
+ value=AMF.getvalue(req) # |
+ header["name"]=value # |
+ end
+
+ bodies=AMF.getint(req) # Read number of bodies
+ bodies.times do # Read each body
+ message=AMF.getstring(req) # | get message name
+ index=AMF.getstring(req) # | get index in response sequence
+ bytes=AMF.getlong(req) # | get total size in bytes
+ args=AMF.getvalue(req) # | get response (probably an array)
+
+ case message