OSSP CVS Repository

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

Check-in Number: 2930
Date: 2002-Nov-29 14:00:18 (local)
2002-Nov-29 13:00:18 (UTC)
User:mlelstv
Branch:
Comment: input/output now gets another parameter where scheduler tells them from where they methods called by passing the return value of the previously called stage.

PR: Submitted by: Reviewed by: Approved by: Obtained from:

Tickets:
Inspections:
Files:
ossp-pkg/sio/sio.c      1.15 -> 1.16     1 inserted, 1 deleted
ossp-pkg/sio/sio_bio.c      1.5 -> 1.6     2 inserted, 2 deleted
ossp-pkg/sio/sio_buffer.c      1.7 -> 1.8     2 inserted, 2 deleted
ossp-pkg/sio/sio_fd.c      1.10 -> 1.11     2 inserted, 2 deleted
ossp-pkg/sio/sio_hello.c      1.10 -> 1.11     2 inserted, 2 deleted
ossp-pkg/sio/sio_hole.c      1.6 -> 1.7     2 inserted, 2 deleted
ossp-pkg/sio/sio_null.c      1.7 -> 1.8     2 inserted, 2 deleted
ossp-pkg/sio/sio_sa.c      1.5 -> 1.6     2 inserted, 2 deleted
ossp-pkg/sio/sio_sio.c      1.1 -> 1.2     50 inserted, 22 deleted
ossp-pkg/sio/sio_zlib.c      1.2 -> 1.3     2 inserted, 2 deleted

ossp-pkg/sio/sio.c 1.15 -> 1.16

--- sio.c        2002/11/28 16:39:40     1.15
+++ sio.c        2002/11/29 13:00:18     1.16
@@ -134,7 +134,7 @@
     rc = SIO_SCHED_UP;
     h  = chain;
     while (h != NULL) {
-        rc = h->func(sio, h->al, h->stage->userdata);
+        rc = h->func(sio, h->al, h->stage->userdata, rc);
 
         /* chose default direction */
         if (rc == SIO_OK) {


ossp-pkg/sio/sio_bio.c 1.5 -> 1.6

--- sio_bio.c    2002/11/27 15:50:29     1.5
+++ sio_bio.c    2002/11/29 13:00:18     1.6
@@ -505,7 +505,7 @@
 }
 
 static
-sio_rc_t siobio_input(sio_t *sio, al_t *al, void *u)
+sio_rc_t siobio_input(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
     sio_rc_t rc;
@@ -529,7 +529,7 @@
 }
 
 static
-sio_rc_t siobio_output(sio_t *sio, al_t *al, void *u)
+sio_rc_t siobio_output(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
     sio_rc_t rc;


ossp-pkg/sio/sio_buffer.c 1.7 -> 1.8

--- sio_buffer.c 2002/11/27 15:50:29     1.7
+++ sio_buffer.c 2002/11/29 13:00:18     1.8
@@ -172,7 +172,7 @@
 }
 
 static
-sio_rc_t buffer_input(sio_t *sio, al_t *al, void *u)
+sio_rc_t buffer_input(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
 
@@ -180,7 +180,7 @@
 }
 
 static
-sio_rc_t buffer_output(sio_t *sio, al_t *al, void *u)
+sio_rc_t buffer_output(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
 


ossp-pkg/sio/sio_fd.c 1.10 -> 1.11

--- sio_fd.c     2002/11/27 15:50:29     1.10
+++ sio_fd.c     2002/11/29 13:00:18     1.11
@@ -154,7 +154,7 @@
 }
 
 static
-al_rc_t fd_output_chunk(al_chunk_t *alc, void *u)
+al_rc_t fd_output_chunk(al_chunk_t *alc, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
     char   *p;
@@ -174,7 +174,7 @@
 }
 
 static
-sio_rc_t fd_output(sio_t *sio, al_t *al, void *u)
+sio_rc_t fd_output(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
     al_rc_t arc;


ossp-pkg/sio/sio_hello.c 1.10 -> 1.11

--- sio_hello.c  2002/11/27 15:50:29     1.10
+++ sio_hello.c  2002/11/29 13:00:18     1.11
@@ -391,13 +391,13 @@
 /************************************************************************/
 
 static
-sio_rc_t hello_input(sio_t *sio, al_t *al, void *u)
+sio_rc_t hello_input(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     return hello_protocol(sio, (private_t *)u, 0);
 }
 
 static
-sio_rc_t hello_output(sio_t *sio, al_t *al, void *u)
+sio_rc_t hello_output(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     return hello_protocol(sio, (private_t *)u, 1);
 }


ossp-pkg/sio/sio_hole.c 1.6 -> 1.7

--- sio_hole.c   2002/11/27 15:50:29     1.6
+++ sio_hole.c   2002/11/29 13:00:18     1.7
@@ -76,7 +76,7 @@
 }
 
 static
-sio_rc_t hole_input(sio_t *sio, al_t *al, void *u)
+sio_rc_t hole_input(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     /* drop all data into the bit bucket */
     al_splice(al, 0, al_bytes(al), NULL, NULL);
@@ -85,7 +85,7 @@
 }
 
 static
-sio_rc_t hole_output(sio_t *sio, al_t *al, void *u)
+sio_rc_t hole_output(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     /* drop all data into the bit bucket */
     al_splice(al, 0, al_bytes(al), NULL, NULL);


ossp-pkg/sio/sio_null.c 1.7 -> 1.8

--- sio_null.c   2002/11/27 15:50:29     1.7
+++ sio_null.c   2002/11/29 13:00:18     1.8
@@ -86,13 +86,13 @@
 }
 
 static
-sio_rc_t null_input(sio_t *sio, al_t *al, void *u)
+sio_rc_t null_input(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     return SIO_OK;
 }
 
 static
-sio_rc_t null_output(sio_t *sio, al_t *al, void *u)
+sio_rc_t null_output(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     return SIO_OK;
 }


ossp-pkg/sio/sio_sa.c 1.5 -> 1.6

--- sio_sa.c     2002/11/27 15:50:29     1.5
+++ sio_sa.c     2002/11/29 13:00:18     1.6
@@ -147,7 +147,7 @@
 }
 
 static
