aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2020-06-21 15:32:31 +0200
committerToni Uhlig <matzeton@googlemail.com>2020-06-21 15:32:31 +0200
commit46305df5903270d9b63652a1ce5fae2ee861a0e4 (patch)
tree9270c8e8697afd2d6451524e8c59e992029c4641 /server.c
parent8cfdfdc4dec97710ae52aa8fb5efa5d162811114 (diff)
added RECV_FATAL_CALLBACK_ERROR for callback specific failured, RECV_FATAL is for internal failures
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'server.c')
-rw-r--r--server.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/server.c b/server.c
index 5e1558d..7247371 100644
--- a/server.c
+++ b/server.c
@@ -68,16 +68,16 @@ enum recv_return protocol_request_client_auth(struct connection * const state,
log_bin2hex_sodium(NOTICE, "Client AUTH with PublicKey", auth_pkt->client_publickey, sizeof(auth_pkt->client_publickey));
if (init_crypto_server(state, auth_pkt->server_rx_header, sizeof(auth_pkt->server_rx_header)) != 0) {
LOG(ERROR, "Client session keypair generation failed");
- return RECV_FATAL;
+ return RECV_FATAL_CRYPTO_ERROR;
}
if (ev_protocol_server_helo(state, "Welcome.") != 0) {
LOG(ERROR, "Server AUTH response failed");
- return RECV_FATAL;
+ return RECV_FATAL_CALLBACK_ERROR;
}
if (ev_setup_generic_timer((struct ev_user_data *)state->user_data, PING_INTERVAL) != 0) {
LOG(ERROR, "Timer init failed");
- return RECV_FATAL;
+ return RECV_FATAL_CALLBACK_ERROR;
}
state->state = CONNECTION_AUTH_SUCCESS;
@@ -108,7 +108,7 @@ enum recv_return protocol_request_data(struct connection * const state,
recv_data(data_pkt->payload, data_pkt->header.body_size);
snprintf(response, sizeof(response), "DATA OK: RECEIVED %u BYTES", data_pkt->header.body_size);
if (ev_protocol_data(state, (uint8_t *)response, sizeof(response)) != 0) {
- return RECV_FATAL;
+ return RECV_FATAL_CALLBACK_ERROR;
}
return RECV_SUCCESS;
}
@@ -130,7 +130,7 @@ enum recv_return protocol_request_ping(struct connection * const state,
}
if (ev_protocol_pong(state) != 0) {
- return RECV_FATAL;
+ return RECV_FATAL_CALLBACK_ERROR;
} else {
return RECV_SUCCESS;
}