Code review comment for lp:~marcustomlinson/net-cpp/fix_ppc_timeout

Revision history for this message
Michi Henning (michihenning) wrote :

I'm having second thoughts about this fix as it stands. If someone accidentally passes a duration that is greater than numeric_limits<long>::max() (such as the epoch), we'll wait a random amount of time (possibly not at all or a very short amount of time), depending on the exact value.
I can see three options:

- Check if the passed value overflows and silently clamp to numeric_limits<long>::max()

- Check if the passed value overflows and silently adjust to "wait forever"

- Throw an exception

I'm slightly in favour of the second option. That's because the max value amounts to a wait time of a little over 24 days. If someone is prepared to wait that long for an HTTP request to complete, it is probably safe to assume that they are willing to wait forever.

review: Needs Fixing

« Back to merge proposal