~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/plugin_ms.cc

  • Committer: Brian Aker
  • Date: 2010-12-07 09:12:12 UTC
  • mto: This revision was merged to the branch mainline in revision 1985.
  • Revision ID: brian@tangent.org-20101207091212-1m0w20tck6z7632m
This is a fix for bug lp:686197

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
#include "events_ms.h"
58
58
static PBMSEvents *pbms_events= NULL;
59
59
 
 
60
 
60
61
extern int pbms_init_func(module::Context &registry);
61
 
 
62
 
static void init_options(module::option_context &context)
 
62
extern struct drizzled::drizzle_sys_var* pbms_system_variables[];
 
63
 
 
64
extern uint32_t pbms_port_number;
 
65
 
 
66
static void init_options(drizzled::module::option_context &context)
63
67
{
64
 
        PBMSParameters::initOptions(context);
 
68
  context("port",
 
69
          po::value<uint32_t>(&pbms_port_number)->default_value(DEFAULT_PBMS_PORT),
 
70
          N_("Port number to use for connection or 0 for default PBMS port "));
65
71
}
66
72
 
 
73
 
67
74
static int my_init(module::Context &context)
68
75
{
69
76
        int rtc;
70
 
 
71
 
        PBMSParameters::startUp(context);
 
77
        const module::option_map &vm= context.getOptions();
 
78
 
 
79
        if (vm.count("port"))
 
80
        {
 
81
          if (pbms_port_number > 65535)
 
82
          {
 
83
            errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid port number\n"));
 
84
            return(-1);
 
85
          }
 
86
        }
 
87
 
 
88
        PBMSParameters::startUp();
72
89
        rtc = pbms_init_func(context);
73
90
        if (rtc == 0) {
74
91
                pbms_events = new PBMSEvents();
87
104
        "The Media Stream daemon for Drizzle",
88
105
        PLUGIN_LICENSE_GPL,
89
106
        my_init, /* Plugin Init */
90
 
        NULL,          /* system variables                */
 
107
        pbms_system_variables,          /* system variables                */
91
108
        init_options                                            /* config options                  */
92
109
}
93
110
DRIZZLE_DECLARE_PLUGIN_END;
125
142
#endif //DRIZZLED
126
143
 
127
144
 
128
 
// vim:noexpandtab:sts=8:sw=8:tabstop=8:smarttab: