http: add reusedSocket property on client request
Currently It's hard to handle keep-alive connection closes at unfortunate time. This PR set ClientRequest.reusedSocket property when reusing socket for request, so user can handle retry base on wether the request is reusing a socket. Similar to what chromium did
Refs:
- Request fail to retry: https://github.com/request/request/issues/3131
- Discussion in golang for the same issue: https://github.com/golang/go/issues/22158
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines