[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [obfsproxy/master] I decided against the stupid return game in socks{4, 5}_send_reply(). It had no use.
commit 0e37d9f8dabb35fff81ccb08466a2fb6f7e6588e
Author: George Kadianakis <desnacked@xxxxxxxxx>
Date: Tue May 24 01:21:33 2011 +0200
I decided against the stupid return game in socks{4,5}_send_reply(). It had no use.
---
src/socks.c | 12 ++----------
src/test/unittest_socks.c | 4 ++--
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/socks.c b/src/socks.c
index 5a97b83..6144e26 100644
--- a/src/socks.c
+++ b/src/socks.c
@@ -214,11 +214,7 @@ socks5_send_reply(struct evbuffer *reply_dest, socks_state_t *state,
state->state = ST_SENT_REPLY; /* SOCKS phase is now done. */
- if (status == SOCKS5_REP_SUCCESS) {
- return 1;
- } else {
- return -1;
- }
+ return 1;
}
/**
@@ -386,11 +382,7 @@ socks4_send_reply(struct evbuffer *dest, socks_state_t *state, int status)
memcpy(msg+4, &in.s_addr, 4);
evbuffer_add(dest, msg, 8);
- /* ASN: Do we actually like this return tactic? Check out why I do it. */
- if (status == SOCKS5_REP_SUCCESS)
- return 1;
- else
- return -1;
+ return 1;
}
/**
diff --git a/src/test/unittest_socks.c b/src/test/unittest_socks.c
index 510ede5..cc68528 100644
--- a/src/test/unittest_socks.c
+++ b/src/test/unittest_socks.c
@@ -347,7 +347,7 @@ test_socks_socks5_request_reply(void *data)
state->parsereq.af = AF_UNSPEC;
strcpy(state->parsereq.addr, fqdn);
- tt_int_op(-1, ==, socks5_send_reply(reply_dest,
+ tt_int_op(1, ==, socks5_send_reply(reply_dest,
state, SOCKS5_REP_FAIL));
uchar rep3[255];
@@ -557,7 +557,7 @@ test_socks_socks4_request_reply(void *data)
state->parsereq.af = AF_UNSPEC;
strcpy(state->parsereq.addr, fqdn);
- tt_int_op(-1, ==, socks4_send_reply(reply_dest,
+ tt_int_op(1, ==, socks4_send_reply(reply_dest,
state, SOCKS5_REP_FAIL));
uchar rep2[255];
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits