[tarantool-patches] Re: [PATCH 3/3] box/lua/console: Verify remote protocol for compatibility

Konstantin Osipov kostja at tarantool.org
Fri Jul 12 23:49:04 MSK 2019


* Konstantin Osipov <kostja at tarantool.org> [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




More information about the Tarantool-patches mailing list