Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jun 2011 16:01:30 +0000 (UTC)
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sbin/hastd proto_common.c
Message-ID:  <201106041601.p54G1ha2054775@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
sobomax     2011-06-04 16:01:30 UTC

  FreeBSD src repository

  Modified files:
    sbin/hastd           proto_common.c 
  Log:
  SVN rev 222688 on 2011-06-04 16:01:30Z by sobomax
  
  Read from the socket using the same max buffer size as we use while
  sending. What happens otherwise is that the sender splits all the
  traffic into 32k chunks, while the receiver is waiting for the whole
  packet. Then for a certain packet sizes, particularly 66607 bytes in
  my case, the communication stucks to secondary is expecting to
  read one chunk of 66607 bytes, while primary is sending two chunks
  of 32768 bytes and third chunk of 1071. Probably due to TCP windowing
  and buffering the final chunk gets stuck somewhere, so neither server
  not client can make any progress.
  
  This patch also protect from short reads, as according to the manual
  page there are some cases when MSG_WAITALL can give less data than
  expected.
  
  MFC after:      3 days
  
  Revision  Changes    Path
  1.13      +14 -2     src/sbin/hastd/proto_common.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106041601.p54G1ha2054775>