~mordred/gearmand/solaris-64-fixes

« back to all changes in this revision

Viewing changes to libgearman/worker.c

  • Committer: Brian Aker
  • Date: 2009-01-20 00:07:16 UTC
  • mfrom: (19.1.69 fixes)
  • Revision ID: brian@tangent.org-20090120000716-guv1cplv7p0tsffr
MergeĀ fromĀ Eric

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
            {
293
293
              if (*ret_ptr == GEARMAN_IO_WAIT)
294
294
                worker->state= GEARMAN_WORKER_STATE_FUNCTION_SEND;
295
 
              else if (*ret_ptr == GEARMAN_EOF || (*ret_ptr == GEARMAN_ERRNO &&
296
 
                       worker->gearman->last_errno == EPIPE))
297
 
              {
 
295
              else if (*ret_ptr == GEARMAN_LOST_CONNECTION)
298
296
                continue;
299
 
              }
300
297
 
301
298
              return NULL;
302
299
            }
345
342
              if (*ret_ptr == GEARMAN_IO_WAIT)
346
343
                worker->state= GEARMAN_WORKER_STATE_CONNECT;
347
344
              else if (*ret_ptr == GEARMAN_COULD_NOT_CONNECT ||
348
 
                       *ret_ptr == GEARMAN_EOF || (*ret_ptr == GEARMAN_ERRNO &&
349
 
                       worker->gearman->last_errno == EPIPE))
 
345
                       *ret_ptr == GEARMAN_LOST_CONNECTION)
350
346
              {
351
347
                break;
352
348
              }
368
364
        {
369
365
          if (*ret_ptr == GEARMAN_IO_WAIT)
370
366
            worker->state= GEARMAN_WORKER_STATE_GRAB_JOB_SEND;
371
 
          else if (*ret_ptr == GEARMAN_EOF || (*ret_ptr == GEARMAN_ERRNO &&
372
 
                   worker->gearman->last_errno == EPIPE))
373
 
          {
 
367
          else if (*ret_ptr == GEARMAN_LOST_CONNECTION)
374
368
            continue;
375
 
          }
376
369
 
377
370
          return NULL;
378
371
        }
400
393
            {
401
394
              gearman_job_free(worker->job);
402
395
              worker->job= NULL;
 
396
 
 
397
              if (*ret_ptr == GEARMAN_LOST_CONNECTION)
 
398
                break;
403
399
            }
404
400
 
405
 
            if (*ret_ptr == GEARMAN_EOF || *ret_ptr == GEARMAN_NOT_CONNECTED)
406
 
              break;
407
 
 
408
401
            return NULL;
409
402
          }
410
403
 
452
445
        {
453
446
          if (*ret_ptr == GEARMAN_IO_WAIT)
454
447
            worker->state= GEARMAN_WORKER_STATE_PRE_SLEEP;
455
 
          else if (*ret_ptr == GEARMAN_EOF || (*ret_ptr == GEARMAN_ERRNO &&
456
 
                   worker->gearman->last_errno == EPIPE))
457
 
          {
 
448
          else if (*ret_ptr == GEARMAN_LOST_CONNECTION)
458
449
            continue;
459
 
          }
460
450
 
461
451
          return NULL;
462
452
        }
572
562
      ret= gearman_job_fail(&(worker->work_job));
573
563
      if (ret != GEARMAN_SUCCESS)
574
564
      {
575
 
        if (ret == GEARMAN_ERRNO && worker->gearman->last_errno == EPIPE)
 
565
        if (ret == GEARMAN_LOST_CONNECTION)
576
566
          break;
577
567
 
578
568
        worker->work_state= GEARMAN_WORKER_WORK_STATE_FAIL;
584
574
 
585
575
    if (ret != GEARMAN_SUCCESS)
586
576
    {
587
 
      if (ret == GEARMAN_ERRNO && worker->gearman->last_errno == EPIPE)
 
577
      if (ret == GEARMAN_LOST_CONNECTION)
588
578
        break;
589
579
 
590
580
      worker->work_state= GEARMAN_WORKER_WORK_STATE_FUNCTION;
614
604
 
615
605
    if (ret != GEARMAN_SUCCESS)
616
606
    {
617
 
      if (ret == GEARMAN_ERRNO && worker->gearman->last_errno == EPIPE)
 
607
      if (ret == GEARMAN_LOST_CONNECTION)
618
608
        break;
619
609
 
620
610
      return ret;
626
616
    ret= gearman_job_fail(&(worker->work_job));
627
617
    if (ret != GEARMAN_SUCCESS)
628
618
    {
629
 
      if (ret == GEARMAN_ERRNO && worker->gearman->last_errno == EPIPE)
 
619
      if (ret == GEARMAN_LOST_CONNECTION)
630
620
        break;
631
621
 
632
622
      return ret;