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

Commit 87d3489

Browse files
author
Jakob Schröter
committed
** forwardport of revs 4762:4770 from 1.0 branch **
1 parent 6f38f62 commit 87d3489

File tree

8 files changed

+40
-10
lines changed

8 files changed

+40
-10
lines changed

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ Note: This release is not completely source compatible with previous versions.
1010

1111

1212

13+
v1.0.20 -- 26 Feb 2017
14+
----------------------
15+
Note: This release is not binary compatible with previous releases. It is source compatible.
16+
17+
- BytestreamDataHandler: added callback for acknowledged packets
18+
- ConnectionTCPClient: compile fix for Win32 (broken in 1.0.19)
19+
- ConnectionTCPClient: no-block fix
20+
21+
22+
1323
v1.0.19 -- 21 Feb 2017
1424
----------------------
1525
Note: This release is not binary compatible with previous releases. It is source compatible.

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ libgloox_la_SOURCES = jid.cpp parser.cpp connectiontcpclient.cpp clientbase.cpp
4646
carbons.cpp jinglepluginfactory.cpp jingleiceudp.cpp jinglefiletransfer.cpp \
4747
iodata.cpp rosterx.cpp rosterxitemdata.cpp
4848

49-
libgloox_la_LDFLAGS = -version-info 16:0:0 -no-undefined -no-allow-shlib-undefined
49+
libgloox_la_LDFLAGS = -version-info 17:0:0 -no-undefined -no-allow-shlib-undefined
5050
libgloox_la_LIBADD =
5151
libgloox_la_CFLAGS = $(CPPFLAGS)
5252

src/bytestreamdatahandler.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ namespace gloox
5555
*/
5656
virtual void handleBytestreamData( Bytestream* bs, const std::string& data ) = 0;
5757

58+
/**
59+
* Reimplement this function to be notified when the remote end has
60+
* received and acknowledged a single data packet. This packet may be
61+
* smaller than the chunk that was fed into Bytream::send() due to internal
62+
* chunk size limits. so this callback may be called multiple times for
63+
* each call to Bytestream::send(). it can be used to implement burst limits.
64+
* @param bs The bytestream.
65+
* @since 1.0.20
66+
*/
67+
virtual void handleBytestreamDataAck( Bytestream* bs ) {}
68+
5869
/**
5970
* Notifies about an error occuring while using a bytestream.
6071
* When this handler is called the stream has already been closed.

src/connectiontcpclient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ namespace gloox
137137
}
138138

139139
#if defined( _WIN32 ) && !defined( __SYMBIAN32__ )
140-
int size = static_cast<int>( ::recv( m_socket, m_buf, m_bufsize ) );
141-
#else
142140
int size = static_cast<int>( ::recv( m_socket, m_buf, m_bufsize, 0 ) );
141+
#else
142+
int size = static_cast<int>( ::recv( m_socket, m_buf, m_bufsize, MSG_DONTWAIT ) );
143143
#endif
144144
if( size > 0 )
145145
m_totalBytesIn += size;

src/glooxversion.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
*/
1212

1313
#define GLOOXVERSION 0x010100
14+

src/inbandbytestream.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ namespace gloox
153153
m_handler->handleBytestreamOpen( this );
154154
m_open = true;
155155
}
156+
else if( context == IBBData && m_handler )
157+
{
158+
m_handler->handleBytestreamDataAck( this );
159+
}
156160
break;
157161
case IQ::Error:
158162
closed();
@@ -187,13 +191,16 @@ namespace gloox
187191
return true;
188192
}
189193

190-
if( ( m_lastChunkReceived + 1 ) != i->seq() )
194+
if( ++m_lastChunkReceived != i->seq() )
191195
{
192196
m_open = false;
193197
returnError( iq.from(), iq.id(), StanzaErrorTypeModify, StanzaErrorItemNotFound );
194198
return false;
195199
}
196200

201+
if( m_lastChunkReceived == 65535 )
202+
m_lastChunkReceived = -1;
203+
197204
if( i->data().empty() )
198205
{
199206
m_open = false;
@@ -203,7 +210,7 @@ namespace gloox
203210

204211
returnResult( iq.from(), iq.id() );
205212
m_handler->handleBytestreamData( this, i->data() );
206-
m_lastChunkReceived++;
213+
207214
return true;
208215
}
209216

src/inbandbytestream.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,16 @@ namespace gloox
5454
virtual ~InBandBytestream();
5555

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

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

src/iqhandler.h

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

0 commit comments

Comments
 (0)