-sio_rc_t saw_input(sio_t *sio, al_t *al, void *u)
+sio_rc_t saw_input(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
     buffer_t *buf = &my->input;
@@ -189,7 +189,7 @@
 }
 
 static
-sio_rc_t saw_output(sio_t *sio, al_t *al, void *u)
+sio_rc_t saw_output(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
     al_rc_t arc;


ossp-pkg/sio/sio_sio.c 1.1 -> 1.2

--- sio_sio.c    2002/11/28 17:45:15     1.1
+++ sio_sio.c    2002/11/29 13:00:19     1.2
@@ -8,7 +8,9 @@
 
 typedef struct {
     sio_t      *upstream;
-    al_label_t  label;
+    al_label_t  my_data_label;
+    al_label_t  my_eof_label;
+    al_label_t  my_error_label;
     al_label_t  data_label;
     al_label_t  eof_label;
     al_label_t  error_label;
@@ -29,9 +31,11 @@
     if (my == NULL)
         return SIO_ERR_MEM;
 
-    my->upstream = NULL;
-    my->label    = NULL;
-    my->eof      = '\0';
+    my->upstream         = NULL;
+    my->my_data_label    = NULL;
+    my->my_error_label   = NULL;
+    my->my_eof_label     = NULL;
+    my->eof              = '\0';
 
     sio_label(sio, SIO_LN_DATA,  &my->data_label);
     sio_label(sio, SIO_LN_ERROR, &my->error_label);
@@ -55,8 +59,12 @@
 
     if (!strcmp(name, "upstream")) {
         my->upstream = (sio_t *)val;
-    } else if (!strcmp(name, "label")) {
-        my->label = (al_label_t)val;
+    } else if (!strcmp(name, "mydatalabel")) {
+        my->my_data_label = (al_label_t)val;
+    } else if (!strcmp(name, "myerrorlabel")) {
+        my->my_error_label = (al_label_t)val;
+    } else if (!strcmp(name, "myeoflabel")) {
+        my->my_eof_label = (al_label_t)val;
     } else {
         return SIO_ERR_ARG;
     }
@@ -82,8 +90,7 @@
 {
     private_t *my = (private_t *)u;
 
-    if (my->upstream == NULL ||
-        my->label    == NULL)
+    if (my->upstream == NULL)
         return SIO_ERR_ARG;
 
     return SIO_OK;
@@ -100,8 +107,7 @@
 {
     private_t *my = (private_t *)u;
 
-    if (my->upstream == NULL ||
-        my->label    == NULL)
+    if (my->upstream == NULL)
         return SIO_ERR_ARG;
 
     return SIO_OK;
@@ -114,32 +120,54 @@
 }
 
 static
-sio_rc_t siosio_input(sio_t *sio, al_t *al, void *u)
+sio_rc_t siosio_input(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
 
     if (al_bytes(al) == 0) {
-        sio_input(my->upstream, al, SIZE_T_MAX, my->label);
-        if (al_bytes(al) > 0) {
-            if (my->label != my->data_label)
-                al_setlabel(al, 0, al_bytes(al), my->label, my->data_label);
-        } else
-            al_append_bytes(al, &my->eof, sizeof(my->eof), my->eof_label);
+        if (my->my_data_label != NULL) {
+            sio_input(my->upstream, al, SIZE_T_MAX, my->my_data_label);
+            if (my->my_data_label != my->data_label)
+                al_setlabel(al, 0, al_bytes(al),
+                            my->my_data_label, my->data_label);
+        }
+
+        if (my->my_error_label != NULL) {
+            sio_input(my->upstream, al, SIZE_T_MAX, my->my_error_label);
+            if (my->my_error_label != my->error_label)
+                al_setlabel(al, 0, al_bytes(al),
+                            my->my_error_label, my->error_label);
+        }
+
+        if (my->my_eof_label != NULL) {
+            sio_input(my->upstream, al, SIZE_T_MAX, my->my_eof_label);
+            if (my->my_eof_label != my->eof_label)
+                al_setlabel(al, 0, al_bytes(al),
+                            my->my_eof_label, my->eof_label);
+        }
     }
 
     return SIO_SCHED_DOWN;
 }
 
 static
-sio_rc_t siosio_output(sio_t *sio, al_t *al, void *u)
+sio_rc_t siosio_output(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
 
     if (al_bytes(al) > 0) {
-        /* recolor data */
-        if (my->label != my->data_label)
-            al_setlabel(al, 0, al_bytes(al), my->data_label, my->label);
-        /* send out */
+        if (my->my_data_label != NULL && my->my_data_label != my->data_label)
+            al_setlabel(al, 0, al_bytes(al),
+                        my->data_label, my->my_data_label);
+
+        if (my->my_error_label != NULL && my->my_error_label != my->error_label)
+            al_setlabel(al, 0, al_bytes(al),
+                        my->error_label, my->my_error_label);
+
+        if (my->my_eof_label != NULL && my->my_eof_label != my->eof_label)
+            al_setlabel(al, 0, al_bytes(al),
+                        my->eof_label, my->my_eof_label);
+
         /* XXX error handling ? */
         sio_output(my->upstream, al);
     }


ossp-pkg/sio/sio_zlib.c 1.2 -> 1.3

--- sio_zlib.c   2002/11/27 13:18:36     1.2
+++ sio_zlib.c   2002/11/29 13:00:19     1.3
@@ -305,7 +305,7 @@
 }
 
 static
-sio_rc_t zlib_input(sio_t *sio, al_t *al, void *u)
+sio_rc_t zlib_input(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
 
@@ -313,7 +313,7 @@
 }
 
 static
-sio_rc_t zlib_output(sio_t *sio, al_t *al, void *u)
+sio_rc_t zlib_output(sio_t *sio, al_t *al, void *u, sio_rc_t orc)
 {
     private_t *my = (private_t *)u;
 

CVSTrac 2.0.1