Skip to content

Commit 8623304

Browse files
authored
FORWARD is different from CONNECT and ACCEPT (#14)
2 parents 749519a + 3f14a30 commit 8623304

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/libsam3/libsam3.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ Sam3Connection *sam3StreamConnect(Sam3Session *ses, const char *destkey) {
959959
strcpyerr(ses, "IO_ERROR");
960960
goto error;
961961
}
962-
if (!ses->silent){
962+
if (!ses->silent) {
963963
if (!sam3IsGoodReply(rep, "STREAM", "STATUS", "RESULT", "OK")) {
964964
const char *v = sam3FindField(rep, "RESULT");
965965
//
@@ -1018,7 +1018,7 @@ Sam3Connection *sam3StreamAccept(Sam3Session *ses) {
10181018
strcpyerr(ses, "IO_ERROR_RP");
10191019
goto error;
10201020
}
1021-
if (!ses->silent){
1021+
if (!ses->silent) {
10221022
if (!sam3IsGoodReply(rep, "STREAM", "STATUS", "RESULT", "OK")) {
10231023
const char *v = sam3FindField(rep, "RESULT");
10241024
//
@@ -1096,13 +1096,11 @@ int sam3StreamForward(Sam3Session *ses, const char *hostname, int port) {
10961096
strcpyerr(ses, "IO_ERROR_RP");
10971097
goto error;
10981098
}
1099-
if (!ses->silent){
1100-
if (!sam3IsGoodReply(rep, "STREAM", "STATUS", "RESULT", "OK")) {
1101-
const char *v = sam3FindField(rep, "RESULT");
1102-
//
1103-
strcpyerr(ses, (v != NULL && v[0] ? v : "I2P_ERROR_RES"));
1104-
goto error;
1105-
}
1099+
if (!sam3IsGoodReply(rep, "STREAM", "STATUS", "RESULT", "OK")) {
1100+
const char *v = sam3FindField(rep, "RESULT");
1101+
//
1102+
strcpyerr(ses, (v != NULL && v[0] ? v : "I2P_ERROR_RES"));
1103+
goto error;
11061104
}
11071105
sam3FreeFieldList(rep);
11081106
strcpyerr(ses, NULL);

0 commit comments

Comments
 (0)