~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/oldlibdrizzle/net_serv.cc

Actually removed the code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
477
477
  uint32_t retry_count= 0;
478
478
 
479
479
  /* Backup of the original SO_RCVTIMEO timeout */
480
 
#ifdef WE_DONT_NEED_THIS_IN_DRIZZLED
481
 
#ifndef __sun
482
 
  struct timespec backtime;
483
 
  int error;
484
 
#endif
485
 
#endif
486
480
 
487
481
  if (net->error == 2)
488
482
    return(-1);                /* socket can't be used */
536
530
    packet= b;
537
531
  }
538
532
 
539
 
#ifdef WE_DONT_NEED_THIS_IN_DRIZZLED
540
 
#ifndef __sun
541
 
  /* Check for error, currently assert */
542
 
  if (net->write_timeout)
543
 
  {
544
 
    struct timespec waittime;
545
 
    socklen_t time_len;
546
 
 
547
 
    waittime.tv_sec= net->write_timeout;
548
 
    waittime.tv_nsec= 0;
549
 
 
550
 
    memset(&backtime, 0, sizeof(struct timespec));
551
 
    time_len= sizeof(struct timespec);
552
 
    error= getsockopt(net->vio->sd, SOL_SOCKET, SO_RCVTIMEO,
553
 
                      &backtime, &time_len);
554
 
    if (error != 0)
555
 
    {
556
 
      perror("getsockopt");
557
 
      assert(error == 0);
558
 
    }
559
 
    error= setsockopt(net->vio->sd, SOL_SOCKET, SO_RCVTIMEO,
560
 
                      &waittime, (socklen_t)sizeof(struct timespec));
561
 
    assert(error == 0);
562
 
  }
563
 
#endif
564
 
#endif
565
 
 
566
533
  pos= packet;
567
534
  end=pos+len;
568
535
  /* Loop until we have read everything */
614
581
    free((char*) packet);
615
582
  net->reading_or_writing=0;
616
583
 
617
 
#ifdef WE_DONT_NEED_THIS_IN_DRIZZLED
618
 
#ifndef __sun
619
 
  if (net->write_timeout)
620
 
    error= setsockopt(net->vio->sd, SOL_SOCKET, SO_RCVTIMEO,
621
 
                      &backtime, (socklen_t)sizeof(struct timespec));
622
 
#endif
623
 
#endif
624
 
 
625
584
  return(((int) (pos != end)));
626
585
}
627
586
 
645
604
  uint32_t remain= (net->compress ? NET_HEADER_SIZE+COMP_HEADER_SIZE :
646
605
                    NET_HEADER_SIZE);
647
606
 
648
 
#ifdef WE_DONT_NEED_THIS_IN_DRIZZLED
649
 
#ifndef __sun
650
 
  /* Backup of the original SO_RCVTIMEO timeout */
651
 
  struct timespec backtime;
652
 
  int error= 0;
653
 
#endif
654
 
#endif
655
 
 
656
607
  *complen = 0;
657
608
 
658
609
  net->reading_or_writing= 1;
660
611
 
661
612
  pos = net->buff + net->where_b;        /* net->packet -4 */
662
613
 
663
 
 
664
 
#ifdef WE_DONT_NEED_THIS_IN_DRIZZLED
665
 
#ifndef __sun
666
 
  /* Check for error, currently assert */
667
 
  if (net->read_timeout)
668
 
  {
669
 
    struct timespec waittime;
670
 
    socklen_t time_len;
671
 
 
672
 
    waittime.tv_sec= net->read_timeout;
673
 
    waittime.tv_nsec= 0;
674
 
 
675
 
    memset(&backtime, 0, sizeof(struct timespec));
676
 
    time_len= sizeof(struct timespec);
677
 
    error= getsockopt(net->vio->sd, SOL_SOCKET, SO_RCVTIMEO,
678
 
                      &backtime, &time_len);
679
 
    if (error != 0)
680
 
    {
681
 
      perror("getsockopt");
682
 
      assert(error == 0);
683
 
    }
684
 
    error= setsockopt(net->vio->sd, SOL_SOCKET, SO_RCVTIMEO,
685
 
                      &waittime, (socklen_t)sizeof(struct timespec));
686
 
    assert(error == 0);
687
 
  }
688
 
#endif
689
 
#endif
690
 
 
691
614
  for (i= 0; i < 2 ; i++)
692
615
  {
693
616
    while (remain > 0)
756
679
  }
757
680
 
758
681
end:
759
 
#ifdef WE_DONT_NEED_THIS_IN_DRIZZLED
760
 
#ifndef __sun
761
 
  if  (net->vio->sd >= 0 && net->read_timeout)
762
 
  {
763
 
    error= setsockopt(net->vio->sd, SOL_SOCKET, SO_RCVTIMEO,
764
 
                      &backtime, (socklen_t)sizeof(struct timespec));
765
 
    assert(error == 0);
766
 
  }
767
 
#endif
768
 
#endif
769
682
  net->reading_or_writing= 0;
770
683
 
771
684
  return(len);