Fixed infinite recursion due to method renaming.
This commit is contained in:
parent
b2c03b04f1
commit
9f86d36d6c
|
@ -182,9 +182,9 @@ public class HttpSender
|
|||
StatefulExecutorCallback callback = new StatefulExecutorCallback(client.getExecutor())
|
||||
{
|
||||
@Override
|
||||
protected void pendingCompleted()
|
||||
protected void onSucceeded()
|
||||
{
|
||||
LOG.debug("Write completed for {}", request);
|
||||
LOG.debug("Write succeeded for {}", request);
|
||||
|
||||
if (!commit(request))
|
||||
return;
|
||||
|
@ -215,7 +215,7 @@ public class HttpSender
|
|||
|
||||
write(callback, header, chunk, expect100 ? null : contentInfo.content);
|
||||
|
||||
if (callback.isPending())
|
||||
if (callback.process())
|
||||
{
|
||||
LOG.debug("Write pending for {}", request);
|
||||
return;
|
||||
|
@ -464,7 +464,7 @@ public class HttpSender
|
|||
State previous = state.get();
|
||||
while (true)
|
||||
{
|
||||
if (state.compareAndSet(previous, State.COMPLETE))
|
||||
if (state.compareAndSet(previous, State.SUCCEEDED))
|
||||
break;
|
||||
previous = state.get();
|
||||
}
|
||||
|
@ -475,10 +475,10 @@ public class HttpSender
|
|||
@Override
|
||||
public final void run()
|
||||
{
|
||||
pendingCompleted();
|
||||
onSucceeded();
|
||||
}
|
||||
|
||||
protected abstract void pendingCompleted();
|
||||
protected abstract void onSucceeded();
|
||||
|
||||
@Override
|
||||
public final void failed(final Throwable x)
|
||||
|
@ -497,26 +497,26 @@ public class HttpSender
|
|||
@Override
|
||||
public void run()
|
||||
{
|
||||
failed(x);
|
||||
onFailed(x);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
failed(x);
|
||||
onFailed(x);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void onFailed(Throwable x);
|
||||
|
||||
public boolean isPending()
|
||||
public boolean process()
|
||||
{
|
||||
return state.compareAndSet(State.INCOMPLETE, State.PENDING);
|
||||
}
|
||||
|
||||
public boolean isSucceeded()
|
||||
{
|
||||
return state.get() == State.COMPLETE;
|
||||
return state.get() == State.SUCCEEDED;
|
||||
}
|
||||
|
||||
public boolean isFailed()
|
||||
|
@ -526,7 +526,7 @@ public class HttpSender
|
|||
|
||||
private enum State
|
||||
{
|
||||
INCOMPLETE, PENDING, COMPLETE, FAILED
|
||||
INCOMPLETE, PENDING, SUCCEEDED, FAILED
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue