diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2013-08-31 23:46:06 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-01 15:51:11 +0100 |
commit | 6d9e3a19384cbd737fdac729c6c0de5b06f8ec12 (patch) | |
tree | c172e619b3cafb92b8489c5e827d9ae4e3f0cf31 /bitbake | |
parent | c7b342903208cfb4cefaa0ec339c6ddfcd590acc (diff) | |
download | poky-6d9e3a19384cbd737fdac729c6c0de5b06f8ec12.tar.gz |
bitbake: server/xmlrpc: stop server on client exit
If the server only expects a single client to connect (i.e.
no bind parameter set, so there is no way for the
clients to get the server port), stop the server after
the first client exits.
(Bitbake rev: eb6bae56f62082bf147045311154cbae4bca0f4c)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/server/xmlrpc.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py index cca569d0e9..a28672c447 100644 --- a/bitbake/lib/bb/server/xmlrpc.py +++ b/bitbake/lib/bb/server/xmlrpc.py | |||
@@ -133,6 +133,8 @@ class BitBakeServerCommands(): | |||
133 | if self.has_client: | 133 | if self.has_client: |
134 | self.server.set_connection_token(None) | 134 | self.server.set_connection_token(None) |
135 | self.has_client = False | 135 | self.has_client = False |
136 | if self.server.single_use: | ||
137 | self.server.quit = True | ||
136 | 138 | ||
137 | # This request handler checks if the request has a "Bitbake-token" header | 139 | # This request handler checks if the request has a "Bitbake-token" header |
138 | # field (this comes from the client side) and compares it with its internal | 140 | # field (this comes from the client side) and compares it with its internal |
@@ -239,6 +241,9 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer): | |||
239 | self.commands = BitBakeServerCommands(self) | 241 | self.commands = BitBakeServerCommands(self) |
240 | self.autoregister_all_functions(self.commands, "") | 242 | self.autoregister_all_functions(self.commands, "") |
241 | self.interface = interface | 243 | self.interface = interface |
244 | self.single_use = False | ||
245 | if (interface[1] == 0): # anonymous port, not getting reused | ||
246 | self.single_use = True | ||
242 | 247 | ||
243 | def addcooker(self, cooker): | 248 | def addcooker(self, cooker): |
244 | BaseImplServer.addcooker(self, cooker) | 249 | BaseImplServer.addcooker(self, cooker) |