mirror of datapipe.c