Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2011-06-28 22:01:12 (GMT)
committer Simon Schampijer <simon@schampijer.de>2011-06-29 12:42:53 (GMT)
commit10580fc2a73aec1f828a3d8d43489e1d31a670c1 (patch)
tree85693373d9b84b4f453ea89d8e5a08c428aeb7d9
parent7e61237c8fcfb83b6caefe04d628b7a3220d7d1e (diff)
GlibTCPServer: defer shutdown_request to avoid closing the socket too early OLPC #10906
In Python 2.7, shutdown_request was added to the BaseServer class and TCPServer was adopted to use it instead of close_request in the _handle_request_noblock() path. GlibTCPServer must be adapted to account for this, so that shutdown_request is not allowed to prematurely allowed to close the socket, in the same way that close_request is ignored. Fixes collaboration in activities that rely on this mechanism for sharing (including ImageViewer and Read) Signed-off-by: Daniel Drake <daniel@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org> Tested-by: Gonzalo Odiard <gonzalo@laptop.org> Tested-by: Simon Schampijer <simon@laptop.org>
-rw-r--r--src/sugar/network.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sugar/network.py b/src/sugar/network.py
index 34d496c..217c077 100644
--- a/src/sugar/network.py
+++ b/src/sugar/network.py
@@ -75,6 +75,12 @@ class GlibTCPServer(SocketServer.TCPServer):
# let the request be closed by the request handler when its done
pass
+ def shutdown_request(self, request):
+ """Called to shutdown and close an individual request."""
+ # like close_request, let the request be closed by the request handler
+ # when done
+ pass
+
class ChunkedGlibHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
"""RequestHandler class that integrates with Glib mainloop. It writes