~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/net_serv.c

  • Committer: Brian Aker
  • Date: 2008-08-10 16:57:26 UTC
  • Revision ID: brian@tangent.org-20080810165726-mc1660l11a5vkv69
libdrizzle has ulong removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
    return(1);
119
119
  }
120
120
  net->buff=net->write_pos=buff;
121
 
  net->buff_end=buff+(net->max_packet= (ulong) pkt_length);
 
121
  net->buff_end=buff+(net->max_packet= (uint32_t) pkt_length);
122
122
  return(0);
123
123
}
124
124
 
237
237
  */
238
238
  while (len >= MAX_PACKET_LENGTH)
239
239
  {
240
 
    const ulong z_size = MAX_PACKET_LENGTH;
 
240
    const uint32_t z_size = MAX_PACKET_LENGTH;
241
241
    int3store(buff, z_size);
242
242
    buff[3]= (uchar) net->pkt_nr++;
243
243
    if (net_write_buff(net, buff, NET_HEADER_SIZE) ||
286
286
                  const uchar *header, size_t head_len,
287
287
                  const uchar *packet, size_t len)
288
288
{
289
 
  ulong length=len+1+head_len;                  /* 1 extra byte for command */
 
289
  uint32_t length=len+1+head_len;                       /* 1 extra byte for command */
290
290
  uchar buff[NET_HEADER_SIZE+1];
291
291
  uint header_size=NET_HEADER_SIZE+1;
292
292
 
348
348
static bool
349
349
net_write_buff(NET *net, const unsigned char *packet, uint32_t len)
350
350
{
351
 
  ulong left_length;
 
351
  uint32_t left_length;
352
352
  if (net->compress && net->max_packet > MAX_PACKET_LENGTH)
353
353
    left_length= MAX_PACKET_LENGTH - (net->write_pos - net->buff);
354
354
  else
355
 
    left_length= (ulong) (net->buff_end - net->write_pos);
 
355
    left_length= (uint32_t) (net->buff_end - net->write_pos);
356
356
 
357
357
  if (len > left_length)
358
358
  {
534
534
    Returns length of packet.
535
535
*/
536
536
 
537
 
static ulong
 
537
static uint32_t
538
538
my_real_read(NET *net, size_t *complen)
539
539
{
540
540
  uchar *pos;
541
541
  size_t length;
542
542
  uint i,retry_count=0;
543
 
  ulong len=packet_error;
 
543
  uint32_t len=packet_error;
544
544
  uint32_t remain= (net->compress ? NET_HEADER_SIZE+COMP_HEADER_SIZE :
545
545
                  NET_HEADER_SIZE);
546
546
  /* Backup of the original SO_RCVTIMEO timeout */
610
610
    }
611
611
    if (i == 0)
612
612
    {                                   /* First parts is packet length */
613
 
      ulong helping;
 
613
      uint32_t helping;
614
614
 
615
615
      if (net->buff[net->where_b + 3] != (uchar) net->pkt_nr)
616
616
      {
684
684
    if (len == MAX_PACKET_LENGTH)
685
685
    {
686
686
      /* First packet of a multi-packet.  Concatenate the packets */
687
 
      ulong save_pos = net->where_b;
 
687
      uint32_t save_pos = net->where_b;
688
688
      size_t total_length= 0;
689
689
      do
690
690
      {
705
705
  {
706
706
    /* We are using the compressed protocol */
707
707
 
708
 
    ulong buf_length;
709
 
    ulong start_of_packet;
710
 
    ulong first_packet_offset;
 
708
    uint32_t buf_length;
 
709
    uint32_t start_of_packet;
 
710
    uint32_t first_packet_offset;
711
711
    uint read_length, multi_byte_packet=0;
712
712
 
713
713
    if (net->remain_in_buf)
725
725
    }
726
726
    for (;;)
727
727
    {
728
 
      ulong packet_len;
 
728
      uint32_t packet_len;
729
729
 
730
730
      if (buf_length - start_of_packet >= NET_HEADER_SIZE)
731
731
      {
794
794
 
795
795
    net->read_pos=      net->buff+ first_packet_offset + NET_HEADER_SIZE;
796
796
    net->buf_length=    buf_length;
797
 
    net->remain_in_buf= (ulong) (buf_length - start_of_packet);
798
 
    len = ((ulong) (start_of_packet - first_packet_offset) - NET_HEADER_SIZE -
 
797
    net->remain_in_buf= (uint32_t) (buf_length - start_of_packet);
 
798
    len = ((uint32_t) (start_of_packet - first_packet_offset) - NET_HEADER_SIZE -
799
799
           multi_byte_packet);
800
800
    net->save_char= net->read_pos[len]; /* Must be saved */
801
801
    net->read_pos[len]=0;               /* Safeguard for drizzle_use_result */