Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Delta Between Two Patch Sets: Lib/socketserver.py

Issue 26309: socketserver.BaseServer._handle_request_noblock() don't shutdwon request if verify_request is False
Left Patch Set: Created 4 years, 2 months ago
Right Patch Set: Created 4 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Lib/test/test_socketserver.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 """Generic socket server classes. 1 """Generic socket server classes.
2 2
3 This module tries to capture the various aspects of defining a server: 3 This module tries to capture the various aspects of defining a server:
4 4
5 For socket-based servers: 5 For socket-based servers:
6 6
7 - address family: 7 - address family:
8 - AF_INET{,6}: IP (Internet Protocol) sockets (default) 8 - AF_INET{,6}: IP (Internet Protocol) sockets (default)
9 - AF_UNIX: Unix domain sockets 9 - AF_UNIX: Unix domain sockets
10 - others, e.g. AF_DECNET are conceivable (see <socket.h> 10 - others, e.g. AF_DECNET are conceivable (see <socket.h>
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 """ 311 """
312 try: 312 try:
313 request, client_address = self.get_request() 313 request, client_address = self.get_request()
314 except OSError: 314 except OSError:
315 return 315 return
316 if self.verify_request(request, client_address): 316 if self.verify_request(request, client_address):
317 try: 317 try:
318 self.process_request(request, client_address) 318 self.process_request(request, client_address)
319 except: 319 except:
320 self.handle_error(request, client_address) 320 self.handle_error(request, client_address)
321 self.shutdown_request(request) 321 self.shutdown_request(request)
322 else:
323 self.shutdown_request(request)
322 324
323 def handle_timeout(self): 325 def handle_timeout(self):
324 """Called if no new request arrives within self.timeout. 326 """Called if no new request arrives within self.timeout.
325 327
326 Overridden by ForkingMixIn. 328 Overridden by ForkingMixIn.
327 """ 329 """
328 pass 330 pass
329 331
330 def verify_request(self, request, client_address): 332 def verify_request(self, request, client_address):
331 """Verify the request. May be overridden. 333 """Verify the request. May be overridden.
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 """Define self.rfile and self.wfile for datagram sockets.""" 756 """Define self.rfile and self.wfile for datagram sockets."""
755 757
756 def setup(self): 758 def setup(self):
757 from io import BytesIO 759 from io import BytesIO
758 self.packet, self.socket = self.request 760 self.packet, self.socket = self.request
759 self.rfile = BytesIO(self.packet) 761 self.rfile = BytesIO(self.packet)
760 self.wfile = BytesIO() 762 self.wfile = BytesIO()
761 763
762 def finish(self): 764 def finish(self):
763 self.socket.sendto(self.wfile.getvalue(), self.client_address) 765 self.socket.sendto(self.wfile.getvalue(), self.client_address)
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+