~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to examples/server.cc

  • Committer: Brian Aker
  • Date: 2011-11-26 23:14:59 UTC
  • mto: This revision was merged to the branch mainline in revision 2465.
  • Revision ID: brian@tangent.org-20111126231459-pa9i3arizevf0vlr
Remove con from being passed object.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
  drizzle_verbose_t verbose= DRIZZLE_VERBOSE_NEVER;
72
72
  drizzle_return_t ret;
73
73
  drizzle_st *drizzle;
74
 
  drizzle_con_st *con_listen= (drizzle_con_st*)malloc(sizeof(drizzle_con_st));
75
 
  drizzle_con_st *con= (drizzle_con_st*)malloc(sizeof(drizzle_con_st));
76
74
  drizzle_result_st result;
77
75
  drizzle_column_st column;
78
76
 
141
139
  drizzle_set_option(drizzle, DRIZZLE_FREE_OBJECTS, true);
142
140
  drizzle_set_verbose(drizzle, verbose);
143
141
 
144
 
  if (drizzle_con_create(drizzle, con_listen) == NULL)
 
142
  drizzle_con_st* con_listen;
 
143
  if ((con_listen= drizzle_con_create(drizzle)) == NULL)
145
144
  {
146
145
    fprintf(stderr, "drizzle_con_create:NULL\n");
147
146
    return 1;
163
162
 
164
163
  while (1)
165
164
  {
166
 
    (void)drizzle_con_accept(drizzle, con, &ret);
 
165
    drizzle_con_st *con= drizzle_con_accept(drizzle, &ret);
167
166
    if (ret != DRIZZLE_RETURN_OK)
168
167
    {
169
168
      fprintf(stderr, "drizzle_con_accept:%s\n", drizzle_error(drizzle));
186
185
  drizzle_con_free(con_listen);
187
186
  drizzle_free(drizzle);
188
187
 
189
 
  free(con);
190
 
  free(con_listen);
191
 
 
192
188
  return 0;
193
189
}
194
190