fix bug: when convert buf to string , should use string(buf,size)
add lock_client