This commit is contained in:
Emiel Bruijntjes 2015-11-10 15:29:37 +01:00
commit 3ef9cf47b5
3 changed files with 6 additions and 5 deletions

View File

@ -2,8 +2,8 @@ PREFIX = /usr
INCLUDE_DIR = ${PREFIX}/include
LIBRARY_DIR = ${PREFIX}/lib
export LIBRARY_NAME = amqpcpp
export SONAME = 2.2
export VERSION = 2.2.3
export SONAME = 2.3
export VERSION = 2.3.0
all:
$(MAKE) -C src all

View File

@ -300,7 +300,7 @@ bool ConnectionImpl::send(const Frame &frame)
if (_state == state_closing || _state == state_closed) return false;
// some frames can be sent _after_ the close() function was called
if (_closed && !frame.partOfShutdown()) return false;
if (_closed && !frame.partOfShutdown() && !frame.partOfHandshake()) return false;
// if the frame is bigger than we allow on the connection
// it is impossible to send out this frame successfully

View File

@ -376,8 +376,9 @@ public:
// when the buffer is very small, we use a lower limit of 512 bytes
if (ioctl(socket, FIONREAD, &available) != 0) return -1;
// no need to read anything if there is no input
if (available == 0) return 0;
// if no bytes are available, it could mean that the connection was closed
// by the remote client, so we do have to call read() anyway, assume a default buffer
if (available == 0) available = 1;
// add a new buffer
_buffers.emplace_back(available);