aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ssh/client.c11
-rw-r--r--ssh/tomsg_clientlib.c2
2 files changed, 3 insertions, 10 deletions
diff --git a/ssh/client.c b/ssh/client.c
index fbf4c1d..3fe0869 100644
--- a/ssh/client.c
+++ b/ssh/client.c
@@ -485,19 +485,14 @@ static enum tomsg_retval connect_server(
struct tomsg_async_connect_event event;
ret = tomsg_async_connect_next_event(async, &event);
if (ret == TOMSG_ERR_AGAIN) continue;
- if (ret != TOMSG_OK) {
- fprintf(stderr, "next_event returned %d\n", ret);
- return ret;
- }
+ if (ret != TOMSG_OK) return ret;
switch (event.type) {
case TOMSG_AC_HOSTKEY:
ret = tomsg_async_connect_accept(async,
hostkey_checker(event.key.hostkey, event.key.length, stdinbuf));
- if (ret != TOMSG_OK) {
- fprintf(stderr, "connect_accept returned %d\n", ret);
- return ret;
- }
+ tomsg_async_connect_event_nullify(event);
+ if (ret != TOMSG_OK) return ret;
break;
case TOMSG_AC_SUCCESS:
diff --git a/ssh/tomsg_clientlib.c b/ssh/tomsg_clientlib.c
index 9c2d80a..fb783e3 100644
--- a/ssh/tomsg_clientlib.c
+++ b/ssh/tomsg_clientlib.c
@@ -518,14 +518,12 @@ free_return:
enum tomsg_retval tomsg_async_connect_accept(struct tomsg_async_connect *client, bool accept) {
enum tomsg_retval final_retval;
if (client->state != STATE_KEY_RECEIVED) {
- fprintf(stderr, "connect_accept: client->state = %d != STATE_KEY_RECEIVED\n", client->state);
final_retval = TOMSG_ERR_TRANSPORT; // shrug
goto free_return;
}
unsigned char byte = accept ? 1 : 0;
if (!writeall(client->host_w, &byte, 1)) {
- fprintf(stderr, "writeall failed: %s\n", strerror(errno));
goto non_recoverable_error;
}