Skip to content

Commit 5b26fe9

Browse files
committed
H4 patch
backport from [this fork](https://github.com/philbowles/AsyncTCP)
2 parents ca8ac5f + f318a96 commit 5b26fe9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/AsyncTCP.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ AsyncClient::AsyncClient(tcp_pcb* pcb)
562562
, _rx_since_timeout(0)
563563
, _ack_timeout(ASYNC_MAX_ACK_TIME)
564564
, _connect_port(0)
565+
, _recv_pbuf_flags(0)
565566
, prev(NULL)
566567
, next(NULL)
567568
{
@@ -931,6 +932,8 @@ int8_t AsyncClient::_recv(tcp_pcb* pcb, pbuf* pb, int8_t err) {
931932
_pb_cb(_pb_cb_arg, this, b);
932933
} else {
933934
if(_recv_cb) {
935+
// pmb
936+
_recv_pbuf_flags = b->flags;
934937
_recv_cb(_recv_cb_arg, this, b->payload, b->len);
935938
}
936939
if(!_ack_pcb) {

src/AsyncTCP.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class AsyncClient {
122122
void ackPacket(struct pbuf * pb);//ack pbuf from onPacket
123123
size_t ack(size_t len); //ack data that you have not acked using the method below
124124
void ackLater(){ _ack_pcb = false; } //will not ack the current packet. Call from onData
125+
bool isRecvPush(){ return !!(_recv_pbuf_flags & PBUF_FLAG_PUSH); }
125126

126127
const char * errorToString(int8_t error);
127128
const char * stateToString();
@@ -168,6 +169,7 @@ class AsyncClient {
168169
uint32_t _rx_since_timeout;
169170
uint32_t _ack_timeout;
170171
uint16_t _connect_port;
172+
u8_t _recv_pbuf_flags;
171173

172174
int8_t _close();
173175
void _free_closed_slot();

0 commit comments

Comments
 (0)