Skip to content
This repository has been archived by the owner on Apr 14, 2019. It is now read-only.

Commit

Permalink
** forwardport of revs 4762:4770 from 1.0 branch **
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob Schröter committed Feb 26, 2017
1 parent 6f38f62 commit 87d3489
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 10 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ Note: This release is not completely source compatible with previous versions.



v1.0.20 -- 26 Feb 2017
----------------------
Note: This release is not binary compatible with previous releases. It is source compatible.

- BytestreamDataHandler: added callback for acknowledged packets
- ConnectionTCPClient: compile fix for Win32 (broken in 1.0.19)
- ConnectionTCPClient: no-block fix



v1.0.19 -- 21 Feb 2017
----------------------
Note: This release is not binary compatible with previous releases. It is source compatible.
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ libgloox_la_SOURCES = jid.cpp parser.cpp connectiontcpclient.cpp clientbase.cpp
carbons.cpp jinglepluginfactory.cpp jingleiceudp.cpp jinglefiletransfer.cpp \
iodata.cpp rosterx.cpp rosterxitemdata.cpp

libgloox_la_LDFLAGS = -version-info 16:0:0 -no-undefined -no-allow-shlib-undefined
libgloox_la_LDFLAGS = -version-info 17:0:0 -no-undefined -no-allow-shlib-undefined
libgloox_la_LIBADD =
libgloox_la_CFLAGS = $(CPPFLAGS)

Expand Down
11 changes: 11 additions & 0 deletions src/bytestreamdatahandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ namespace gloox
*/
virtual void handleBytestreamData( Bytestream* bs, const std::string& data ) = 0;

/**
* Reimplement this function to be notified when the remote end has
* received and acknowledged a single data packet. This packet may be
* smaller than the chunk that was fed into Bytream::send() due to internal
* chunk size limits. so this callback may be called multiple times for
* each call to Bytestream::send(). it can be used to implement burst limits.
* @param bs The bytestream.
* @since 1.0.20
*/
virtual void handleBytestreamDataAck( Bytestream* bs ) {}

/**
* Notifies about an error occuring while using a bytestream.
* When this handler is called the stream has already been closed.
Expand Down
4 changes: 2 additions & 2 deletions src/connectiontcpclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ namespace gloox
}

#if defined( _WIN32 ) && !defined( __SYMBIAN32__ )
int size = static_cast<int>( ::recv( m_socket, m_buf, m_bufsize ) );
#else
int size = static_cast<int>( ::recv( m_socket, m_buf, m_bufsize, 0 ) );
#else
int size = static_cast<int>( ::recv( m_socket, m_buf, m_bufsize, MSG_DONTWAIT ) );
#endif
if( size > 0 )
m_totalBytesIn += size;
Expand Down
1 change: 1 addition & 0 deletions src/glooxversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
*/

#define GLOOXVERSION 0x010100

11 changes: 9 additions & 2 deletions src/inbandbytestream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ namespace gloox
m_handler->handleBytestreamOpen( this );
m_open = true;
}
else if( context == IBBData && m_handler )
{
m_handler->handleBytestreamDataAck( this );
}
break;
case IQ::Error:
closed();
Expand Down Expand Up @@ -187,13 +191,16 @@ namespace gloox
return true;
}

if( ( m_lastChunkReceived + 1 ) != i->seq() )
if( ++m_lastChunkReceived != i->seq() )
{
m_open = false;
returnError( iq.from(), iq.id(), StanzaErrorTypeModify, StanzaErrorItemNotFound );
return false;
}

if( m_lastChunkReceived == 65535 )
m_lastChunkReceived = -1;

if( i->data().empty() )
{
m_open = false;
Expand All @@ -203,7 +210,7 @@ namespace gloox

returnResult( iq.from(), iq.id() );
m_handler->handleBytestreamData( this, i->data() );
m_lastChunkReceived++;

return true;
}

Expand Down
7 changes: 4 additions & 3 deletions src/inbandbytestream.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ namespace gloox
virtual ~InBandBytestream();

/**
* Lets you retrieve this bytestream's block-size.
* Lets you retrieve this bytestream's block-size. The default is 4096 bytes.
* @return The bytestream's block-size.
*/
int blockSize() const { return m_blockSize; }

/**
* Sets the stream's block-size. Default: 4096
* Sets the stream's block-size. Default: 4096 bytes. Maximum allowed block-size: 65535 bytes
* @param blockSize The new block size.
* @note You should not change the block size once connect() has been called.
* @note You should not change the block size once connect() has been called. Though neither
* the block-size limit nor changing it mid-stream are enforced by this function.
*/
void setBlockSize( int blockSize ) { m_blockSize = blockSize; }

Expand Down
4 changes: 2 additions & 2 deletions src/iqhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace gloox
* Reimplement this function if you want to be notified about incoming IQs.
* @param iq The complete IQ stanza.
* @return Indicates whether a request of type 'get' or 'set' has been handled. This includes
* the obligatory 'result' answer. If you return @b false, an 'error' will be sent.
* the obligatory 'result' answer. If you return @b false, an 'error' will be sent back.
* @since 1.0
*/
virtual bool handleIq( const IQ& iq ) = 0;
Expand All @@ -49,7 +49,7 @@ namespace gloox
* Reimplement this function if you want to be notified about
* incoming IQs with a specific value of the @c id attribute. You
* have to enable tracking of those IDs using Client::trackID().
* This is usually useful for IDs that generate a positive reply, i.e.
* This is usually useful for IDs that generate a empty positive reply, i.e.
* &lt;iq type='result' id='reg'/&gt; where a namespace filter wouldn't
* work.
* @param iq The complete IQ stanza.
Expand Down

0 comments on commit 87d3489

Please sign in to comment.