Branch: Tag:

2015-04-13

2015-04-13 14:27:05 by Martin Nilsson <nilsson@opera.com>

Let the packet errors be generated by the recv caller.

509:   //! more data is needed to get a complete packet.   protected Packet recv_packet()   { -  int(0..1)|Packet res; -  +     if (!packet)    packet = Packet(version, 2048);    -  res = packet->recv(read_buffer); +  int res = packet->recv(read_buffer);    -  if(objectp(res)) -  return [object(Packet)]res; -  -  if (res) -  { /* Finished a packet */ -  if (current_read_state) { +  switch(res) +  { +  case 1: +  // Finished a packet +  if (current_read_state)    SSL3_DEBUG_MSG("SSL.Connection->recv_packet(): version=0x%x\n",    version);    return current_read_state->decrypt_packet(packet); -  } else { +  case 0:    SSL3_DEBUG_MSG("SSL.Connection->recv_packet(): current_read_state is zero!\n");    return 0; -  +  case -1: +  return alert(ALERT_fatal, ALERT_unexpected_message); +  default: +  error("Internal error.\n");    } -  } +        return 0;   }