parent
4a8e34a35d
commit
8518da7193
|
@ -927,7 +927,7 @@ readIA( tr_handshake * handshake,
|
||||||
struct evbuffer * inbuf )
|
struct evbuffer * inbuf )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const size_t needlen = handshake->ia_len;
|
const size_t needlen = handshake->ia_len + HANDSHAKE_SIZE;
|
||||||
struct evbuffer * outbuf;
|
struct evbuffer * outbuf;
|
||||||
uint32_t crypto_select;
|
uint32_t crypto_select;
|
||||||
|
|
||||||
|
@ -1064,24 +1064,14 @@ canRead( struct bufferevent * evin,
|
||||||
assert( 0 );
|
assert( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
switch( handshake->state )
|
if( ret != READ_NOW )
|
||||||
{
|
readyForMore = FALSE;
|
||||||
case AWAITING_PAD_C:
|
else if( handshake->state == AWAITING_PAD_C )
|
||||||
readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->pad_c_len;
|
readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->pad_c_len;
|
||||||
break;
|
else if( handshake->state == AWAITING_PAD_D )
|
||||||
|
|
||||||
case AWAITING_PAD_D:
|
|
||||||
readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->pad_d_len;
|
readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->pad_d_len;
|
||||||
break;
|
else if( handshake->state == AWAITING_IA )
|
||||||
|
|
||||||
case AWAITING_IA:
|
|
||||||
readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->ia_len;
|
readyForMore = EVBUFFER_LENGTH( inbuf ) >= handshake->ia_len;
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
readyForMore = ret == READ_NOW;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue