mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-32622: Enforce sendfile fallback policy for FALLBACK transports (#5364)
This commit is contained in:
		
							parent
							
								
									7c684073f9
								
							
						
					
					
						commit
						b1a6ac4c40
					
				
					 2 changed files with 15 additions and 1 deletions
				
			
		|  | @ -1035,7 +1035,12 @@ async def sendfile(self, transport, file, offset=0, count=None, | |||
|             except events.SendfileNotAvailableError as exc: | ||||
|                 if not fallback: | ||||
|                     raise | ||||
|         # the mode is FALLBACK or fallback is True | ||||
| 
 | ||||
|         if not fallback: | ||||
|             raise RuntimeError( | ||||
|                 f"fallback is disabled and native sendfile is not " | ||||
|                 f"supported for transport {transport!r}") | ||||
| 
 | ||||
|         return await self._sendfile_fallback(transport, file, | ||||
|                                              offset, count) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yury Selivanov
						Yury Selivanov