Fixing bugs in communication.

- The reporter can't be used from the child process.

- Don't attempt to send a zero-sized chunk when remote print buffer is
  empty.
This commit is contained in:
Robin Sommer 2011-07-01 18:49:15 -07:00
parent b520f98541
commit 4580bef3e6
4 changed files with 29 additions and 16 deletions

View file

@ -195,7 +195,7 @@ bool ChunkedIOFd::WriteChunk(Chunk* chunk, bool partial)
assert(chunk->len <= BUFFER_SIZE - sizeof(uint32) );
if ( chunk->len == 0 )
reporter->InternalError("attempt to write 0 bytes chunk");
InternalError("attempt to write 0 bytes chunk");
if ( partial )
chunk->len |= FLAG_PARTIAL;
@ -285,7 +285,7 @@ bool ChunkedIOFd::FlushWriteBuffer()
}
if ( written == 0 )
reporter->InternalError("written==0");
InternalError("written==0");
// Short write.
write_pos += written;
@ -906,7 +906,7 @@ bool ChunkedIOSSL::WriteData(char* p, uint32 len, bool* error)
return false;
}
reporter->InternalError("can't be reached");
InternalError("can't be reached");
return false;
}
@ -1026,7 +1026,7 @@ bool ChunkedIOSSL::ReadData(char* p, uint32 len, bool* error)
}
// Can't be reached.
reporter->InternalError("can't be reached");
InternalError("can't be reached");
return false;
}