From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id ABBF925E5A for ; Fri, 12 Jul 2019 16:47:22 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fYALNzSlMO5w for ; Fri, 12 Jul 2019 16:47:22 -0400 (EDT) Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 6C09A25879 for ; Fri, 12 Jul 2019 16:47:22 -0400 (EDT) Date: Fri, 12 Jul 2019 23:47:19 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 3/3] box/lua/console: Verify remote protocol for compatibility Message-ID: <20190712204719.GC31930@atlas> References: <20190712190438.32349-1-gorcunov@gmail.com> <20190712190438.32349-4-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190712190438.32349-4-gorcunov@gmail.com> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Cyrill Gorcunov Cc: tml , Alexander Turenko , Kirill Yukhin * Cyrill Gorcunov [19/07/12 22:08]: > +local function output_verify_remote(greeting) > + -- > + -- In case if remote peer is operating over > + -- old yaml protocol we are unable to decode > + -- it to non-yaml serializers. > + if greeting.protocol == 'Lua console' then > + local d = box.session.storage.console_output > + if d ~= nil and d["fmt"] == "lua" then > + local msg1 = "Peer uses deprecated '%s' protocol. " > + local msg2 = "Switch output to 'yaml' format to proceed." > + return false, msg1:format(greeting.protocol) .. msg2 > + end > + end > + return true, nil > +end what is the problem with doing yaml.load and serpent.encode for such peers? What if it's a new peer but using yaml output? -- Konstantin Osipov, Moscow, Russia