summaryrefslogtreecommitdiff
path: root/code/ecp/core.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2018-03-27 04:36:22 +0200
committerUros Majstorovic <majstor@majstor.org>2018-03-27 04:36:22 +0200
commit9ed7686b336eed7672d91ec4b2180e5d48a3fe80 (patch)
treebe0ad92f70dd75b93ad29a60feb1fbe9696b2343 /code/ecp/core.c
parentef64f315409a23e6698f536e96ef56113ddff798 (diff)
fixed timeuouts/retries
Diffstat (limited to 'code/ecp/core.c')
-rw-r--r--code/ecp/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/code/ecp/core.c b/code/ecp/core.c
index 549c403..ae348ac 100644
--- a/code/ecp/core.c
+++ b/code/ecp/core.c
@@ -679,7 +679,7 @@ static ssize_t _conn_send_open(ECPConnection *conn, ECPTimerItem *ti) {
}
ssize_t ecp_conn_send_open(ECPConnection *conn) {
- return ecp_timer_send(conn, _conn_send_open, ECP_MTYPE_OPEN_REP, 1, 500);
+ return ecp_timer_send(conn, _conn_send_open, ECP_MTYPE_OPEN_REP, 3, 500);
}
int ecp_conn_handle_new(ECPSocket *sock, ECPConnection *parent, unsigned char *payload, size_t payload_size, ECPConnection **_conn) {
@@ -743,7 +743,7 @@ ssize_t ecp_conn_handle_open(ECPConnection *conn, ecp_seq_t seq, unsigned char m
pthread_mutex_lock(&conn->mutex);
#endif
int is_open = ecp_conn_is_open(conn);
- if (!is_open) conn->flags |= ECP_CONN_FLAG_OPEN;
+ if (!is_open && (size >= 0)) conn->flags |= ECP_CONN_FLAG_OPEN;
#ifdef ECP_WITH_PTHREAD
pthread_mutex_unlock(&conn->mutex);
#endif