Mercurial > hg > monetdb-java
changeset 836:aad275e042b2 monetdbs
Heed followRedirect
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Fri, 15 Dec 2023 11:05:16 +0100 (16 months ago) |
parents | 071be9a628e8 |
children | 5df67d5d7a7b |
files | src/main/java/org/monetdb/mcl/net/MapiSocket.java |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/org/monetdb/mcl/net/MapiSocket.java +++ b/src/main/java/org/monetdb/mcl/net/MapiSocket.java @@ -112,7 +112,12 @@ public final class MapiSocket { /** protocol version of the connection */ private int version; - /** Whether we should follow redirects */ + /** Whether we should follow redirects. + * Not sure why this needs to be separate + * from 'ttl' but someone someday explicitly documented setTtl + * with 'to disable completely, use followRedirects' so + * apparently there is a use case. + */ private boolean followRedirects = true; /** How many redirections do we follow until we're fed up with it? */ private int ttl = 10; @@ -316,7 +321,7 @@ public final class MapiSocket { if (!ok) close(); } - } while (attempts++ < this.ttl); + } while (followRedirects && attempts++ < this.ttl); throw new MCLException("max redirect count exceeded"); }