mirror of https://github.com/procxx/kepka.git
				
				
				
			Create keys not simultaneously.
This commit is contained in:
		
							parent
							
								
									e6d3b2b098
								
							
						
					
					
						commit
						f424cb54f7
					
				|  | @ -183,9 +183,10 @@ DcKeyCreator::DcKeyCreator( | ||||||
| 		answered(); | 		answered(); | ||||||
| 	}); | 	}); | ||||||
| 
 | 
 | ||||||
| 	pqSend(&_temporary, _request.temporaryExpiresIn); |  | ||||||
| 	if (_request.persistentNeeded) { | 	if (_request.persistentNeeded) { | ||||||
| 		pqSend(&_persistent, 0); | 		pqSend(&_persistent, 0); | ||||||
|  | 	} else { | ||||||
|  | 		pqSend(&_temporary, _request.temporaryExpiresIn); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -602,13 +603,12 @@ void DcKeyCreator::failed(Error error) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void DcKeyCreator::done() { | void DcKeyCreator::done() { | ||||||
| 	Expects(_temporary.stage != Stage::None); | 	if (_temporary.stage == Stage::None) { | ||||||
| 
 | 		pqSend(&_temporary, _request.temporaryExpiresIn); | ||||||
| 	if (_persistent.stage != Stage::None && _persistent.stage != Stage::Ready) { |  | ||||||
| 		return; |  | ||||||
| 	} else if (_temporary.stage != Stage::Ready) { |  | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
|  | 	Assert(_temporary.stage == Stage::Ready); | ||||||
|  | 	Assert(_persistent.stage == Stage::Ready || _persistent.stage == Stage::None); | ||||||
| 
 | 
 | ||||||
| 	auto result = Result(); | 	auto result = Result(); | ||||||
| 	result.temporaryKey = std::make_shared<AuthKey>( | 	result.temporaryKey = std::make_shared<AuthKey>( | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue