Commit 64f036b4 authored by Woo Xie's avatar Woo Xie Committed by Sara Golemon

fix the compling error caused by tcpinfo of low version

Summary: my D2097198 break the project relying on old glibc

Test Plan: compling

Reviewed By: wez@fb.com

Subscribers: trunkagent, fugalh, folly-diffs@, jsedgwick, yfeldblum, chalfant

FB internal diff: D2135297

Tasks: 7283522

Signature: t1:2135297:1433791259:8b82b8d9b16da32be54c0dff1214fa20c94840e2
parent 64699b9b
......@@ -31,6 +31,7 @@ bool TransportInfo::initWithSocket(const AsyncSocket* sock) {
* available in current tcpinfo. To workaround this limitation, totalBytes
* and MSS are used to estimate it.
*/
#if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 17
if (tcpinfo.tcpi_total_retrans == 0) {
rtx = 0;
} else if (tcpinfo.tcpi_total_retrans > 0 && tcpinfo.tcpi_snd_mss > 0 &&
......@@ -42,6 +43,9 @@ bool TransportInfo::initWithSocket(const AsyncSocket* sock) {
} else {
rtx = -1;
}
#else
rtx = -1;
#endif // __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 17
validTcpinfo = true;
#else
tcpinfoErrno = EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment