@@ -762,19 +762,23 @@ err_t AsyncClient::_s_connected(void* arg, void* tpcb, err_t err){
762
762
763
763
#if ASYNC_TCP_SSL_ENABLED
764
764
void AsyncClient::_s_data (void *arg, struct tcp_pcb *tcp, uint8_t * data, size_t len){
765
+ (void )tcp;
765
766
AsyncClient *c = reinterpret_cast <AsyncClient*>(arg);
766
767
if (c->_recv_cb )
767
768
c->_recv_cb (c->_recv_cb_arg , c, data, len);
768
769
}
769
770
770
771
void AsyncClient::_s_handshake (void *arg, struct tcp_pcb *tcp, SSL *ssl){
772
+ (void )tcp;
773
+ (void )ssl;
771
774
AsyncClient *c = reinterpret_cast <AsyncClient*>(arg);
772
775
c->_handshake_done = true ;
773
776
if (c->_connect_cb )
774
777
c->_connect_cb (c->_connect_cb_arg , c);
775
778
}
776
779
777
780
void AsyncClient::_s_ssl_error (void *arg, struct tcp_pcb *tcp, int8_t err){
781
+ (void )tcp;
778
782
reinterpret_cast <AsyncClient*>(arg)->_ssl_error (err);
779
783
}
780
784
#endif
@@ -1252,6 +1256,7 @@ err_t AsyncServer::_accept(tcp_pcb* pcb, err_t err){
1252
1256
if (c){
1253
1257
ASYNC_TCP_DEBUG (" _accept[%u]: SSL connected\n " , c->getConnectionId ());
1254
1258
c->onConnect ([this ](void * arg, AsyncClient *c){
1259
+ (void )arg;
1255
1260
_connect_cb (_connect_cb_arg, c);
1256
1261
}, this );
1257
1262
} else {
@@ -1303,6 +1308,7 @@ err_t AsyncServer::_s_accept(void *arg, tcp_pcb* pcb, err_t err){
1303
1308
1304
1309
#if ASYNC_TCP_SSL_ENABLED
1305
1310
err_t AsyncServer::_poll (tcp_pcb* pcb){
1311
+ err_t err = ERR_OK;
1306
1312
if (!tcp_ssl_has_client () && _pending){
1307
1313
struct pending_pcb * p = _pending;
1308
1314
if (p->pcb == pcb){
@@ -1318,18 +1324,23 @@ err_t AsyncServer::_poll(tcp_pcb* pcb){
1318
1324
AsyncClient *c = new (std::nothrow) AsyncClient (pcb, _ssl_ctx);
1319
1325
if (c){
1320
1326
c->onConnect ([this ](void * arg, AsyncClient *c){
1327
+ (void )arg;
1321
1328
_connect_cb (_connect_cb_arg, c);
1322
1329
}, this );
1323
- if (p->pb )
1324
- c->_recv (pcb, p->pb , 0 );
1330
+ if (p->pb ) {
1331
+ auto errorTracker = c->getACErrorTracker ();
1332
+ c->_recv (errorTracker, pcb, p->pb , 0 );
1333
+ err = errorTracker->getCallbackCloseError ();
1334
+ }
1325
1335
}
1326
1336
// Should there be error handling for when "new AsynClient" fails??
1327
1337
free (p);
1328
1338
}
1329
- return ERR_OK ;
1339
+ return err ;
1330
1340
}
1331
1341
1332
1342
err_t AsyncServer::_recv (struct tcp_pcb *pcb, struct pbuf *pb, err_t err){
1343
+ (void )err;
1333
1344
if (!_pending)
1334
1345
return ERR_OK;
1335
1346
0 commit comments