Check-in Number:
|
933 | |
Date: |
2001-Sep-11 13:59:59 (local)
2001-Sep-11 11:59:59 (UTC) |
User: | rse |
Branch: | |
Comment: |
fix channel destruction in case of channel stacks |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/l2/l2_ch_buffer.c 1.17 -> 1.18
--- l2_ch_buffer.c 2001/09/06 16:10:05 1.17
+++ l2_ch_buffer.c 2001/09/11 11:59:59 1.18
@@ -175,6 +175,8 @@
static l2_result_t hook_destroy(l2_context_t *ctx, l2_channel_t *ch)
{
l2_ch_buffer_t *cfg = (l2_ch_buffer_t *)ctx->vp;
+ l2_channel_t *downstream = l2_channel_downstream(ch);
+ l2_result_t rv;
/* if not already closed, close channel buffer now */
if (cfg->buf != NULL) {
@@ -185,6 +187,10 @@
/* destroy channel configuration */
free(cfg);
+ /* optionally destroy downstream channel, too */
+ if ((rv = l2_channel_destroy(downstream)) != L2_OK)
+ return rv;
+
return L2_OK;
}
|
|
ossp-pkg/l2/l2_ch_prefix.c 1.10 -> 1.11
--- l2_ch_prefix.c 2001/09/06 16:10:05 1.10
+++ l2_ch_prefix.c 2001/09/11 11:59:59 1.11
@@ -119,6 +119,8 @@
static l2_result_t hook_destroy(l2_context_t *ctx, l2_channel_t *ch)
{
l2_ch_prefix_t *cfg = (l2_ch_prefix_t *)ctx->vp;
+ l2_channel_t *downstream = l2_channel_downstream(ch);
+ l2_result_t rv;
/* free prefix structure */
if (cfg->timefmt != NULL)
@@ -127,6 +129,10 @@
free(cfg->timezone);
free(cfg);
+ /* optionally destroy downstream channel, too */
+ if ((rv = l2_channel_destroy(downstream)) != L2_OK)
+ return rv;
+
return L2_OK;
}
|
|