Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98830 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4538 invoked from network); 20 Apr 2017 20:56:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2017 20:56:12 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.128.178 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.128.178 mail-wr0-f178.google.com Received: from [209.85.128.178] ([209.85.128.178:36707] helo=mail-wr0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AD/87-61625-56029F85 for ; Thu, 20 Apr 2017 16:56:06 -0400 Received: by mail-wr0-f178.google.com with SMTP id c55so43276515wrc.3 for ; Thu, 20 Apr 2017 13:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:from:date:message-id:subject:to; bh=jjQBikrlmFMJ8Bvuci73KSNlK5G0b9ugbVQByriCu30=; b=GLtoNWtIs0GnZZVC+NHeI6WEQkeBMszWgWsJdV5fGPUkYQEZOc5BDjyjoLVq0bYJxx TQVpgPDeXQULki5tfMJDjzsc0LYIr6z7ks1hBUP2rxDH3fSB9QqHEZ1e5iM+5/JDMSQT lYsHl6uts4aIGf483cUWShpzle2eKFkFDEAZB4b6LSdeHskef7Ln6TIdqMvgNdpV8bRy rf9v2TRZ5tzakgoKT7240TEhzK+dpAV8eLRnLpjwqfSYA+NeUCsHJZ9Ljy06CFTQnvq5 hQqD3hT/aQ0q49NDUuIN4e/ZEsm1PnY6e/HfBPCemmWeCqvuYol1DdGXLsvjRak2ZRUF lBqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=jjQBikrlmFMJ8Bvuci73KSNlK5G0b9ugbVQByriCu30=; b=mgO60eKS3BUqf1jHPNRPUq32iwJD3E07R0Rg1NU5inwv8QlFVzjC6Z4sEQ3xFVjDwJ jSIi5GkPuhdd7vNZiZOYxIQTGjJIxHhnn62EcCHsO7yG2FS6JXUbBk8Hpx6MXPPXFije TGasViOpw2B/4JPd9etqmTVxXv2SEpguGxYTC4/oSuPxkzyyq0Pk1iiy/6U5eZ3cRn6L xaRaW5TWlUqmwZEGumh5fCoByGSGSgecyLpaGrFvZJ7WrYbYW3GpXvYKtxvbcB4kKkjG KUvulPMUVmH7NFDCzRowKX9WSfzCQJViuf8e9n3kx1U/SmRQkgtCjRT5QDYMtFO5HrnO HyTg== X-Gm-Message-State: AN3rC/7qTWbFU7yZfWOrD6mKOEhrKBvo2PZlmeOT6nLyqNc/ie1YNNzk ywENySzs/XejbgPcCpgaQoXp8F787Tvrrk4= X-Received: by 10.223.152.144 with SMTP id w16mr9424450wrb.163.1492721762221; Thu, 20 Apr 2017 13:56:02 -0700 (PDT) MIME-Version: 1.0 Sender: php@golemon.com Received: by 10.223.157.12 with HTTP; Thu, 20 Apr 2017 13:56:01 -0700 (PDT) X-Originating-IP: [50.197.186.161] Date: Thu, 20 Apr 2017 13:56:01 -0700 X-Google-Sender-Auth: Z1NQJpVh0g4SgA9_5k3fRp23vSw Message-ID: To: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: On malformed transport strings From: pollita@php.net (Sara Golemon) My fix to https://bugs.php.net/bug.php?id=74216 tightened down the definition of what a valid transport string looks like. Previously, transport strings like "tcp://127.0.0.1:80:81:82/your/moms/face" would be accepted by PHP as perfectly valid URIs. Since this was never documented as a feature of transports, but rather a simple oversight during the Bush era, I added some sanity checking to verify there was no garbage after the port number in IP based transport strings. Then they came out of the woodwork... https://bugs.php.net/bug.php?id=74429 depends on the previous "ignore garbage" behavior in order to create named persistent streams. (ex: "tcp://127.0.0.1:80/main_connection" and "tcp://127.0.0.1:80/secondary") In short, the persistence key is defined by the whole transport string, while the address/port parsing ensures that the uniqueifying portion doesn't prevent the connection from happening. The project referenced in that bug report and predis both utilize this behavior. https://bugs.php.net/bug.php?id=74432 also popped up today as a bug in how mysqli (specifically via mysqlnd) invokes connections to the backend. Ultimately, an address provided blindly gets a (potentially default) port number tacked onto the end. Again, undocumented behavior working up until the 74216 fix. I'm inclined to revert to prior "ignore garbage" behavior on the 7.0 and 7.1 branches to avoid BC break trauma (though I do think raising a warning is advised). What's uncertain in my mind is whether or not we take a hard line on "Use the API as documented" for 7.2 or if some other middle ground is appropriate. Particularly given the use case of named persistent transports. The right way to do that would be to have a new API for named transports, possibly just as a context option. -Sara https://pbs.twimg.com/media/C9uYe-uUQAAPpbK.jpg