OSSP CVS Repository

ossp - Check-in [844]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 844
Date: 2001-Sep-04 17:44:48 (local)
2001-Sep-04 15:44:48 (UTC)
User:rse
Branch:
Comment: Whohooo, now we can simplify output channels: because output channels are guarrantied to be not on top of other channels, they do not have any downstream channels. So remove all downstream handling from them. Only filter channels have to be aware of downstream channels.
Tickets:
Inspections:
Files:
ossp-pkg/l2/l2_ch_file.c      1.10 -> 1.11     0 inserted, 25 deleted
ossp-pkg/l2/l2_ch_socket.c      1.8 -> 1.9     0 inserted, 25 deleted
ossp-pkg/l2/l2_ch_syslog.c      1.10 -> 1.11     0 inserted, 25 deleted

ossp-pkg/l2/l2_ch_file.c 1.10 -> 1.11

--- l2_ch_file.c 2001/09/04 15:41:17     1.10
+++ l2_ch_file.c 2001/09/04 15:44:48     1.11
@@ -88,7 +88,6 @@
 static int hook_open(l2_context_t *ctx, l2_channel_t *ch)
 {
     l2_ch_file_t *cfg;
-    l2_channel_t *downstream;
     int mode;
 
     /* parameter checks */
@@ -104,11 +103,6 @@
     if ((cfg->fd = open(cfg->path, mode, cfg->perm)) == -1)
         return L2_ERROR;
 
-    /* optionally open downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_open(downstream) == L2_ERROR)
-            return L2_ERROR;
-
     return L2_OK;
 }
 
@@ -117,7 +111,6 @@
                       const char *buf, size_t buf_size)
 {
     l2_ch_file_t *cfg;
-    l2_channel_t *downstream;
 
     /* parameter checks */
     if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL)
@@ -129,26 +122,14 @@
     if (write(cfg->fd, buf, buf_size) == -1)
         return L2_ERROR;
 
-    /* optionally write to downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_write(downstream, buf, buf_size) == L2_ERROR)
-            return L2_ERROR;
-
     return L2_OK;
 }
 
 /* flush channel */
 static int hook_flush(l2_context_t *ctx, l2_channel_t *ch)
 {
-    l2_channel_t *downstream;
-
     /* NOP for this channel, because Unix I/O files are unbuffered! */
 
-    /* optionally flush downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_flush(downstream) == L2_ERROR)
-            return L2_ERROR;
-
     return L2_OK;
 }
 
@@ -156,12 +137,6 @@
 static int hook_close(l2_context_t *ctx, l2_channel_t *ch)
 {
     l2_ch_file_t *cfg;
-    l2_channel_t *downstream;
-
-    /* optionally close downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_close(downstream) == L2_ERROR)
-            return L2_ERROR;
 
     /* parameter checks */
     if ((cfg = (l2_ch_file_t *)ctx->vp) == NULL)


ossp-pkg/l2/l2_ch_socket.c 1.8 -> 1.9

--- l2_ch_socket.c       2001/09/04 15:41:17     1.8
+++ l2_ch_socket.c       2001/09/04 15:44:48     1.9
@@ -141,7 +141,6 @@
     struct hostent      *pHostentry;
     struct sockaddr_in  IP4Sockaddr;
     struct sockaddr_in6 IP6Sockaddr;
-    l2_channel_t *downstream;
 
     /* parameter checks */
     if ((cfg = (l2_ch_socket_t *)ctx->vp) == NULL)
@@ -188,11 +187,6 @@
         return L2_ERROR;
     }
 
-    /* optionally open downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_open(downstream) == L2_ERROR)
-            return L2_ERROR;
-
     return L2_OK;
 }
 
@@ -201,7 +195,6 @@
                       const char *buf, size_t buf_size)
 {
     l2_ch_socket_t *cfg;
-    l2_channel_t *downstream;
 
     /* parameter checks */
     if ((cfg = (l2_ch_socket_t *)ctx->vp) == NULL)
@@ -213,26 +206,14 @@
     if (send(cfg->iSocket, buf, buf_size, 0) == -1)
         return L2_ERROR;
 
-    /* optionally write to downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_write(downstream, buf, buf_size) == L2_ERROR)
-            return L2_ERROR;
-
     return L2_OK;
 }
 
 /* flush channel */
 static int hook_flush(l2_context_t *ctx, l2_channel_t *ch)
 {
-    l2_channel_t *downstream;
-
     /* NOP for this channel, because Unix I/O sockets are unbuffered! */
 
-    /* optionally flush downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_flush(downstream) == L2_ERROR)
-            return L2_ERROR;
-
     return L2_OK;
 }
 
@@ -240,12 +221,6 @@
 static int hook_close(l2_context_t *ctx, l2_channel_t *ch)
 {
     l2_ch_socket_t *cfg;
-    l2_channel_t *downstream;
-
-    /* optionally close downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_close(downstream) == L2_ERROR)
-            return L2_ERROR;
 
     /* parameter checks */
     if ((cfg = (l2_ch_socket_t *)ctx->vp) == NULL)


ossp-pkg/l2/l2_ch_syslog.c 1.10 -> 1.11

--- l2_ch_syslog.c       2001/09/04 15:41:17     1.10
+++ l2_ch_syslog.c       2001/09/04 15:44:48     1.11
@@ -90,7 +90,6 @@
 static int hook_open(l2_context_t *ctx, l2_channel_t *ch)
 {
     l2_ch_syslog_t *cfg;
-    l2_channel_t *downstream;
 
     /* parameter checks */
     if ((cfg = (l2_ch_syslog_t *)ctx->vp) == NULL)
@@ -100,11 +99,6 @@
     openlog(cfg->pszIdent, cfg->iLogopt, cfg->iFacility);
     setlogmask(cfg->iMaskpri);
 
-    /* optionally open downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_open(downstream) == L2_ERROR)
-            return L2_ERROR;
-
     return L2_OK;
 }
 
@@ -113,7 +107,6 @@
                       const char *buf, size_t buf_size)
 {
     l2_ch_syslog_t *cfg;
-    l2_channel_t *downstream;
 
     /* parameter checks */
     if ((cfg = (l2_ch_syslog_t *)ctx->vp) == NULL)
@@ -122,26 +115,14 @@
     /* write message to channel syslog */
     syslog(cfg->iPriority, buf);
 
-    /* optionally write to downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_write(downstream, buf, buf_size) == L2_ERROR)
-            return L2_ERROR;
-
     return L2_OK;
 }
 
 /* flush channel */
 static int hook_flush(l2_context_t *ctx, l2_channel_t *ch)
 {
-    l2_channel_t *downstream;
-
     /* Noop for this channel, because syslog entries are unbuffered */
 
-    /* optionally flush downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_flush(downstream) == L2_ERROR)
-            return L2_ERROR;
-
     return L2_OK;
 }
 
@@ -149,12 +130,6 @@
 static int hook_close(l2_context_t *ctx, l2_channel_t *ch)
 {
     l2_ch_syslog_t *cfg;
-    l2_channel_t *downstream;
-
-    /* optionally close downstream channel, too */
-    if ((downstream = l2_channel_downstream(ch)) != NULL)
-        if (l2_channel_close(downstream) == L2_ERROR)
-            return L2_ERROR;
 
     /* parameter checks */
     if ((cfg = (l2_ch_syslog_t *)ctx->vp) == NULL)

CVSTrac 2.0.1