Changeset 81a7f3f
- Timestamp:
- Aug 5, 2009 11:10:14 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
- Children:
- ab37086
- Parents:
- df783c1
- Location:
- fedd/federation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/deter_impl.py
rdf783c1 r81a7f3f 60 60 self.soap_services.update(self.experiment.soap_services) 61 61 self.xmlrpc_services.update(self.experiment.xmlrpc_services) 62 self.get_handler = self.experiment.get_handler 63 else: 64 self.get_handler = self.experiment.get_handler 62 65 63 66 if config.has_section("splitter"): -
fedd/federation/server.py
rdf783c1 r81a7f3f 15 15 from fedd_services import ns0 16 16 from service_error import * 17 18 import os.path 17 19 18 20 import logging … … 39 41 self.soap_methods = impl.soap_services 40 42 self.xmlrpc_methods = impl.xmlrpc_services 43 self.get_handler = impl.get_handler 41 44 self.log = logging.getLogger("fedd") 42 45 if debug: self.handle_error = self.handle_error_debug … … 130 133 self.send_xml(str(sw)) 131 134 135 def do_GET(self): 136 """ 137 If a get handler is registered, use that to retrieve data. 138 """ 139 if self.server.get_handler: 140 code = 200 141 fid = fedid(cert=self.request.get_peer_cert()) 142 print "in do_GET: %s %s" % (fid, self.request.get_peer_cert()) 143 fname, type = self.server.get_handler(self.path, fid) 144 try: 145 f = open(fname, "rb") 146 size = os.path.getsize(fname) 147 except IOError, e: 148 code = 404 149 size = 0 150 else: 151 code = 404 152 size = 0 153 154 self.send_response(code) 155 if code == 200: 156 if type: 157 self.send_header('Content-type', type) 158 self.send_header('Content-Length', size) 159 self.end_headers() 160 bytes = f.read(4096) 161 while len(bytes): 162 self.wfile.write(bytes) 163 bytes = f.read(4096) 164 self.wfile.flush() 165 self.request.socket.close() 166 167 132 168 def log_request(self, code=0, size=0): 133 169 """
Note: See TracChangeset
for help on using the changeset viewer.