~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/conn.cc

  • Committer: Brian Aker
  • Date: 2011-12-27 20:30:10 UTC
  • mfrom: (2472.1.9 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2482.
  • Revision ID: brian@tangent.org-20111227203010-1ymj1ekc2k37bu8s
Merge yacc tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1009
1009
 
1010
1010
  if (con->command_buffer == NULL)
1011
1011
  {
1012
 
    con->command_buffer= (uint8_t*)malloc((*total) + 1);
 
1012
    con->command_buffer= (uint8_t*)realloc(NULL, (*total) +1);
1013
1013
    if (con->command_buffer == NULL)
1014
1014
    {
1015
 
      drizzle_set_error(con->drizzle, "drizzle_command_buffer", "malloc");
 
1015
      drizzle_set_error(con->drizzle, __func__, "Failed to allocate.");
1016
1016
      *ret_ptr= DRIZZLE_RETURN_MEMORY;
1017
1017
      return NULL;
1018
1018
    }
1127
1127
    else
1128
1128
    {
1129
1129
      if (tcp->host == NULL)
 
1130
      {
1130
1131
        host= DRIZZLE_DEFAULT_TCP_HOST;
 
1132
      }
1131
1133
      else
 
1134
      {
1132
1135
        host= tcp->host;
 
1136
      }
1133
1137
    }
1134
1138
 
1135
1139
    ret= getaddrinfo(host, port, &ai, &(tcp->addrinfo));
1136
1140
    if (ret != 0)
1137
1141
    {
1138
 
      drizzle_set_error(con->drizzle, "drizzle_state_addrinfo",
1139
 
                        "getaddrinfo:%s", gai_strerror(ret));
 
1142
      drizzle_set_error(con->drizzle, "drizzle_state_addrinfo", "getaddrinfo:%s", gai_strerror(ret));
1140
1143
      return DRIZZLE_RETURN_GETADDRINFO;
1141
1144
    }
1142
1145