Skip to content

Commit

Permalink
FORWARD is different from CONNECT and ACCEPT (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedeekay authored Nov 24, 2020
2 parents 749519a + 3f14a30 commit 8623304
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/libsam3/libsam3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
//
Expand Down Expand Up @@ -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");
//
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8623304

Please sign in to comment.