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

version» Context lines:

pike.git/lib/modules/SSL.pmod/Connection.pike:408:    state = [int(0..0)|ConnectionState](state | CONNECTION_local_closing);    }    }       if (!priority)    priority = ([ PACKET_alert : PRI_alert,    PACKET_change_cipher_spec : PRI_urgent,    PACKET_handshake : PRI_urgent,    PACKET_heartbeat : PRI_urgent,    PACKET_application_data : PRI_application ])[packet->content_type]; +  +  if ((state & CONNECTION_local_closing) && (priority >= PRI_application)) { +  SSL3_DEBUG_MSG("send_packet: Ignoring application packet during close.\n"); +  return; +  } +  +  if ((packet->content_type == PACKET_handshake) && +  (priority == PRI_application)) { +  // Assume the packet is either hello_request or client_hello, +  // and that we want to renegotiate. +  expect_change_cipher = 0; +  certificate_state = 0; +  state = [int(0..0)|ConnectionState](state | CONNECTION_handshaking); +  handshake_state = STATE_wait_for_hello; +  } +     SSL3_DEBUG_MSG("SSL.Connection->send_packet: type %d, pri %d, %O\n",    packet->content_type, priority, packet->fragment[..5]);    switch (priority)    {    default:    error( "Internal error\n" );    case PRI_alert:    alert_q->put(packet);    break;    case PRI_urgent:
pike.git/lib/modules/SSL.pmod/Connection.pike:489:    return res;   }      //! Initiate close.   void send_close()   {    send_packet(alert(ALERT_warning, ALERT_close_notify,    "Closing connection.\n"), PRI_application);   }    + //! Renegotiate the connection. + void send_renegotiate(); +    //! Send an application data packet. If the data block is too large   //! then as much as possible of the beginning of it is sent. The size   //! of the sent data is returned.   int send_streaming_data (string(8bit) data)   {    if (!sizeof(data)) return 0;    Packet packet = Packet(version);    packet->content_type = PACKET_application_data;    int max_packet_size = session->max_packet_size;    int size;