~maria-captains/mariadb-native-client/trunk

« back to all changes in this revision

Viewing changes to libmariadb/libmariadb.c

  • Committer: holzboote at googlemail
  • Date: 2013-08-03 16:39:05 UTC
  • Revision ID: holzboote@googlemail.com-20130803163905-38dd5zcjc0whhgu0
Fix for CONC-42: More informative errormessages for handshake errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
365
365
    my_set_error(mysql, net->last_errno == ER_NET_PACKET_TOO_LARGE ?
366
366
                     CR_NET_PACKET_TOO_LARGE:
367
367
                     CR_SERVER_LOST,
368
 
                     SQLSTATE_UNKNOWN, 0);
 
368
         SQLSTATE_UNKNOWN, 0);
369
369
    return(packet_error);
370
370
  }
371
371
  if (net->read_pos[0] == 255)
1651
1651
  /* set write timeout */
1652
1652
  if (mysql->options.write_timeout)
1653
1653
    vio_write_timeout(net->vio, mysql->options.read_timeout);
1654
 
 
1655
 
 
1656
1654
  /* Get version info */
1657
1655
  mysql->protocol_version= PROTOCOL_VERSION;    /* Assume this */
1658
1656
  if (mysql->options.connect_timeout &&
1659
1657
      vio_poll_read(net->vio, mysql->options.connect_timeout))
1660
1658
  {
1661
 
    my_set_error(mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN, 0);
 
1659
    my_set_error(mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN,
 
1660
                 ER(CR_SERVER_LOST_EXTENDED),
 
1661
                 "handshake: waiting for inital communication packet",
 
1662
                 errno);
1662
1663
    goto error;
1663
1664
  }
1664
1665
  if ((pkt_length=net_safe_read(mysql)) == packet_error)
 
1666
  {
 
1667
    if (mysql->net.last_errno == CR_SERVER_LOST)
 
1668
      my_set_error(mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN,
 
1669
                 ER(CR_SERVER_LOST_EXTENDED),
 
1670
                 "handshake: reading inital communication packet",
 
1671
                 errno);
 
1672
 
1665
1673
    goto error;
1666
 
 
 
1674
  }
1667
1675
  end= (char *)net->read_pos;
1668
1676
  end_pkt= (char *)net->read_pos + pkt_length;
1669
1677