~ubuntu-branches/ubuntu/hardy/mysql-dfsg-5.0/hardy-updates

« back to all changes in this revision

Viewing changes to ndb/src/mgmapi/mgmapi.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-04-02 16:10:53 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20070402161053-zkil9hjq9k5p1uzv
Tags: 5.0.37-0ubuntu1
* New upstream bugfix release.
  - Fixes replication failure with auto-increment and on duplicate key
    update, a regression introduced into 5.0.24. (LP: #95821)
* debian/control: Set Ubuntu maintainer.
* debian/rules: Change comments from 'Debian etch' to 'Ubuntu 7.04'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; either version 2 of the License, or
6
 
   (at your option) any later version.
 
5
   the Free Software Foundation; version 2 of the License.
7
6
 
8
7
   This program is distributed in the hope that it will be useful,
9
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
94
93
  char last_error_desc[NDB_MGM_MAX_ERR_DESC_SIZE];
95
94
  int read_timeout;
96
95
  int write_timeout;
 
96
  unsigned int connect_timeout;
97
97
 
98
98
  NDB_SOCKET_TYPE socket;
99
99
 
160
160
  h->socket          = NDB_INVALID_SOCKET;
161
161
  h->read_timeout    = 50000;
162
162
  h->write_timeout   = 100;
 
163
  h->connect_timeout = 0;
163
164
  h->cfg_i           = -1;
164
165
  h->errstream       = stdout;
165
166
  h->m_name          = 0;
427
428
  return handle->connected;
428
429
}
429
430
 
 
431
extern "C"
 
432
int ndb_mgm_set_connect_timeout(NdbMgmHandle handle, unsigned int seconds)
 
433
{
 
434
  if(!handle)
 
435
    return -1;
 
436
 
 
437
  handle->connect_timeout= seconds;
 
438
  return 0;
 
439
}
 
440
 
430
441
/**
431
442
 * Connect to a management server
432
443
 */
457
468
  Uint32 i;
458
469
  int binderror = 0;
459
470
  SocketClient s(0, 0);
 
471
  s.set_connect_timeout(handle->connect_timeout);
460
472
  if (!s.init())
461
473
  {
462
474
    fprintf(handle->errstream,