bugfix: spipe double free readed chunk.
remove replicated code
fix compiler error.
remove unnecessary code in pipe.c