~codership/galera/3.x

« back to all changes in this revision

Viewing changes to gcomm/src/protonet.cpp

  • Committer: Alexey Yurchenko
  • Date: 2014-02-06 19:27:50 UTC
  • mfrom: (153.2.15 2.x)
  • Revision ID: alexey.yurchenko@codership.com-20140206192750-n9to0wtjevl69gok
Tags: release_25.3.3(percona)
References lp:1260193 - all supported parameters are now registered before parsing the initial options string, so unrecognized options can be detected.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2009 Codership Oy <info@codership.com>
 
2
 * Copyright (C) 2009-2014 Codership Oy <info@codership.com>
3
3
 *
4
4
 * $Id$
5
5
 */
61
61
 
62
62
gcomm::Protonet* gcomm::Protonet::create(gu::Config& conf)
63
63
{
64
 
#ifdef HAVE_ASIO_HPP
65
 
    static const std::string& default_backend("asio");
66
 
#endif // HAVE_ASIO_HPP
67
 
    const std::string backend(conf.get(Conf::ProtonetBackend, default_backend));
68
 
    conf.set(Conf::ProtonetBackend, backend);
69
 
 
70
 
    const int version(conf.get<int>(Conf::ProtonetVersion, 0));
71
 
    conf.set(Conf::ProtonetVersion, version);
 
64
    const std::string backend(conf.get(Conf::ProtonetBackend));
 
65
    const int version(conf.get<int>(Conf::ProtonetVersion));
72
66
 
73
67
    if (version > max_version_)
74
68
    {
76
70
    }
77
71
 
78
72
    log_info << "protonet " << backend << " version " << version;
79
 
#ifdef HAVE_ASIO_HPP
 
73
 
80
74
    if (backend == "asio")
81
75
        return new AsioProtonet(conf, version);
82
 
#else
83
 
#error "No protonet backends defined"
84
 
#endif /* HAVE_ASIO_HPP */
 
76
 
85
77
    gu_throw_fatal << Conf::ProtonetBackend << " '" << backend
86
78
                   << "' not supported"; throw;
 
79
 
87
80
    return 0; // keep compiler happy
88
81
}