Index: ossp-pkg/sio/sio.c RCS File: /v/ossp/cvs/ossp-pkg/sio/sio.c,v rcsdiff -q -kk '-r1.15' '-r1.16' -u '/v/ossp/cvs/ossp-pkg/sio/sio.c,v' 2>/dev/null --- 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) { Index: ossp-pkg/sio/sio_bio.c RCS File: /v/ossp/cvs/ossp-pkg/sio/sio_bio.c,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/sio/sio_bio.c,v' 2>/dev/null --- 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; Index: ossp-pkg/sio/sio_buffer.c RCS File: /v/ossp/cvs/ossp-pkg/sio/sio_buffer.c,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/sio/sio_buffer.c,v' 2>/dev/null --- 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; Index: ossp-pkg/sio/sio_fd.c RCS File: /v/ossp/cvs/ossp-pkg/sio/sio_fd.c,v rcsdiff -q -kk '-r1.10' '-r1.11' -u '/v/ossp/cvs/ossp-pkg/sio/sio_fd.c,v' 2>/dev/null --- 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; Index: ossp-pkg/sio/sio_hello.c RCS File: /v/ossp/cvs/ossp-pkg/sio/sio_hello.c,v rcsdiff -q -kk '-r1.10' '-r1.11' -u '/v/ossp/cvs/ossp-pkg/sio/sio_hello.c,v' 2>/dev/null --- 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); } Index: ossp-pkg/sio/sio_hole.c RCS File: /v/ossp/cvs/ossp-pkg/sio/sio_hole.c,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/sio/sio_hole.c,v' 2>/dev/null --- 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); Index: ossp-pkg/sio/sio_null.c RCS File: /v/ossp/cvs/ossp-pkg/sio/sio_null.c,v rcsdiff -q -kk '-r1.7' '-r1.8' -u '/v/ossp/cvs/ossp-pkg/sio/sio_null.c,v' 2>/dev/null --- 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; } Index: ossp-pkg/sio/sio_sa.c RCS File: /v/ossp/cvs/ossp-pkg/sio/sio_sa.c,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/sio/sio_sa.c,v' 2>/dev/null --- 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; Index: ossp-pkg/sio/sio_sio.c RCS File: /v/ossp/cvs/ossp-pkg/sio/sio_sio.c,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/sio/sio_sio.c,v' 2>/dev/null --- 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); } Index: ossp-pkg/sio/sio_zlib.c RCS File: /v/ossp/cvs/ossp-pkg/sio/sio_zlib.c,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/sio/sio_zlib.c,v' 2>/dev/null --- 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;