38
38
import com .owncloud .android .lib .common .http .HttpClient ;
39
39
import com .owncloud .android .lib .common .http .HttpConstants ;
40
40
import com .owncloud .android .lib .common .http .methods .HttpBaseMethod ;
41
+ import com .owncloud .android .lib .common .http .methods .nonwebdav .HttpMethod ;
41
42
import com .owncloud .android .lib .common .network .RedirectionPath ;
42
43
import com .owncloud .android .lib .common .utils .RandomUtils ;
43
44
import com .owncloud .android .lib .resources .status .OwnCloudVersion ;
@@ -113,14 +114,17 @@ public int executeHttpMethod(HttpBaseMethod method) throws Exception {
113
114
if (mCredentials .getHeaderAuth () != null && method .getRequestHeader (AUTHORIZATION_HEADER ) == null ) {
114
115
method .setRequestHeader (AUTHORIZATION_HEADER , mCredentials .getHeaderAuth ());
115
116
}
117
+
118
+ status = method .execute ();
119
+ stacklog (status , method );
120
+ /*
116
121
synchronized (mHoldRequests) {
117
122
while (mHoldRequests) {
118
123
while (true) {
119
124
try {
120
- (( String ) null ). toString ( );
125
+ throw new Exception("Stack log" );
121
126
} catch (Exception e) {
122
- Log .d ("+++++++" ,
123
- "HATL BEFORE" +
127
+ Timber.d( "HATL BEFORE" +
124
128
"\nThread: " + Thread.currentThread().getName() +
125
129
"\nobject: " + this.toString() +
126
130
"\nMethod: " + method.getHttpUrl() +
@@ -134,10 +138,9 @@ public int executeHttpMethod(HttpBaseMethod method) throws Exception {
134
138
mHoldRequests = true;
135
139
while (mHoldRequests) {
136
140
try {
137
- (( String ) null ). toString ( );
141
+ throw new Exception("Stack log" );
138
142
} catch (Exception e) {
139
- Log .d ("+++++++" ,
140
- "HALT AFTER" +
143
+ Timber.d( "HALT AFTER" +
141
144
"\nresponsecode: " + Integer.toString(status) +
142
145
"\nThread: " + Thread.currentThread().getName() +
143
146
"\nobject: " + this.toString() +
@@ -147,7 +150,9 @@ public int executeHttpMethod(HttpBaseMethod method) throws Exception {
147
150
Thread.sleep(40000);
148
151
}
149
152
}
153
+
150
154
}
155
+ */
151
156
152
157
if (mFollowRedirects ) {
153
158
status = followRedirection (method ).getLastStatus ();
@@ -162,6 +167,21 @@ public int executeHttpMethod(HttpBaseMethod method) throws Exception {
162
167
return status ;
163
168
}
164
169
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
+ "\n responsecode: " + status +
176
+ "\n Thread: " + Thread .currentThread ().getName () +
177
+ "\n object: " + this .toString () +
178
+ "\n Method: " + method .toString () +
179
+ "\n Url: " + method .getHttpUrl () +
180
+ "\n trace: " + ExceptionUtils .getStackTrace (e ) +
181
+ "---------------------------" );
182
+ }
183
+ }
184
+
165
185
private int executeRedirectedHttpMethod (HttpBaseMethod method ) throws Exception {
166
186
boolean repeatWithFreshCredentials ;
167
187
int repeatCounter = 0 ;
0 commit comments