pfsockopen returns incorrect connections
commite03fc4652e3e0421835ff160a795258ab7ff3454
authorArnaud GRANAL <serphen@gmail.com>
Wed, 22 Jan 2014 21:11:45 +0000 (22 13:11 -0800)
committerSara Golemon <sgolemon@fb.com>
Tue, 28 Jan 2014 16:05:51 +0000 (28 08:05 -0800)
treebb56326bd2399237478eaff9b0eacb20eb42ba9f
parentc5aa39b1009e52327e0f397c3284d1250fbe2d2a
pfsockopen returns incorrect connections

Persistent connections currently return a cached connection for (key = "hostname").
Expected behavior is to return a cached connection for (key = "hostname + port").
As a result, persistent connections write and read from the wrong socket if you have multiple connections to the same hostname but different port.

Redis hhvm implementation is affected by this bug (probably other modules too, but not MySQL at least, who uses its own socket cache handler).

Closes #1599

Reviewed By: ps

Differential Revision: D1135971

Pulled By: @scannell
hphp/runtime/ext/ext_socket.cpp
hphp/test/slow/ext_socket/ext_socket.php
hphp/test/slow/ext_socket/ext_socket.php.expectf
hphp/util/network.cpp