mod_event_socket.patch
1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- freeswitch-1.0.6/src/mod/event_handlers/mod_event_socket/mod_event_socket.c 2010-04-07 02:05:28.000000000 +0800
+++ freeswitch-1.0.6/src/mod/event_handlers/mod_event_socket/mod_event_socket.c 2016-12-14 12:07:51.000000000 +0800
@@ -286,12 +286,14 @@ static void event_handler(switch_event_t
}
}
- if (send && l->filters && l->filters->headers) {
+ if (send){
+ switch_mutex_lock(l->filter_mutex);
+
+ if(l->filters && l->filters->headers) {
switch_event_header_t *hp;
const char *hval;
-
send = 0;
- switch_mutex_lock(l->filter_mutex);
+
for (hp = l->filters->headers; hp; hp = hp->next) {
if ((hval = switch_event_get_header(event, hp->name))) {
const char *comp_to = hp->value;
@@ -335,6 +337,7 @@ static void event_handler(switch_event_t
}
}
}
+ }
switch_mutex_unlock(l->filter_mutex);
}
@@ -1026,7 +1029,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_event_so
static switch_status_t read_packet(listener_t *listener, switch_event_t **event, uint32_t timeout)
{
switch_size_t mlen, bytes = 0;
- char mbuf[2048] = "";
+ char mbuf[4096] = "";
char buf[1024] = "";
switch_size_t len;
switch_status_t status = SWITCH_STATUS_SUCCESS;
@@ -1278,7 +1281,8 @@ static switch_status_t read_packet(liste
}
if (do_sleep) {
- switch_cond_next();
+ //switch_cond_next();
+ switch_micro_sleep(50000);
}
}