Changeset 6986


Ignore:
Timestamp:
Oct 29, 2008, 8:06:44 PM (12 years ago)
Author:
charles
Message:

#1389 test #2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/handshake.c

    r6985 r6986  
    928928{
    929929    int               i;
    930     const size_t      needlen = handshake->ia_len;
     930    const size_t      needlen = handshake->ia_len + HANDSHAKE_SIZE;
    931931    struct evbuffer * outbuf;
    932932    uint32_t          crypto_select;
     
    10651065        }
    10661066
    1067         switch( handshake->state )
    1068         {
    1069             case AWAITING_PAD_C:
    1070                 readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->pad_c_len;
    1071                 break;
    1072 
    1073             case AWAITING_PAD_D:
    1074                 readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->pad_d_len;
    1075                 break;
    1076 
    1077             case AWAITING_IA:
    1078                 readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->ia_len;
    1079                 break;
    1080 
    1081             default:
    1082                 readyForMore = ret == READ_NOW;
    1083                 break;
    1084         }
     1067        if( ret != READ_NOW )
     1068            readyForMore = FALSE;
     1069        else if( handshake->state == AWAITING_PAD_C )
     1070            readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->pad_c_len;
     1071        else if( handshake->state == AWAITING_PAD_D )
     1072            readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->pad_d_len;
     1073        else if( handshake->state == AWAITING_IA )
     1074            readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->ia_len;
    10851075    }
    10861076
Note: See TracChangeset for help on using the changeset viewer.