pike.git / lib / modules / SSL.pmod / Connection.pike

version» Context lines:

pike.git/lib/modules/SSL.pmod/Connection.pike:913:   {    if (state & CONNECTION_peer_closed) {    // The peer has closed the connection.    return 1;    }    // If closing we continue to try to read a remote close message.    // That enables the caller to check for a clean close, and    // to get the leftovers after the SSL connection.       read_buffer->add(data); +  Stdio.Buffer.RewindKey read_buffer_key = read_buffer->rewind_key();       string(8bit) res = "";    Packet packet;    while (packet = recv_packet())    {    if (packet->is_alert)    { /* Reply alert */    SSL3_DEBUG_MSG("SSL.Connection: Bad received packet\n");    if (alert_callback) -  alert_callback(packet, current_read_state->seq_num, data); +  { +  Stdio.Buffer.RewindKey here = read_buffer->rewind_key(); +  read_buffer_key->rewind(); +  alert_callback(packet, current_read_state->seq_num, +  (string)read_buffer); +  here->rewind(); +  }    if (this && packet)    send_packet(packet);    if ((!packet) || (!this) || (packet->level == ALERT_fatal))    return -1;    if (alert_callback)    break;    }    else    {    SSL3_DEBUG_MSG("SSL.Connection: received packet of type %d\n",