add resistance on blocking writes to stdout

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7363 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2008-01-25 23:09:33 +00:00
1 parent 62bcc9e0fc
commit a2d8262289
4 files changed
+127 -15

No files matched your search

+8 -3
View File
@@ -647,8 +647,13 @@ SWITCH_DECLARE(switch_status_t) switch_event_dup(switch_event_t **event, switch_
hp2 = (*event)->headers;
for (hp = todup->headers; hp; hp = hp->next) {
if ((header = ALLOC(sizeof(*header))) == 0) {
return SWITCH_STATUS_MEMERR;
void *pop;
if (switch_queue_trypop(EVENT_HEADER_RECYCLE_QUEUE, &pop) == SWITCH_STATUS_SUCCESS) {
header = (switch_event_header_t *) pop;
} else {
header = ALLOC(sizeof(*header));
switch_assert(header);
}
memset(header, 0, sizeof(*header));
@@ -662,7 +667,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_dup(switch_event_t **event, switch_
(*event)->headers = header;
}
last = header;
(*event)->last_header = last = header;
}
if (todup->body) {