diff options
Diffstat (limited to 'lib/odbc/src')
-rw-r--r-- | lib/odbc/src/Makefile | 2 | ||||
-rw-r--r-- | lib/odbc/src/odbc.appup.src | 2 | ||||
-rw-r--r-- | lib/odbc/src/odbc.erl | 13 | ||||
-rw-r--r-- | lib/odbc/src/odbc_app.erl | 2 | ||||
-rw-r--r-- | lib/odbc/src/odbc_internal.hrl | 2 | ||||
-rw-r--r-- | lib/odbc/src/odbc_sup.erl | 2 |
6 files changed, 14 insertions, 9 deletions
diff --git a/lib/odbc/src/Makefile b/lib/odbc/src/Makefile index 51c9ed3d5c..7ca59495ed 100644 --- a/lib/odbc/src/Makefile +++ b/lib/odbc/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1999-2012. All Rights Reserved. +# Copyright Ericsson AB 1999-2016. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/odbc/src/odbc.appup.src b/lib/odbc/src/odbc.appup.src index 3580fe21b8..8aa0770013 100644 --- a/lib/odbc/src/odbc.appup.src +++ b/lib/odbc/src/odbc.appup.src @@ -1,7 +1,7 @@ %% -*- erlang -*- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2014. All Rights Reserved. +%% Copyright Ericsson AB 2014-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/odbc/src/odbc.erl b/lib/odbc/src/odbc.erl index 4901821e9c..8871acd3f4 100644 --- a/lib/odbc/src/odbc.erl +++ b/lib/odbc/src/odbc.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2013. All Rights Reserved. +%% Copyright Ericsson AB 1999-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -26,6 +26,8 @@ -include("odbc_internal.hrl"). +-define(ODBC_PORT_TIMEOUT, 5000). + %% API -------------------------------------------------------------------- -export([start/0, start/1, stop/0, @@ -523,10 +525,10 @@ handle_msg({connect, ODBCCmd, AutoCommitMode, SrollableCursors}, NewState = State#state{auto_commit_mode = AutoCommitMode, scrollable_cursors = SrollableCursors}, - case gen_tcp:accept(ListenSocketSup, 5000) of + case gen_tcp:accept(ListenSocketSup, port_timeout()) of {ok, SupSocket} -> gen_tcp:close(ListenSocketSup), - case gen_tcp:accept(ListenSocketOdbc, 5000) of + case gen_tcp:accept(ListenSocketOdbc, port_timeout()) of {ok, OdbcSocket} -> gen_tcp:close(ListenSocketOdbc), odbc_send(OdbcSocket, ODBCCmd), @@ -831,7 +833,7 @@ connect(ConnectionReferense, ConnectionStr, Options) -> odbc_send(Socket, Msg) -> %% Note currently all allowed messages are lists NewMsg = Msg ++ [?STR_TERMINATOR], ok = gen_tcp:send(Socket, NewMsg), - inet:setopts(Socket, [{active, once}]). + ok = inet:setopts(Socket, [{active, once}]). %%-------------------------------------------------------------------------- connection_config(Key, Options) -> @@ -983,3 +985,6 @@ string_terminate_value(Binary) when is_binary(Binary) -> <<Binary/binary,0:16>>; string_terminate_value(null) -> null. + +port_timeout() -> + application:get_env(?MODULE, port_timeout, ?ODBC_PORT_TIMEOUT). diff --git a/lib/odbc/src/odbc_app.erl b/lib/odbc/src/odbc_app.erl index cbc4d325ad..0a6d1ee5df 100644 --- a/lib/odbc/src/odbc_app.erl +++ b/lib/odbc/src/odbc_app.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/odbc/src/odbc_internal.hrl b/lib/odbc/src/odbc_internal.hrl index 0e0ed18a0f..2968c6ba54 100644 --- a/lib/odbc/src/odbc_internal.hrl +++ b/lib/odbc/src/odbc_internal.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2011. All Rights Reserved. +%% Copyright Ericsson AB 2002-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/lib/odbc/src/odbc_sup.erl b/lib/odbc/src/odbc_sup.erl index 96f0886f88..6a87160321 100644 --- a/lib/odbc/src/odbc_sup.erl +++ b/lib/odbc/src/odbc_sup.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. |