mirror of
				https://github.com/TeamPiped/piped-proxy.git
				synced 2024-08-14 23:50:45 +00:00 
			
		
		
		
	Remove use of channel.
This commit is contained in:
		
							parent
							
								
									830363ca64
								
							
						
					
					
						commit
						2aa3053d34
					
				
					 1 changed files with 3 additions and 6 deletions
				
			
		| 
						 | 
					@ -167,8 +167,7 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            let (tx, rx) = oneshot::channel::<String>();
 | 
					            let hash = spawn_blocking(move || {
 | 
				
			||||||
            spawn_blocking(move || {
 | 
					 | 
				
			||||||
                let mut hasher = blake3::Hasher::new();
 | 
					                let mut hasher = blake3::Hasher::new();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                for (key, value) in set {
 | 
					                for (key, value) in set {
 | 
				
			||||||
| 
						 | 
					@ -180,10 +179,8 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                let hash = hasher.finalize().to_hex();
 | 
					                let hash = hasher.finalize().to_hex();
 | 
				
			||||||
                let hash = hash[..8].to_owned();
 | 
					                let hash = hash[..8].to_owned();
 | 
				
			||||||
                tx.send(hash).unwrap();
 | 
					                hash
 | 
				
			||||||
            });
 | 
					            }).await.unwrap();
 | 
				
			||||||
 | 
					 | 
				
			||||||
            let hash = rx.await.unwrap();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if hash != qhash {
 | 
					            if hash != qhash {
 | 
				
			||||||
                return Err("Invalid qhash provided".into());
 | 
					                return Err("Invalid qhash provided".into());
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue