Merge branch 'master' of https://github.com/CopernicaMarketingSoftware/AMQP-CPP
This commit is contained in:
commit
3ef9cf47b5
4
Makefile
4
Makefile
|
|
@ -2,8 +2,8 @@ PREFIX = /usr
|
||||||
INCLUDE_DIR = ${PREFIX}/include
|
INCLUDE_DIR = ${PREFIX}/include
|
||||||
LIBRARY_DIR = ${PREFIX}/lib
|
LIBRARY_DIR = ${PREFIX}/lib
|
||||||
export LIBRARY_NAME = amqpcpp
|
export LIBRARY_NAME = amqpcpp
|
||||||
export SONAME = 2.2
|
export SONAME = 2.3
|
||||||
export VERSION = 2.2.3
|
export VERSION = 2.3.0
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(MAKE) -C src all
|
$(MAKE) -C src all
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@ bool ConnectionImpl::send(const Frame &frame)
|
||||||
if (_state == state_closing || _state == state_closed) return false;
|
if (_state == state_closing || _state == state_closed) return false;
|
||||||
|
|
||||||
// some frames can be sent _after_ the close() function was called
|
// 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
|
// if the frame is bigger than we allow on the connection
|
||||||
// it is impossible to send out this frame successfully
|
// it is impossible to send out this frame successfully
|
||||||
|
|
|
||||||
|
|
@ -376,8 +376,9 @@ public:
|
||||||
// when the buffer is very small, we use a lower limit of 512 bytes
|
// when the buffer is very small, we use a lower limit of 512 bytes
|
||||||
if (ioctl(socket, FIONREAD, &available) != 0) return -1;
|
if (ioctl(socket, FIONREAD, &available) != 0) return -1;
|
||||||
|
|
||||||
// no need to read anything if there is no input
|
// if no bytes are available, it could mean that the connection was closed
|
||||||
if (available == 0) return 0;
|
// 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
|
// add a new buffer
|
||||||
_buffers.emplace_back(available);
|
_buffers.emplace_back(available);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue