} else {
orig = Uri.create(httpTransactionContext.getRequest().getUri(),
httpTransactionContext.getLastRedirectURI());
}
httpTransactionContext.setLastRedirectURI(redirectURL);
Request requestToSend;
Uri uri = Uri.create(orig, redirectURL);
if (!uri.toUrl().equalsIgnoreCase(orig.toUrl())) {
requestToSend = EventHandler.newRequest(uri, responsePacket, httpTransactionContext,
sendAsGet(responsePacket, httpTransactionContext));
} else {
httpTransactionContext.setStatusHandler(null);
httpTransactionContext.setInvocationStatus(CONTINUE);
try {
httpTransactionContext.getHandler().onStatusReceived(httpTransactionContext.getResponseStatus());
} catch (Exception e) {
httpTransactionContext.abort(e);
}
return true;
}
final ConnectionManager m = httpTransactionContext.getProvider().getConnectionManager();
try {
final Connection c = m.obtainConnection(requestToSend, httpTransactionContext.getFuture());
final HttpTxContext newContext = httpTransactionContext.copy();
httpTransactionContext.setFuture(null);
newContext.setInvocationStatus(CONTINUE);
newContext.setRequest(requestToSend);
newContext.setRequestUri(requestToSend.getUri());
HttpTxContext.set(ctx, newContext);
httpTransactionContext.getProvider().execute(c, requestToSend, newContext.getHandler(), newContext.getFuture(), newContext);
return false;
} catch (Exception e) {
httpTransactionContext.abort(e);