Skip to content

Commit 1d6f6c6

Browse files
drodilmrtazz
authored andcommitted
Remove duplicate FollowRedirects function (mrtazz#109)
Use default value for maxRedirects instead
1 parent bdf5335 commit 1d6f6c6

2 files changed

Lines changed: 4 additions & 17 deletions

File tree

include/restclient-cpp/connection.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,9 @@ class Connection {
138138
// set to not use signals
139139
void SetNoSignal(bool no);
140140

141-
// set whether to follow redirects
142-
void FollowRedirects(bool follow);
143-
144-
// set whether to follow redirects (-1 for unlimited)
145-
void FollowRedirects(bool follow, int maxRedirects);
141+
// set whether to follow redirects, maxRedirects indicitng the maximum
142+
// number of redirects to follow
143+
void FollowRedirects(bool follow, int maxRedirects = -1l);
146144

147145
// set custom user agent
148146
// (this will result in the UA "foo/cool restclient-cpp/VERSION")

source/connection.cc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,7 @@ RestClient::Connection::GetHeaders() {
118118
* @brief configure whether to follow redirects on this connection
119119
*
120120
* @param follow - boolean whether to follow redirects
121-
*/
122-
void
123-
RestClient::Connection::FollowRedirects(bool follow) {
124-
this->followRedirects = follow;
125-
this->maxRedirects = -1l;
126-
}
127-
128-
/**
129-
* @brief configure whether to follow redirects on this connection
130-
*
131-
* @param follow - boolean whether to follow redirects
132-
* @param maxRedirects - int indicating the maximum number of redirect to follow (-1 unlimited)
121+
* @param maxRedirects - int indicating the maximum number of redirect to follow (-1 unlimited, default)
133122
*/
134123
void
135124
RestClient::Connection::FollowRedirects(bool follow, int maxRedirects) {

0 commit comments

Comments
 (0)