mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 00:42:44 +00:00 
			
		
		
		
	LibCore: Make it possible to cancel pending CNetworkJobs
Subclasses of CNetworkJob handle this by overriding shutdown(). This patch implements it for CHttpJob by simply tearing down the underlying socket. We also automatically call shutdown() after the job finishes, regardless of success or failure. :^)
This commit is contained in:
		
							parent
							
								
									ff6ce422dd
								
							
						
					
					
						commit
						bdf23a3d23
					
				
					 7 changed files with 31 additions and 2 deletions
				
			
		|  | @ -29,6 +29,8 @@ void ThreadCatalogModel::update() | |||
|     CHttpRequest request; | ||||
|     request.set_url(String::format("http://a.4cdn.org/%s/catalog.json", m_board.characters())); | ||||
| 
 | ||||
|     if (m_pending_job) | ||||
|         m_pending_job->cancel(); | ||||
|     m_pending_job = request.schedule(); | ||||
| 
 | ||||
|     if (on_load_started) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling