mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	close_request() (which can send a socket.shutdown()) must be called by the child process in a forking server. The parent must merely close the socket handle.
This commit is contained in:
		
							parent
							
								
									463dc4bf26
								
							
						
					
					
						commit
						f5b8ea9128
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -532,17 +532,19 @@ def process_request(self, request, client_address): | |||
|             if self.active_children is None: | ||||
|                 self.active_children = [] | ||||
|             self.active_children.append(pid) | ||||
|             self.close_request(request) | ||||
|             request.close() #close socket handle in parent process | ||||
|             return | ||||
|         else: | ||||
|             # Child process. | ||||
|             # This must never return, hence os._exit()! | ||||
|             try: | ||||
|                 self.finish_request(request, client_address) | ||||
|                 self.close_request(request) | ||||
|                 os._exit(0) | ||||
|             except: | ||||
|                 try: | ||||
|                     self.handle_error(request, client_address) | ||||
|                     self.close_request(request) | ||||
|                 finally: | ||||
|                     os._exit(1) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kristján Valur Jónsson
						Kristján Valur Jónsson