]> granicus.if.org Git - ejabberd/commitdiff
* src/mod_proxy65/mod_proxy65_lib.erl: Send protocol compliant
authorBadlop <badlop@process-one.net>
Thu, 24 Jul 2008 18:03:28 +0000 (18:03 +0000)
committerBadlop <badlop@process-one.net>
Thu, 24 Jul 2008 18:03:28 +0000 (18:03 +0000)
SOCKS5 reply; this breaks support of uncompliant Psi<0.10 (thanks
to Felix Geyer)(EJAB-632)
* src/mod_proxy65/mod_proxy65_stream.erl: Likewise

SVN Revision: 1488

ChangeLog
src/mod_proxy65/mod_proxy65_lib.erl
src/mod_proxy65/mod_proxy65_stream.erl

index 317dc3dab155e7f7a38e3615e7f3c4c3015a3d9d..f8538030c1317cf8b5e73188c0b65f960ec786ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-07-24  Badlop  <badlop@process-one.net>
 
+       * src/mod_proxy65/mod_proxy65_lib.erl: Send protocol compliant
+       SOCKS5 reply; this breaks support of uncompliant Psi<0.10 (thanks
+       to Felix Geyer)(EJAB-632)
+       * src/mod_proxy65/mod_proxy65_stream.erl: Likewise
+
        * src/mod_register.erl: When a registration is blocked due to IP
        limitation, return description in error stanza (EJAB-692)
 
index 8e30bb4a652eb44f11e46c4bfb0fea39a9b14c23..490ef047914541e3a02ac51c45225df274fcd588 100644 (file)
@@ -35,7 +35,7 @@
         unpack_request/1,
         make_init_reply/1,
         make_auth_reply/1,
-        make_reply/0,
+        make_reply/1,
         make_error_reply/1,
         make_error_reply/2
        ]).
@@ -73,12 +73,8 @@ make_init_reply(Method) ->
 make_auth_reply(true) -> [1, ?SUCCESS];
 make_auth_reply(false) -> [1, ?ERR_NOT_ALLOWED].
 
-%% WARNING: According to SOCKS5 RFC, this reply is _incorrect_, but
-%% Psi writes junk to the beginning of the file on correct reply.
-%% I'm not sure, but there may be an issue with other clients.
-%% Needs more testing.
-make_reply() ->
-    [?VERSION_5, ?SUCCESS, 0, 0, 0, 0].
+make_reply(#s5_request{rsv = RSV, sha1 = SHA1}) ->
+    [?VERSION_5, ?SUCCESS, RSV, ?ATYP_DOMAINNAME, length(SHA1), SHA1, 0,0].
 
 make_error_reply(Request) ->
     make_error_reply(Request, ?ERR_NOT_ALLOWED).
index 046ac8e71fb5712c5fa4a98d40b03bb5c055dcfe..230e2a7b3b07997a94a2a014dd707959284df145 100644 (file)
@@ -172,7 +172,7 @@ wait_for_request(Packet, #state{socket=Socket} = StateData) ->
            case catch mod_proxy65_sm:register_stream(SHA1) of
                {atomic, ok} ->
                    inet:setopts(Socket, [{active, false}]),
-                   gen_tcp:send(Socket, mod_proxy65_lib:make_reply()),
+                   gen_tcp:send(Socket, mod_proxy65_lib:make_reply(Request)),
                    {next_state, wait_for_activation, StateData#state{sha1=SHA1}};
                _ ->
                    Err = mod_proxy65_lib:make_error_reply(Request),