Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 0d94058

Browse files
committed
remove retrive cookies from middleware
1 parent 2f952a3 commit 0d94058

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import com.owncloud.android.lib.common.http.HttpClient;
3939
import com.owncloud.android.lib.common.http.HttpConstants;
4040
import com.owncloud.android.lib.common.http.methods.HttpBaseMethod;
41+
import com.owncloud.android.lib.common.http.methods.nonwebdav.HttpMethod;
4142
import com.owncloud.android.lib.common.network.RedirectionPath;
4243
import com.owncloud.android.lib.common.utils.RandomUtils;
4344
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
@@ -113,14 +114,17 @@ public int executeHttpMethod(HttpBaseMethod method) throws Exception {
113114
if (mCredentials.getHeaderAuth() != null && method.getRequestHeader(AUTHORIZATION_HEADER) == null) {
114115
method.setRequestHeader(AUTHORIZATION_HEADER, mCredentials.getHeaderAuth());
115116
}
117+
118+
status = method.execute();
119+
stacklog(status, method);
120+
/*
116121
synchronized (mHoldRequests) {
117122
while (mHoldRequests) {
118123
while (true) {
119124
try {
120-
((String) null).toString();
125+
throw new Exception("Stack log");
121126
} catch (Exception e) {
122-
Log.d("+++++++",
123-
"HATL BEFORE" +
127+
Timber.d( "HATL BEFORE" +
124128
"\nThread: " + Thread.currentThread().getName() +
125129
"\nobject: " + this.toString() +
126130
"\nMethod: " + method.getHttpUrl() +
@@ -134,10 +138,9 @@ public int executeHttpMethod(HttpBaseMethod method) throws Exception {
134138
mHoldRequests = true;
135139
while (mHoldRequests) {
136140
try {
137-
((String) null).toString();
141+
throw new Exception("Stack log");
138142
} catch (Exception e) {
139-
Log.d("+++++++",
140-
"HALT AFTER" +
143+
Timber.d( "HALT AFTER" +
141144
"\nresponsecode: " + Integer.toString(status) +
142145
"\nThread: " + Thread.currentThread().getName() +
143146
"\nobject: " + this.toString() +
@@ -147,7 +150,9 @@ public int executeHttpMethod(HttpBaseMethod method) throws Exception {
147150
Thread.sleep(40000);
148151
}
149152
}
153+
150154
}
155+
*/
151156

152157
if (mFollowRedirects) {
153158
status = followRedirection(method).getLastStatus();
@@ -162,6 +167,21 @@ public int executeHttpMethod(HttpBaseMethod method) throws Exception {
162167
return status;
163168
}
164169

170+
private void stacklog(int status, HttpBaseMethod method) {
171+
try {
172+
throw new Exception("Stack log");
173+
} catch(Exception e) {
174+
Timber.d("\n---------------------------" +
175+
"\nresponsecode: " + status +
176+
"\nThread: " + Thread.currentThread().getName() +
177+
"\nobject: " + this.toString() +
178+
"\nMethod: " + method.toString() +
179+
"\nUrl: " + method.getHttpUrl() +
180+
"\ntrace: " + ExceptionUtils.getStackTrace(e) +
181+
"---------------------------");
182+
}
183+
}
184+
165185
private int executeRedirectedHttpMethod(HttpBaseMethod method) throws Exception {
166186
boolean repeatWithFreshCredentials;
167187
int repeatCounter = 0;

owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,9 @@ public class OwnCloudClientFactory {
4242
*/
4343
public static OwnCloudClient createOwnCloudClient(Uri uri, Context context, boolean followRedirects) {
4444
OwnCloudClient client = new OwnCloudClient(uri);
45-
4645
client.setFollowRedirects(followRedirects);
47-
4846
HttpClient.setContext(context);
49-
retrieveCookiesFromMiddleware(client);
5047

5148
return client;
5249
}
53-
54-
private static void retrieveCookiesFromMiddleware(OwnCloudClient client) {
55-
final GetRemoteStatusOperation statusOperation = new GetRemoteStatusOperation();
56-
statusOperation.run(client);
57-
}
5850
}

0 commit comments

Comments
 (0)