Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4455

remove isEosRcvd() and eosRcvd

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.0.0
    • SSL
    • None

    Description

      the isEosRcvd() is used by HttpSM.

      It is check SSLNetVConnection->eosRcvd while received VC_EVENT_READ_READY or VC_EVENT_READ_COMPLETE event, and rewrite the event to VC_EVENT_EOS.

      int
      HttpSM::state_read_client_request_header(int event, void *data)
      {
      .
      .
      .
        // check to see if there was an EOS received on the SSL connection
        SSLNetVConnection *ssl_vc = dynamic_cast<SSLNetVConnection *>(ua_session->get_netvc());
        if (ssl_vc && ssl_vc->isEosRcvd()) {
          DebugSM("http", "EOS for ssl vc %p at read_first_btye state", ua_session->get_netvc());
          event = VC_EVENT_EOS;
        }
        switch (event) {
        case VC_EVENT_READ_READY:
        case VC_EVENT_READ_COMPLETE:
          // More data to parse
          break;
      
        case VC_EVENT_EOS:
          ua_entry->eos = true;
          if ((client_request_hdr_bytes > 0) && is_transparent_passthrough_allowed() && (ua_raw_buffer_reader != NULL)) {
            break;
          }
      .
      .
      .
      

      the eosRcvd is set to true only in SSLNetVConnection::net_read_io()

      // changed by YTS Team, yamsat
      void
      SSLNetVConnection::net_read_io(NetHandler *nh, EThread *lthread)
      {
      .
      .
      .
        case SSL_READ_EOS:
          // close the connection if we have SSL_READ_EOS, this is the return value from ssl_read_from_net() if we get an
          // SSL_ERROR_ZERO_RETURN from SSL_get_error()
          // SSL_ERROR_ZERO_RETURN means that the origin server closed the SSL connection
          eosRcvd = true;
          read.triggered = 0;
          readSignalDone(VC_EVENT_EOS, nh);
      
          if (bytes > 0) {
            Debug("ssl", "read_from_net, read finished - EOS");
          } else {
            Debug("ssl", "read_from_net, read finished - 0 useful bytes read, bytes used by SSL layer");
          }
          break;
      .
      .
      .
      

      It is also signal VC_EVENT_EOS to SM after set eosRcvd to true.

      thus, the eosRcvd and isEosRcvd() is no longer necessary.

      suggest remove them.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              oknet Chao Xu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: