Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-269

Connect Redirect parsing incorrectly uses position in map rather than value of key

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • proton-0.5
    • proton-c
    • None

    Description

      The connection error "redirect" is defined to carry an info map of the following form:

      The container is no longer available on the current connection. The peer should attempt reconnection to the container using the details provided in the info map.

      hostname: the hostname of the container. This is the value that should be supplied in the hostname field of the open frame, and during the SASL and TLS negotiation (if used).

      network-host: the DNS hostname or IP address of the machine hosting the container.

      port: the port number on the machine hosting the container.

      However proton-c completely ignores the values of the keys in the info map and instead assumes that network host will be the value in the second key-value pair, and port will be the value in the thirs key-value pair; e.g.:

      const char *pn_condition_redirect_host(pn_condition_t *condition)
      {
      pn_data_t *data = pn_condition_info(condition);
      pn_data_rewind(data);
      pn_data_next(data);
      pn_data_enter(data);
      pn_data_next(data);
      pn_data_next(data);
      pn_data_next(data);
      pn_data_next(data);
      pn_bytes_t host = pn_data_get_bytes(data);
      pn_data_rewind(data);
      return host.start;
      }

      This is incorrect behaviour.

      Attachments

        Activity

          People

            rhs Rafael H. Schloming
            rgodfrey Robert Godfrey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: