~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/mysql_protocol/net_serv.cc

  • Committer: Mark Atwood
  • Date: 2011-05-26 22:44:47 UTC
  • mfrom: (2312.1.5 drizzle-ga)
  • Revision ID: me@mark.atwood.name-20110526224447-39enwwquyvd4od6f
mergeĀ lp:~brianaker/drizzle/refactor-byte-string

Show diffs side-by-side

added added

removed removed

Lines of Context:
730
730
{
731
731
  size_t len, complen;
732
732
 
733
 
  if (!net->compress)
 
733
  if (not net->compress)
734
734
  {
735
735
    len = my_real_read(net,&complen);
736
736
    if (len == MAX_PACKET_LENGTH)
738
738
      /* First packet of a multi-packet.  Concatenate the packets */
739
739
      uint32_t save_pos = net->where_b;
740
740
      size_t total_length= 0;
 
741
 
741
742
      do
742
743
      {
743
744
        net->where_b += len;
744
745
        total_length += len;
745
746
        len = my_real_read(net,&complen);
746
747
      } while (len == MAX_PACKET_LENGTH);
 
748
 
747
749
      if (len != packet_error)
 
750
      {
748
751
        len+= total_length;
 
752
      }
749
753
      net->where_b = save_pos;
750
754
    }
751
755
    net->read_pos = net->buff + net->where_b;
 
756
 
752
757
    if (len != packet_error)
753
758
      net->read_pos[len]=0;        /* Safeguard for drizzleclient_use_result */
 
759
 
754
760
    return len;
755
761
  }
756
762
  else
875
881
    net->read_pos[len]=0;        /* Safeguard for drizzleclient_use_result */
876
882
  }
877
883
  return len;
878
 
  }
 
884
}
879
885
 
880
886
 
881
887
void drizzleclient_net_set_read_timeout(NET *net, uint32_t timeout)