mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-14 19:16:59 +00:00
FS-8761 #resolve [Memory leak in FreeSWITCH]
This commit is contained in:
parent
61c487c3e8
commit
1e7b4a1301
@ -1 +1 @@
|
|||||||
Wed Jul 27 14:15:49 CDT 2016
|
Sat Aug 6 11:48:53 CDT 2016
|
||||||
|
@ -461,6 +461,7 @@ int tport_ws_init_secondary(tport_t *self, int socket, int accepted,
|
|||||||
tport_ws_t *wstp = (tport_ws_t *)self;
|
tport_ws_t *wstp = (tport_ws_t *)self;
|
||||||
|
|
||||||
self->tp_has_connection = 1;
|
self->tp_has_connection = 1;
|
||||||
|
self->tp_params->tpp_keepalive = 5000;
|
||||||
|
|
||||||
/* override the default 30 minute timeout on tport connections */
|
/* override the default 30 minute timeout on tport connections */
|
||||||
self->tp_params->tpp_idle = UINT_MAX;
|
self->tp_params->tpp_idle = UINT_MAX;
|
||||||
@ -496,7 +497,7 @@ int tport_ws_init_secondary(tport_t *self, int socket, int accepted,
|
|||||||
wstp->ws_initialized = 1;
|
wstp->ws_initialized = 1;
|
||||||
self->tp_pre_framed = 1;
|
self->tp_pre_framed = 1;
|
||||||
|
|
||||||
|
tport_set_secondary_timer(self);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -592,6 +593,20 @@ int tport_ws_next_timer(tport_t *self,
|
|||||||
su_time_t *return_target,
|
su_time_t *return_target,
|
||||||
char const **return_why)
|
char const **return_why)
|
||||||
{
|
{
|
||||||
|
tport_ws_t *wstp = (tport_ws_t *)self;
|
||||||
|
|
||||||
|
if (establish_logical_layer(&wstp->ws) < 0) {
|
||||||
|
if (wstp->tos++ == 1) {
|
||||||
|
tport_close(self);
|
||||||
|
SU_DEBUG_7(("%s(%p): %s to " TPN_FORMAT "%s\n",
|
||||||
|
__func__, (void *)self,
|
||||||
|
"timeout establishing connection\n", TPN_ARGS(self->tp_name), ""));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
self->tp_params->tpp_keepalive = 30000;
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
tport_next_recv_timeout(self, return_target, return_why) |
|
tport_next_recv_timeout(self, return_target, return_why) |
|
||||||
tport_next_keepalive(self, return_target, return_why);
|
tport_next_keepalive(self, return_target, return_why);
|
||||||
|
@ -59,6 +59,7 @@ typedef struct tport_ws_s {
|
|||||||
char wstp_buffer[65536];
|
char wstp_buffer[65536];
|
||||||
size_t wstp_buflen;
|
size_t wstp_buflen;
|
||||||
SU_S8_T ws_initialized;
|
SU_S8_T ws_initialized;
|
||||||
|
unsigned char tos;
|
||||||
unsigned ws_secure:1;
|
unsigned ws_secure:1;
|
||||||
unsigned:0;
|
unsigned:0;
|
||||||
} tport_ws_t;
|
} tport_ws_t;
|
||||||
|
@ -500,7 +500,7 @@ static int restore_socket(ws_socket_t sock)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static int establish_logical_layer(wsh_t *wsh)
|
int establish_logical_layer(wsh_t *wsh)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!wsh->sanity) {
|
if (!wsh->sanity) {
|
||||||
|
@ -119,7 +119,7 @@ typedef struct wsh_s {
|
|||||||
ssize_t ws_send_buf(wsh_t *wsh, ws_opcode_t oc);
|
ssize_t ws_send_buf(wsh_t *wsh, ws_opcode_t oc);
|
||||||
ssize_t ws_feed_buf(wsh_t *wsh, void *data, size_t bytes);
|
ssize_t ws_feed_buf(wsh_t *wsh, void *data, size_t bytes);
|
||||||
|
|
||||||
|
int establish_logical_layer(wsh_t *wsh);
|
||||||
ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block);
|
ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block);
|
||||||
ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes);
|
ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes);
|
||||||
ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data);
|
ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user