@@ -762,19 +762,23 @@ err_t AsyncClient::_s_connected(void* arg, void* tpcb, err_t err){
762762
763763#if ASYNC_TCP_SSL_ENABLED
764764void AsyncClient::_s_data (void *arg, struct tcp_pcb *tcp, uint8_t * data, size_t len){
765+ (void )tcp;
765766 AsyncClient *c = reinterpret_cast <AsyncClient*>(arg);
766767 if (c->_recv_cb )
767768 c->_recv_cb (c->_recv_cb_arg , c, data, len);
768769}
769770
770771void AsyncClient::_s_handshake (void *arg, struct tcp_pcb *tcp, SSL *ssl){
772+ (void )tcp;
773+ (void )ssl;
771774 AsyncClient *c = reinterpret_cast <AsyncClient*>(arg);
772775 c->_handshake_done = true ;
773776 if (c->_connect_cb )
774777 c->_connect_cb (c->_connect_cb_arg , c);
775778}
776779
777780void AsyncClient::_s_ssl_error (void *arg, struct tcp_pcb *tcp, int8_t err){
781+ (void )tcp;
778782 reinterpret_cast <AsyncClient*>(arg)->_ssl_error (err);
779783}
780784#endif
@@ -1252,6 +1256,7 @@ err_t AsyncServer::_accept(tcp_pcb* pcb, err_t err){
12521256 if (c){
12531257 ASYNC_TCP_DEBUG (" _accept[%u]: SSL connected\n " , c->getConnectionId ());
12541258 c->onConnect ([this ](void * arg, AsyncClient *c){
1259+ (void )arg;
12551260 _connect_cb (_connect_cb_arg, c);
12561261 }, this );
12571262 } else {
@@ -1303,6 +1308,7 @@ err_t AsyncServer::_s_accept(void *arg, tcp_pcb* pcb, err_t err){
13031308
13041309#if ASYNC_TCP_SSL_ENABLED
13051310err_t AsyncServer::_poll (tcp_pcb* pcb){
1311+ err_t err = ERR_OK;
13061312 if (!tcp_ssl_has_client () && _pending){
13071313 struct pending_pcb * p = _pending;
13081314 if (p->pcb == pcb){
@@ -1318,18 +1324,23 @@ err_t AsyncServer::_poll(tcp_pcb* pcb){
13181324 AsyncClient *c = new (std::nothrow) AsyncClient (pcb, _ssl_ctx);
13191325 if (c){
13201326 c->onConnect ([this ](void * arg, AsyncClient *c){
1327+ (void )arg;
13211328 _connect_cb (_connect_cb_arg, c);
13221329 }, 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+ }
13251335 }
13261336 // Should there be error handling for when "new AsynClient" fails??
13271337 free (p);
13281338 }
1329- return ERR_OK ;
1339+ return err ;
13301340}
13311341
13321342err_t AsyncServer::_recv (struct tcp_pcb *pcb, struct pbuf *pb, err_t err){
1343+ (void )err;
13331344 if (!_pending)
13341345 return ERR_OK;
13351346
0 commit comments