Skip to content

Commit

Permalink
Bugfix to HttpUpstreamGateway
Browse files Browse the repository at this point in the history
It contains a finite loop that keeps trying to send an event on a socket, but
would not exit the loop when the sending succeeds, resulting in repeated
events.
  • Loading branch information
sylvainhalle committed May 28, 2020
1 parent 33a64a4 commit be9702c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Http/src/ca/uqac/lif/cep/http/HttpUpstreamGateway.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,15 @@ protected boolean compute(Object[] inputs, Queue<Object[]> outputs) throws Proce
* called as a result of a push.
*/
String payload = (String) inputs[0];
boolean success = false;
if (m_pushMethod == Method.POST)
{
for (int i = 0; i < s_numRetries; i++)
for (int i = 0; i < s_numRetries && !success; i++)
{
try
{
HttpGateway.sendPost(m_pushUrl, payload);
success = true;
}
catch (ConnectException ce)
{
Expand Down

0 comments on commit be9702c

Please sign in to comment.