Projects
Kolab:Winterfell
guam
0001-Fix-starttls.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Fix-starttls.patch of Package guam (Revision 76)
Currently displaying revision
76
,
Show latest
From b9d2dc3cf61556ec9652f434aed1ddfc6d77e62e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf <mollekopf@kolabsys.com> Date: Mon, 9 Nov 2020 13:21:47 +0100 Subject: [PATCH] Fix starttls Turns out there was a reason for set_socket_active. If starttls is used to upgrade the socket, then we need to use the ssl variant on the ssl socket. Otherwise the next packet will never be read and we just time out eventually. --- apps/kolab_guam/src/kolab_guam_session.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/kolab_guam/src/kolab_guam_session.erl b/apps/kolab_guam/src/kolab_guam_session.erl index 03d3214..0ea9b1b 100644 --- a/apps/kolab_guam/src/kolab_guam_session.erl +++ b/apps/kolab_guam/src/kolab_guam_session.erl @@ -72,7 +72,8 @@ handle_info({ tcp, Socket, Data }, #state{ client_tls_active = false } = State) % lager:debug("Data coming in from client over TCP ~s", [Data]), {Acc, NewState} = process_client_data(Socket, Data, State), forward_literal_data(Acc, NewState), - inet:setopts(Socket, [{ active, once }]), + %Required because of socket upgrade, in which case we will end up with the ssl variant here. + set_socket_active(NewState), { noreply, NewState }; handle_info({ ssl, Socket, Data }, State) -> @@ -172,6 +173,9 @@ update_split_command_state_client(ClientDataComponents, #state{ command_split_re update_split_command_state_client(_ClientDataComponents, _State) -> undefined. +set_socket_active(#state{ client_tls_active = true, socket = Socket}) -> ssl:setopts(Socket, [{ active, once }]); +set_socket_active(#state{ client_tls_active = false, socket = Socket}) -> inet:setopts(Socket, [{ active, once }]). + accept_client(#state{ client_implicit_tls = true, tls_config = TLSConfig, listen_socket = ListenSocket, super_pid = SupervisorPID }) -> AcceptSocket = accept_socket(ListenSocket, SupervisorPID), %% prep for the next listen -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.