fix fix_free_writebuf() and del out_buf
move *buf to global
add dummy_packet_send() function