~linuxjedi/libdrizzle/update-copyright-headers

« back to all changes in this revision

Viewing changes to libdrizzle/conn.cc

  • Committer: Brian Aker
  • Date: 2013-01-27 04:54:08 UTC
  • Revision ID: brian@tangent.org-20130127045408-dl2sfaq210o8akba
Remove the need for the inline functions around state, we just use the methods now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
227
227
  con->events= 0;
228
228
  con->revents= 0;
229
229
 
230
 
  drizzle_state_reset(con);
 
230
  con->clear_state();
231
231
}
232
232
 
233
233
drizzle_return_t drizzle_set_events(drizzle_st *con, short events)
680
680
    return DRIZZLE_RETURN_OK;
681
681
  }
682
682
 
683
 
  if (drizzle_state_none(con))
 
683
  if (con->has_state())
684
684
  {
685
685
    if (con->state.raw_packet == false)
686
686
    {
687
 
      drizzle_state_push(con, drizzle_state_handshake_server_read);
688
 
      drizzle_state_push(con, drizzle_state_packet_read);
 
687
      con->push_state(drizzle_state_handshake_server_read);
 
688
      con->push_state(drizzle_state_packet_read);
689
689
    }
690
690
 
691
 
    drizzle_state_push(con, drizzle_state_connect);
692
 
    drizzle_state_push(con, drizzle_state_addrinfo);
 
691
    con->push_state(drizzle_state_connect);
 
692
    con->push_state(drizzle_state_addrinfo);
693
693
  }
694
694
 
695
695
  return drizzle_state_loop(con);
803
803
    }
804
804
  }
805
805
 
806
 
  if (drizzle_state_none(con))
 
806
  if (con->has_state())
807
807
  {
808
808
    if (con->state.raw_packet || con->state.no_result_read)
809
809
    {
835
835
    con->command_offset= 0;
836
836
    con->command_total= total;
837
837
 
838
 
    drizzle_state_push(con, drizzle_state_command_write);
 
838
    con->push_state(drizzle_state_command_write);
839
839
  }
840
840
  else if (con->command_data == NULL)
841
841
  {
1031
1031
    if (con->addrinfo_next == NULL)
1032
1032
    {
1033
1033
      drizzle_set_error(con, __func__, "could not connect");
1034
 
      drizzle_state_reset(con);
 
1034
      con->clear_state();
1035
1035
      return DRIZZLE_RETURN_COULD_NOT_CONNECT;
1036
1036
    }
1037
1037
 
1157
1157
    {
1158
1158
      con->revents= 0;
1159
1159
      con->pop_state();
1160
 
      drizzle_state_push(con, drizzle_state_connect);
 
1160
      con->push_state(drizzle_state_connect);
1161
1161
      con->addrinfo_next= con->addrinfo_next->ai_next;
 
1162
 
1162
1163
      return DRIZZLE_RETURN_OK;
1163
1164
    }
1164
1165
 
1308
1309
        {
1309
1310
          con->revents= 0;
1310
1311
          con->pop_state();
1311
 
          drizzle_state_push(con, drizzle_state_connect);
 
1312
          con->push_state(drizzle_state_connect);
1312
1313
          con->addrinfo_next= con->addrinfo_next->ai_next;
1313
1314
          return DRIZZLE_RETURN_OK;
1314
1315
        }