mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 18:45:17 -04:00
disallow double tunnels (encrypted+clear) in Accepted mode, since it is not needed
This commit is contained in:
parent
ffdac640d8
commit
6a3610e6cb
2 changed files with 16 additions and 7 deletions
|
@ -979,16 +979,20 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash
|
|||
if(alreadyHaveFile(hash, info))
|
||||
return false ;
|
||||
|
||||
// the strategy for requesting encryption is the following:
|
||||
//
|
||||
// if policy is STRICT
|
||||
// - disable clear, enforce encryption
|
||||
// else
|
||||
// - if not specified, use clear
|
||||
//
|
||||
if(mDefaultEncryptionPolicy == RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT)
|
||||
{
|
||||
flags |= RS_FILE_REQ_ENCRYPTED ;
|
||||
flags &= ~RS_FILE_REQ_UNENCRYPTED ;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags |= RS_FILE_REQ_ENCRYPTED ;
|
||||
flags |= RS_FILE_REQ_UNENCRYPTED ;
|
||||
}
|
||||
else if(!(flags & ( RS_FILE_REQ_ENCRYPTED | RS_FILE_REQ_UNENCRYPTED )))
|
||||
flags |= RS_FILE_REQ_UNENCRYPTED ;
|
||||
|
||||
if(size == 0) // we treat this special case because
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue