~brianaker/gearmand/update-ax_pthread

« back to all changes in this revision

Viewing changes to libgearman/client.cc

  • Committer: Continuous Integration
  • Date: 2013-10-11 09:14:20 UTC
  • mfrom: (883.2.5 gearmand-1.2)
  • Revision ID: ci@tangent.org-20131011091420-3e8gnhytxbk2tzgm
Merge lp:~brianaker/gearmand/hostile-target Build: jenkins-Gearmand-906

Show diffs side-by-side

added added

removed removed

Lines of Context:
593
593
{
594
594
  if (client_shell and client_shell->impl())
595
595
  {
596
 
    if (gearman_connection_create(client_shell->impl()->universal, host, port) == false)
 
596
    Client* client= client_shell->impl();
 
597
 
 
598
    if (gearman_connection_create(client->universal, host, port) == false)
597
599
    {
598
 
      assert(client_shell->impl()->universal.error_code() != GEARMAN_SUCCESS);
599
 
      return client_shell->impl()->universal.error_code();
 
600
      assert(client->error_code() != GEARMAN_SUCCESS);
 
601
      return client->error_code();
600
602
    }
601
 
    assert(client_shell->impl()->universal.has_connections());
 
603
    assert(client->universal.has_connections());
602
604
 
603
605
    return GEARMAN_SUCCESS;
604
606
  }
610
612
{
611
613
  if (gearman_connection_create(universal, host, service_) == false)
612
614
  {
613
 
    assert(universal.error_code() != GEARMAN_SUCCESS);
614
 
    return universal.error_code();
 
615
    assert(error_code() != GEARMAN_SUCCESS);
 
616
    return error_code();
615
617
  }
616
618
 
617
619
  return GEARMAN_SUCCESS;
1451
1453
      /* See if there are any connections ready for I/O. */
1452
1454
      while ((client->con= gearman_ready(client->universal)))
1453
1455
      {
1454
 
        if (client->con->revents & (POLLOUT | POLLERR | POLLHUP | POLLNVAL))
 
1456
        if (client->con->is_revents(POLLOUT | POLLERR | POLLHUP | POLLNVAL))
1455
1457
        {
1456
1458
          /* Socket is ready for writing, continue submitting jobs. */
1457
1459
          for (client->task= client->task_list; client->task;
1484
1486
          }
1485
1487
 
1486
1488
          /* Connection errors are fatal. */
1487
 
          if (client->con->revents & (POLLERR | POLLHUP | POLLNVAL))
 
1489
          if (client->con->is_revents(POLLERR | POLLHUP | POLLNVAL))
1488
1490
          {
1489
1491
            gearman_error(client->universal, GEARMAN_LOST_CONNECTION, "detected lost connection in _client_run_tasks()");
1490
1492
            client->con->close_socket();
1493
1495
          }
1494
1496
        }
1495
1497
 
1496
 
        if ((client->con->revents & POLLIN) == 0)
 
1498
        if ((client->con->is_revents(POLLIN)) == false)
1497
1499
        {
1498
1500
          continue;
1499
1501
        }