[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] [patch] netio.hh
From: |
graydon hoare |
Subject: |
[Monotone-devel] [patch] netio.hh |
Date: |
Fri, 14 May 2004 00:46:09 -0400 |
User-agent: |
Mozilla Thunderbird 0.5 (X11/20040208) |
this changes netio.hh to accomodate 0-byte command packets; they seem to
happen sometimes, I haven't tracked down where just yet. it's probably a
small bug in netsync itself, but it seems to be preventing some people
from doing a sync at the moment.
-graydon
# Old manifest: 3237bd47b6a1885ea1095d0148109cee0b7addd1
# New manifest: 78e5e8a2cd346bbd16357a9a258d3aee51d399e9
# Summary of changes:
#
# patch netio.hh
# from 56ceb678186b7cc9164ffead71629e80a3e33b23
# to 2d374c1a00dc50c0be103d04449cc204534c8636
#
--- netio.hh
+++ netio.hh
@@ -28,9 +28,11 @@
{
// if you've gone past the end of the buffer, there's a logic error,
// and this program is not safe to keep running. shut down.
- I(pos < str.size());
+ I(pos < str.size() || (pos == str.size() && len == 0));
// otherwise make sure there's room for this decode operation, but
// use a recoverable exception type.
+ if (len == 0)
+ return;
if (str.size() < pos + len)
throw bad_decode(F("need %d bytes to decode %s at %d, only have %d")
% len % name % pos % (str.size() - pos));
- [Monotone-devel] [patch] netio.hh,
graydon hoare <=