Client: fixed write_data by chunks.