Skip to content

Commit 638db1d

Browse files
authored
Merge branch 'espressif:master' into master
2 parents d74fc5d + 1c3384c commit 638db1d

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

cores/esp32/HWCDC.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ void HWCDC::setTxTimeoutMs(uint32_t timeout){
218218

219219
size_t HWCDC::setTxBufferSize(size_t tx_queue_len){
220220
if(tx_ring_buf){
221-
if(!tx_queue_len){
222-
vRingbufferDelete(tx_ring_buf);
223-
tx_ring_buf = NULL;
224-
}
221+
vRingbufferDelete(tx_ring_buf);
222+
tx_ring_buf = NULL;
223+
}
224+
if(!tx_queue_len){
225225
return 0;
226226
}
227227
tx_ring_buf = xRingbufferCreate(tx_queue_len, RINGBUF_TYPE_BYTEBUF);
@@ -319,19 +319,16 @@ void HWCDC::flush(void)
319319

320320
size_t HWCDC::setRxBufferSize(size_t rx_queue_len){
321321
if(rx_queue){
322-
if(!rx_queue_len){
323-
vQueueDelete(rx_queue);
324-
rx_queue = NULL;
325-
}
322+
vQueueDelete(rx_queue);
323+
rx_queue = NULL;
324+
}
325+
if(!rx_queue_len){
326326
return 0;
327327
}
328328
rx_queue = xQueueCreate(rx_queue_len, sizeof(uint8_t));
329329
if(!rx_queue){
330330
return 0;
331331
}
332-
if(!tx_ring_buf){
333-
tx_ring_buf = xRingbufferCreate(rx_queue_len, RINGBUF_TYPE_BYTEBUF);
334-
}
335332
return rx_queue_len;
336333
}
337334

libraries/WebServer/src/WebServer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,17 +285,16 @@ void WebServer::serveStatic(const char* uri, FS& fs, const char* path, const cha
285285

286286
void WebServer::handleClient() {
287287
if (_currentStatus == HC_NONE) {
288-
WiFiClient client = _server.available();
289-
if (!client) {
288+
_currentClient = _server.available();
289+
if (!_currentClient) {
290290
if (_nullDelay) {
291291
delay(1);
292292
}
293293
return;
294294
}
295295

296-
log_v("New client: client.localIP()=%s", client.localIP().toString().c_str());
296+
log_v("New client: client.localIP()=%s", _currentClient.localIP().toString().c_str());
297297

298-
_currentClient = client;
299298
_currentStatus = HC_WAIT_READ;
300299
_statusChange = millis();
301300
}

0 commit comments

Comments
 (0)