From 83d95132068a41247109f40e1d3a215f1f328d5f Mon Sep 17 00:00:00 2001 From: Karchnu Date: Thu, 23 Jul 2020 19:39:58 +0200 Subject: [PATCH] Clients fixed. --- src/authd.cr | 4 ++-- utils/authd-user-ask-for-new-password.cr | 2 -- utils/authd-user-get.cr | 2 -- utils/authd-user-search.cr | 2 -- utils/authd-user-validate.cr | 2 -- 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/authd.cr b/src/authd.cr index deb7e2d..c28454d 100644 --- a/src/authd.cr +++ b/src/authd.cr @@ -410,7 +410,7 @@ module AuthD end def send(type : Request::Type, payload) - send @server_fd, type.value.to_u8, payload + send_now @server_fd, type.value.to_u8, payload end def decode_token(token) @@ -583,7 +583,7 @@ end class IPC::Client def send(request : AuthD::Request) unless (fd = @server_fd).nil? - send fd, request.type.to_u8, request.to_json + send_now fd, request.type.to_u8, request.to_json else raise "Client not connected to the server" end diff --git a/utils/authd-user-ask-for-new-password.cr b/utils/authd-user-ask-for-new-password.cr index 8911fe5..ebae596 100644 --- a/utils/authd-user-ask-for-new-password.cr +++ b/utils/authd-user-ask-for-new-password.cr @@ -28,8 +28,6 @@ OptionParser.parse do |parser| end begin - authd = IPC::Connection.new "auth" - authd = AuthD::Client.new authd.key = File.read(key_file.not_nil!).chomp diff --git a/utils/authd-user-get.cr b/utils/authd-user-get.cr index 3cee0aa..436f378 100644 --- a/utils/authd-user-get.cr +++ b/utils/authd-user-get.cr @@ -28,8 +28,6 @@ OptionParser.parse do |parser| end begin - authd = IPC::Connection.new "auth" - authd = AuthD::Client.new authd.key = File.read(key_file.not_nil!).chomp diff --git a/utils/authd-user-search.cr b/utils/authd-user-search.cr index f474b14..42dc698 100644 --- a/utils/authd-user-search.cr +++ b/utils/authd-user-search.cr @@ -28,8 +28,6 @@ OptionParser.parse do |parser| end begin - authd = IPC::Connection.new "auth" - authd = AuthD::Client.new # authd.key = File.read(key_file.not_nil!).chomp diff --git a/utils/authd-user-validate.cr b/utils/authd-user-validate.cr index d382849..039fa06 100644 --- a/utils/authd-user-validate.cr +++ b/utils/authd-user-validate.cr @@ -28,8 +28,6 @@ OptionParser.parse do |parser| end begin - authd = IPC::Connection.new "auth" - authd = AuthD::Client.new authd.key = File.read(key_file.not_nil!).chomp