Skip to content

Commit

Permalink
foo: bar
Browse files Browse the repository at this point in the history
  • Loading branch information
bazsi committed Nov 11, 2024
1 parent dff7494 commit a2bc880
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 7 additions & 0 deletions lib/logproto/logproto-auto-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "logproto-framed-server.h"
#include "messages.h"

#include "transport/transport-haproxy.h"

enum
{
LPAS_FAILURE,
Expand Down Expand Up @@ -213,6 +215,11 @@ log_proto_auto_handshake(LogProtoServer *s, gboolean *handshake_finished, LogPro
break;
case LPAS_SUCCESS:
self->haproxy_detected = TRUE;

/* FIXME: make this a factory */
log_transport_stack_add_transport(&self->super.transport_stack, LOG_TRANSPORT_HAPROXY,
log_transport_haproxy_new(self->super.transport_stack.active_transport, self->super.transport_stack.active_transport));

/* this is a haproxy header */
if (log_transport_stack_switch(&self->super.transport_stack, LOG_TRANSPORT_HAPROXY))
{
Expand Down
2 changes: 1 addition & 1 deletion lib/transport/transport-factory-tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ _construct_transport(const LogTransportFactory *s, LogTransportStack *stack)

tls_session_set_verifier(tls_session, self->tls_verifier);

return log_transport_tls_new(tls_session, log_transport_stack_get_active(stack));
return log_transport_tls_new(tls_session, log_transport_stack_get_transport(stack, LOG_TRANSPORT_SOCKET));
}

void
Expand Down
8 changes: 1 addition & 7 deletions modules/afsocket/transport-mapper-inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,14 @@ transport_mapper_inet_setup_stack(TransportMapper *s, LogTransportStack *stack)
{
LogTransportIndex switch_to;

if (self->tls_context && !_is_tls_required(self))
if (self->tls_context)
switch_to = LOG_TRANSPORT_TLS;
else
switch_to = LOG_TRANSPORT_SOCKET;
if (!_setup_haproxy_transport(self, stack, initial_transport_index, switch_to))
return FALSE;
initial_transport_index = LOG_TRANSPORT_HAPROXY;
}
else
{
/* is this auto? */
if (!_setup_haproxy_transport(self, stack, initial_transport_index, LOG_TRANSPORT_NONE))
return FALSE;
}

if (!log_transport_stack_switch(stack, initial_transport_index))
g_assert_not_reached();
Expand Down

0 comments on commit a2bc880

Please sign in to comment.