mirror of
				https://github.com/django/daphne.git
				synced 2025-11-04 01:27:33 +03:00 
			
		
		
		
	send() should not block once connection is closed
This commit is contained in:
		
							parent
							
								
									bb54f41736
								
							
						
					
					
						commit
						6dcc0d52b3
					
				| 
						 | 
					@ -195,6 +195,10 @@ class Server(object):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        Coroutine that jumps the reply message from asyncio to Twisted
 | 
					        Coroutine that jumps the reply message from asyncio to Twisted
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
 | 
					        # Don't do anything if the connection is closed
 | 
				
			||||||
 | 
					        if self.connections[protocol].get("disconnected", None):
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
 | 
					        # Let the protocol handle it
 | 
				
			||||||
        protocol.handle_reply(message)
 | 
					        protocol.handle_reply(message)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ### Utility
 | 
					    ### Utility
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,6 +7,7 @@ addopts = tests/
 | 
				
			||||||
[isort]
 | 
					[isort]
 | 
				
			||||||
line_length = 120
 | 
					line_length = 120
 | 
				
			||||||
multi_line_output = 3
 | 
					multi_line_output = 3
 | 
				
			||||||
 | 
					known_first_party = channels,daphne,asgiref
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[flake8]
 | 
					[flake8]
 | 
				
			||||||
exclude = venv/*,tox/*,docs/*,testproject/*,js_client/*,.eggs/*
 | 
					exclude = venv/*,tox/*,docs/*,testproject/*,js_client/*,.eggs/*
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user