module Net::SCP::Upload

def send_data_state(channel)

Otherwise, sends a 0-byte and transfers to #next_item_state.
If any data remains to be transferred from the current file, sends it.
def send_data_state(channel)
  data = channel[:io].read(channel[:chunk_size])
  if data.nil?
    channel[:io].close unless channel[:local].respond_to?(:read)
    channel.send_data("\0")
    await_response(channel, :next_item)
  else
    channel[:sent] += data.length
    progress_callback(channel, channel[:name], channel[:sent], channel[:size])
    channel.send_data(data)
  end
end