[Pkg-sugar-commit] [sugar-toolkit] 03/04: GlibTCPServer: defer shutdown_request to avoid closing the socket too early OLPC #10906

Jonas Smedegaard dr at jones.dk
Thu Apr 16 18:52:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag v0.92.3
in repository sugar-toolkit.

commit e14ee657476f4ad026705b7762d4a505a37d276f
Author: Daniel Drake <dsd at laptop.org>
Date:   Tue Jun 28 23:01:12 2011 +0100

    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 at laptop.org>
    Acked-by: Simon Schampijer <simon at laptop.org>
    Tested-by: Gonzalo Odiard <gonzalo at laptop.org>
    Tested-by: Simon Schampijer <simon at laptop.org>
---
 src/sugar/network.py | 6 ++++++
 1 file changed, 6 insertions(+)

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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sugar/sugar-toolkit.git



More information about the pkg-sugar-commit mailing list