cleaned up some crypto code

This commit is contained in:
Arvid Norberg 2008-04-08 05:51:12 +00:00
parent e329403619
commit 64a195651d
1 changed files with 6 additions and 11 deletions

View File

@ -2020,28 +2020,23 @@ namespace libtorrent
// select a crypto method
switch (m_ses.get_pe_settings().allowed_enc_level)
{
case (pe_settings::plaintext):
{
case pe_settings::plaintext:
if (!(crypto_field & 0x01))
{
disconnect("plaintext not provided");
return;
}
crypto_select = 0x01;
}
break;
case (pe_settings::rc4):
{
break;
case pe_settings::rc4:
if (!(crypto_field & 0x02))
{
disconnect("rc4 not provided");
return;
}
crypto_select = 0x02;
}
break;
case (pe_settings::both):
{
break;
case pe_settings::both:
if (m_ses.get_pe_settings().prefer_rc4)
{
if (crypto_field & 0x02)
@ -2061,7 +2056,7 @@ namespace libtorrent
disconnect("rc4/plaintext not provided");
return;
}
}
break;
} // switch
// write the pe4 step