Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-508

phongo_stream_initiator() constructs invalid stream URI for IPv6 literal

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 1.1.0
    • Affects Version/s: 1.0.0
    • Component/s: None
    • Labels:
      None

      The stream initiator uses the following template for constructing both AF_INET6 and AF_INET connections:

      dsn_len = spprintf(&dsn, 0, "tcp://%s:%d", host->host, host->port);
      

      AF_INET6 requires us to enclose ipv6 literals in brackets (like the MongoDB URI):

      dsn_len = spprintf(&dsn, 0, "tcp://[%s]:%d", host->host, host->port);
      

      This jives with this note from stream_socket_client() in the PHP manual:

      When specifying a numerical IPv6 address (e.g. fe80::1), you must enclose the IP in square brackets—for example, tcp://[fe80::1]:80.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: