Skip to content

Commit

Permalink
[proto_tls] fix events not being traced in case of tls error
Browse files Browse the repository at this point in the history
  • Loading branch information
ionutrazvanionita committed Mar 21, 2017
1 parent aafbdf1 commit 6fb06a6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/proto_tls/proto_tls.c
Expand Up @@ -490,6 +490,7 @@ static int proto_tls_send(struct socket_info* send_sock,

static int tls_read_req(struct tcp_connection* con, int* bytes_read)
{
int ret;
int bytes;
int total_bytes;
struct tcp_req* req;
Expand All @@ -508,10 +509,8 @@ static int tls_read_req(struct tcp_connection* con, int* bytes_read)
req=&tls_current_req;
}

if (tls_fix_read_conn(con)!=0) {
LM_ERR("failed to do pre-tls reading\n");
goto error;
}
/* do this trick in order to trace whether if it's an error or not */
ret=tls_fix_read_conn(con);

if ( con->proto_flags & F_TLS_TRACE_READY ) {
data = con->proto_data;
Expand All @@ -528,6 +527,11 @@ static int tls_read_req(struct tcp_connection* con, int* bytes_read)
con->proto_flags &= ~( F_TLS_TRACE_READY );
}

if ( ret != 0 ) {
LM_ERR("failed to do pre-tls reading\n");
goto error;
}

if(con->state!=S_CONN_OK)
goto done; /* not enough data */

Expand Down

0 comments on commit 6fb06a6

Please sign in to comment.