replace wrong calls to cbuf->size in UDP
This commit is contained in:
parent
4395efa3fc
commit
f49ac391b2
@ -205,13 +205,13 @@ int WiFiUDP::parsePacket(){
|
|||||||
|
|
||||||
int WiFiUDP::available(){
|
int WiFiUDP::available(){
|
||||||
if(!rx_buffer) return 0;
|
if(!rx_buffer) return 0;
|
||||||
return rx_buffer->size();
|
return rx_buffer->available();
|
||||||
}
|
}
|
||||||
|
|
||||||
int WiFiUDP::read(){
|
int WiFiUDP::read(){
|
||||||
if(!rx_buffer) return -1;
|
if(!rx_buffer) return -1;
|
||||||
int out = rx_buffer->read();
|
int out = rx_buffer->read();
|
||||||
if(!rx_buffer->size()){
|
if(!rx_buffer->available()){
|
||||||
cbuf *b = rx_buffer;
|
cbuf *b = rx_buffer;
|
||||||
rx_buffer = 0;
|
rx_buffer = 0;
|
||||||
delete b;
|
delete b;
|
||||||
@ -226,7 +226,7 @@ int WiFiUDP::read(unsigned char* buffer, size_t len){
|
|||||||
int WiFiUDP::read(char* buffer, size_t len){
|
int WiFiUDP::read(char* buffer, size_t len){
|
||||||
if(!rx_buffer) return 0;
|
if(!rx_buffer) return 0;
|
||||||
int out = rx_buffer->read(buffer, len);
|
int out = rx_buffer->read(buffer, len);
|
||||||
if(!rx_buffer->size()){
|
if(!rx_buffer->available()){
|
||||||
cbuf *b = rx_buffer;
|
cbuf *b = rx_buffer;
|
||||||
rx_buffer = 0;
|
rx_buffer = 0;
|
||||||
delete b;
|
delete b;
|
||||||
|
Loading…
Reference in New Issue
Block a user