OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 if not self._ApplyPatch(packet.patch): | 69 if not self._ApplyPatch(packet.patch): |
70 return | 70 return |
71 | 71 |
72 tests = packet.tests | 72 tests = packet.tests |
73 endpoint.Execute(v8_root, self.ctx, tests, self.request, self.server.daemon) | 73 endpoint.Execute(v8_root, self.ctx, tests, self.request, self.server.daemon) |
74 self._SendResponse() | 74 self._SendResponse() |
75 | 75 |
76 def _SendResponse(self, error_message=None): | 76 def _SendResponse(self, error_message=None): |
77 try: | 77 try: |
78 if error_message: | 78 if error_message: |
79 compression.Send([-1, error_message], self.request) | 79 compression.Send([[-1, error_message]], self.request) |
80 compression.Send(constants.END_OF_STREAM, self.request) | 80 compression.Send(constants.END_OF_STREAM, self.request) |
81 return | 81 return |
82 except Exception, e: | 82 except Exception, e: |
83 pass # Peer is gone. There's nothing we can do. | 83 pass # Peer is gone. There's nothing we can do. |
84 # Clean up. | 84 # Clean up. |
85 self._Call("git checkout -f") | 85 self._Call("git checkout -f") |
86 self._Call("git clean -f -d") | 86 self._Call("git clean -f -d") |
87 self._Call("rm -rf %s" % self.ctx.shell_dir) | 87 self._Call("rm -rf %s" % self.ctx.shell_dir) |
88 | 88 |
89 def _UnpackBinary(self, binary, pubkey_fingerprint): | 89 def _UnpackBinary(self, binary, pubkey_fingerprint): |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 def _Call(self, cmd): | 141 def _Call(self, cmd): |
142 return subprocess.call(cmd, shell=True) | 142 return subprocess.call(cmd, shell=True) |
143 | 143 |
144 | 144 |
145 class WorkSocketServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer): | 145 class WorkSocketServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer): |
146 def __init__(self, daemon): | 146 def __init__(self, daemon): |
147 address = (daemon.ip, constants.PEER_PORT) | 147 address = (daemon.ip, constants.PEER_PORT) |
148 SocketServer.TCPServer.__init__(self, address, WorkHandler) | 148 SocketServer.TCPServer.__init__(self, address, WorkHandler) |
149 self.job_lock = threading.Lock() | 149 self.job_lock = threading.Lock() |
150 self.daemon = daemon | 150 self.daemon = daemon |
OLD | NEW |