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 8A5BC25E5F for ; Fri, 12 Jul 2019 16:49:06 -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 36yAKGf6FxW6 for ; Fri, 12 Jul 2019 16:49:06 -0400 (EDT) Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) (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 488D5257D0 for ; Fri, 12 Jul 2019 16:49:06 -0400 (EDT) Date: Fri, 12 Jul 2019 23:49:04 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 3/3] box/lua/console: Verify remote protocol for compatibility Message-ID: <20190712204904.GA32340@atlas> References: <20190712190438.32349-1-gorcunov@gmail.com> <20190712190438.32349-4-gorcunov@gmail.com> <20190712204719.GC31930@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190712204719.GC31930@atlas> 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 * Konstantin Osipov [19/07/12 23:47]: > > +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? Moreover, shouldn't the output setting affect only the local server output, but not subsequent console.connect() calls? -- Konstantin Osipov, Moscow, Russia