We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3293f35 commit a061442Copy full SHA for a061442
src/AsyncTCP.cpp
@@ -1618,20 +1618,19 @@ void AsyncServer::end() {
1618
int8_t AsyncServer::_accept(tcp_pcb *pcb, int8_t err) {
1619
// ets_printf("+A: 0x%08x\n", pcb);
1620
if (_connect_cb) {
1621
- AsyncClient *c = new AsyncClient(pcb);
+ AsyncClient *c = new (std::nothrow) AsyncClient(pcb);
1622
if (c) {
1623
c->setNoDelay(_noDelay);
1624
const int8_t err = _tcp_accept(this, c);
1625
if (err != ERR_OK) {
1626
+ tcp_abort(pcb);
1627
delete c;
1628
}
1629
return err;
1630
1631
- if (tcp_close(pcb) != ERR_OK) {
1632
- tcp_abort(pcb);
1633
- }
1634
- log_d("FAIL");
+ log_d("_accept failed");
1635
return ERR_OK;
1636
1637
0 commit comments