apps/vm/components/helloworld/src/hello.c
/*
    vchantests_funnel:
        Recieve a an entire buffer, that is sent by the client in chunks
        We should block until the client is finished writing everything
        Process is then repeated in reverse
*/
Recieve a an entire buffer, that is sent by the client in chunks
We should block until the client is finished writing everything
Process is then repeated in reverse
Recieve a an entire buffer that is sent by the client in chunks We should block until the client is finished writing everything Process is then repeated in reverse
int vchantests_funnel(libvchan_t *ctrl) {
    int sz, count;
    libvchan_recv(ctrl, &sz, sizeof(int));
    char *buffer, c;
    buffer = malloc(sz);
    assert(buffer);
    libvchan_wait(ctrl);
    assert(libvchan_data_ready(ctrl) > 0);
    libvchan_recv(ctrl, buffer, sz);
    assert(libvchan_data_ready(ctrl) == 0);
    c = 0;
    for(count = 0; count != sz; count++) {
        assert(buffer[count] == c);
        c++;
    }
    DHELL("funnel: ok buffer :), writing back\n");
    for(count = 0; count < sz; count++) {
        libvchan_send(ctrl, &(buffer[count]), sizeof(char));
    }
    return 0;
}
int vchantests_funnel ( libvchan_t * ctrl ) { int sz , count ; libvchan_recv ( ctrl , & sz , sizeof ( int ) ) ; char * buffer , c ; buffer = malloc ( sz ) ; assert ( buffer ) ; libvchan_wait ( ctrl ) ; assert ( libvchan_data_ready ( ctrl ) > 0 ) ; libvchan_recv ( ctrl , buffer , sz ) ; assert ( libvchan_data_ready ( ctrl ) == 0 ) ; c = 0 ; for ( count = 0 ; count != sz ; count ++ ) { assert ( buffer [ count ] == c ) ; c ++ ; } DHELL ( " \n " ) ; for ( count = 0 ; count < sz ; count ++ ) { libvchan_send ( ctrl , & ( buffer [ count ] ) , sizeof ( char ) ) ; } return 0 ; }
vchantests_funnel:
Recieve a an entire buffer, that is sent by the client in chunks
We should block until the client is finished writing everything
Process is then repeated in reverse
vchantests_funnel : Recieve a an entire buffer that is sent by the client in chunks We should block until the client is finished writing everything Process is then repeated in reverse