Commit 7c34e20a authored by Juergen Kosel's avatar Juergen Kosel

Merge branch 'test4issue373' into 373

* test4issue373:
  Add log output for failed message queueing in test due to disconnect
  Add trace output to verify that reducing the tcp send buffer forces TCPSOCKET_INTERRUPTED
  Reduce the tcp snd buffer to provocate issue #385
  Move the evaluation of the not freed memory _after_ call of MQTTAsync_destroy()
  Fix Windows build of test_issue373 and increase number of iterations
  Consider any not freed memory as test failure
  Modified number of connect iterations and messages send per second
  Moved the decrement of pendingMessageCnt to another call back function
  Add test for issue #373 and #385
  Add skeleton of test_issue373
parents f5aeca49 1f36a313
...@@ -532,6 +532,12 @@ int Socket_putdatas(int socket, char* buf0, size_t buf0len, int count, char** bu ...@@ -532,6 +532,12 @@ int Socket_putdatas(int socket, char* buf0, size_t buf0len, int count, char** bu
} }
} }
exit: exit:
#if 1
if (rc == TCPSOCKET_INTERRUPTED)
{
Log(LOG_ERROR, -1, "Socket_putdatas: TCPSOCKET_INTERRUPTED");
}
#endif
FUNC_EXIT_RC(rc); FUNC_EXIT_RC(rc);
return rc; return rc;
} }
...@@ -707,6 +713,13 @@ int Socket_new(char* addr, int port, int* sock) ...@@ -707,6 +713,13 @@ int Socket_new(char* addr, int port, int* sock)
if (setsockopt(*sock, SOL_SOCKET, SO_NOSIGPIPE, (void*)&opt, sizeof(opt)) != 0) if (setsockopt(*sock, SOL_SOCKET, SO_NOSIGPIPE, (void*)&opt, sizeof(opt)) != 0)
Log(LOG_ERROR, -1, "Could not set SO_NOSIGPIPE for socket %d", *sock); Log(LOG_ERROR, -1, "Could not set SO_NOSIGPIPE for socket %d", *sock);
#endif #endif
#if 1
{
int optsend = 2 * 1440;
if (setsockopt(*sock, SOL_SOCKET, SO_SNDBUF, (void*)&optsend, sizeof(optsend)) != 0)
Log(LOG_ERROR, -1, "Could not set SO_SNDBUF for socket %d", *sock);
}
#endif
Log(TRACE_MIN, -1, "New socket %d for %s, port %d", *sock, addr, port); Log(TRACE_MIN, -1, "New socket %d for %s, port %d", *sock, addr, port);
if (Socket_addSocket(*sock) == SOCKET_ERROR) if (Socket_addSocket(*sock) == SOCKET_ERROR)
......
...@@ -449,3 +449,13 @@ SET_TESTS_PROPERTIES( ...@@ -449,3 +449,13 @@ SET_TESTS_PROPERTIES(
test9-6-offline-buffering-max-buffered-binary-will test9-6-offline-buffering-max-buffered-binary-will
PROPERTIES TIMEOUT 540 PROPERTIES TIMEOUT 540
) )
ADD_EXECUTABLE(
test_issue373
test_issue373.c
)
TARGET_LINK_LIBRARIES(
test_issue373
paho-mqtt3a
)
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment