~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/gearman_udf/function_map.cc

  • Committer: Brian Aker
  • Date: 2009-06-09 22:40:20 UTC
  • mfrom: (971.3.46 eday-dev)
  • Revision ID: brian@gaz-20090609224020-o85u8iqqzgpth5sv
MergeĀ Eric

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
using namespace std;
21
21
 
 
22
/* Constructor and destructor happen during module dlopen/dlclose. */
22
23
static GearmanFunctionMap _functionMap;
23
24
 
24
25
GearmanFunctionMap& GetFunctionMap(void)
62
63
    }
63
64
  }
64
65
 
 
66
  /* Parse server strings in the format "host[:port][,host[:port]]..." */
65
67
  while (1)
66
68
  {
67
69
    end_pos= servers.find(',', begin_pos);
79
81
      host[port_pos]= 0;
80
82
    }
81
83
 
 
84
    /* For each host:port pair, add a server to the cloning object. */
82
85
    if (gearman_client_add_server(&(functionMap[function]), host.c_str(),
83
86
                                  port.size() == 0 ?
84
87
                                  0 : atoi(port.c_str())) != GEARMAN_SUCCESS)
114
117
    }
115
118
  }
116
119
 
 
120
  /* Clone the object, the list of host:port pairs get cloned with it. */
117
121
  if (gearman_client_clone(client, &((*x).second)) == NULL)
118
122
  {
119
123
    pthread_mutex_unlock(&lock);