 #    send state.worker, {:error, self(), what}
     {:stop, "NATS err: #{inspect(what)}", %{state | state: :error}}
   end
-  defp check_auth(state,
+  defp check_auth(_state,
                   json_received = %{},
                   json_to_send = %{}, auth_opts = %{}) do
     server_want_auth = json_received["auth_required"] || false

    send state.worker, {:msg, sub, sid, ret, body}
    {:noreply, state}
  end
  defp nats_pub(state = %{state: :connected}, sub, ret, body) do
#    debug_log state, ["received PUB", sub, ret, body]
    {:noreply, state}
  end
  defp nats_unsub(state = %{state: :connected}, sid, howMany) do
#    debug_log state, ["received UNSUB", sid, howMany]
    {:noreply, state}
  end
end

          {:noreply, ns } -> handle_packet(ns, rest)
          other -> other
        end
      {:cont, _howmany, nps} ->
#        debug_log state, ["partial packet", howmany]
        {:noreply, %{state | ps: nps}}
      other -> nats_err(state, "invalid parser result: #{inspect(other)}")
