diff options
author | Henrik Nord <[email protected]> | 2014-09-30 09:42:52 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2014-09-30 09:42:52 +0200 |
commit | 6cfa8feeca6d01d230f1837a01b1f0ae706da457 (patch) | |
tree | a86047f3dd0ce7138f08068c1ace3809b116cfff /lib/ssh/src/ssh_transport.erl | |
parent | 585052c164623a227e7ae8112b2a023872672159 (diff) | |
parent | 88d5c0edbd08e069bc20cf13fa90bca59eb43e86 (diff) | |
download | otp-6cfa8feeca6d01d230f1837a01b1f0ae706da457.tar.gz otp-6cfa8feeca6d01d230f1837a01b1f0ae706da457.tar.bz2 otp-6cfa8feeca6d01d230f1837a01b1f0ae706da457.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/ssh/src/ssh_transport.erl')
-rw-r--r-- | lib/ssh/src/ssh_transport.erl | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl index ea05c849b7..76fa776113 100644 --- a/lib/ssh/src/ssh_transport.erl +++ b/lib/ssh/src/ssh_transport.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2004-2013. All Rights Reserved. +%% Copyright Ericsson AB 2004-2014. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -82,16 +82,21 @@ format_version({Major,Minor}) -> integer_to_list(Minor) ++ "-Erlang". handle_hello_version(Version) -> - StrVersion = trim_tail(Version), - case string:tokens(Version, "-") of - [_, "2.0" | _] -> - {{2,0}, StrVersion}; - [_, "1.99" | _] -> - {{2,0}, StrVersion}; - [_, "1.3" | _] -> - {{1,3}, StrVersion}; - [_, "1.5" | _] -> - {{1,5}, StrVersion} + try + StrVersion = trim_tail(Version), + case string:tokens(Version, "-") of + [_, "2.0" | _] -> + {{2,0}, StrVersion}; + [_, "1.99" | _] -> + {{2,0}, StrVersion}; + [_, "1.3" | _] -> + {{1,3}, StrVersion}; + [_, "1.5" | _] -> + {{1,5}, StrVersion} + end + catch + error:_ -> + {undefined, "unknown version"} end. key_exchange_init_msg(Ssh0) -> |