From ce0d1bfdfa5bfd06a006729c6794a27016f86813 Mon Sep 17 00:00:00 2001 From: idk Date: Tue, 24 Nov 2020 13:09:52 -0500 Subject: [PATCH 1/2] FORWARD is different from CONNECT and ACCEPT --- src/libsam3/libsam3.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libsam3/libsam3.c b/src/libsam3/libsam3.c index 5bb6988..ba3585f 100644 --- a/src/libsam3/libsam3.c +++ b/src/libsam3/libsam3.c @@ -1096,13 +1096,11 @@ int sam3StreamForward(Sam3Session *ses, const char *hostname, int port) { strcpyerr(ses, "IO_ERROR_RP"); goto error; } - if (!ses->silent){ - if (!sam3IsGoodReply(rep, "STREAM", "STATUS", "RESULT", "OK")) { - const char *v = sam3FindField(rep, "RESULT"); - // - strcpyerr(ses, (v != NULL && v[0] ? v : "I2P_ERROR_RES")); - goto error; - } + if (!sam3IsGoodReply(rep, "STREAM", "STATUS", "RESULT", "OK")) { + const char *v = sam3FindField(rep, "RESULT"); + // + strcpyerr(ses, (v != NULL && v[0] ? v : "I2P_ERROR_RES")); + goto error; } sam3FreeFieldList(rep); strcpyerr(ses, NULL); From 3f14a30065573a0b91f87afb09348a9e6d400f12 Mon Sep 17 00:00:00 2001 From: idk Date: Tue, 24 Nov 2020 13:12:07 -0500 Subject: [PATCH 2/2] clang-fmt --- src/libsam3/libsam3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsam3/libsam3.c b/src/libsam3/libsam3.c index ba3585f..5a64580 100644 --- a/src/libsam3/libsam3.c +++ b/src/libsam3/libsam3.c @@ -959,7 +959,7 @@ Sam3Connection *sam3StreamConnect(Sam3Session *ses, const char *destkey) { strcpyerr(ses, "IO_ERROR"); goto error; } - if (!ses->silent){ + if (!ses->silent) { if (!sam3IsGoodReply(rep, "STREAM", "STATUS", "RESULT", "OK")) { const char *v = sam3FindField(rep, "RESULT"); // @@ -1018,7 +1018,7 @@ Sam3Connection *sam3StreamAccept(Sam3Session *ses) { strcpyerr(ses, "IO_ERROR_RP"); goto error; } - if (!ses->silent){ + if (!ses->silent) { if (!sam3IsGoodReply(rep, "STREAM", "STATUS", "RESULT", "OK")) { const char *v = sam3FindField(rep, "RESULT"); //