mirror of
https://github.com/me-no-dev/AsyncTCP.git
synced 2025-09-27 23:00:55 +02:00
Applying clang formatting
This commit is contained in:
@@ -179,9 +179,9 @@ static inline bool _get_async_event(lwip_event_packet_t** e) {
|
||||
todo: implement some kind of fair dequeing or (better) simply punish user for a bad designed callbacks by resetting hog connections
|
||||
*/
|
||||
lwip_event_packet_t* next_pkt = NULL;
|
||||
while (xQueuePeek(_async_queue, &next_pkt, 0) == pdPASS){
|
||||
if (next_pkt->arg == (*e)->arg && next_pkt->event == LWIP_TCP_POLL){
|
||||
if (xQueueReceive(_async_queue, &next_pkt, 0) == pdPASS){
|
||||
while (xQueuePeek(_async_queue, &next_pkt, 0) == pdPASS) {
|
||||
if (next_pkt->arg == (*e)->arg && next_pkt->event == LWIP_TCP_POLL) {
|
||||
if (xQueueReceive(_async_queue, &next_pkt, 0) == pdPASS) {
|
||||
free(next_pkt);
|
||||
next_pkt = NULL;
|
||||
log_d("coalescing polls, network congestion or async callbacks might be too slow!");
|
||||
@@ -374,7 +374,7 @@ static int8_t _tcp_connected(void* arg, tcp_pcb* pcb, int8_t err) {
|
||||
|
||||
static int8_t _tcp_poll(void* arg, struct tcp_pcb* pcb) {
|
||||
// throttle polling events queing when event queue is getting filled up, let it handle _onack's
|
||||
//log_d("qs:%u", uxQueueMessagesWaiting(_async_queue));
|
||||
// log_d("qs:%u", uxQueueMessagesWaiting(_async_queue));
|
||||
if (uxQueueMessagesWaiting(_async_queue) > (rand() % CONFIG_ASYNC_TCP_QUEUE_SIZE / 2 + CONFIG_ASYNC_TCP_QUEUE_SIZE / 4)) {
|
||||
log_d("throttling");
|
||||
return ERR_OK;
|
||||
|
@@ -116,7 +116,7 @@ class AsyncClient {
|
||||
*/
|
||||
void close(bool now = false);
|
||||
// same as close()
|
||||
void stop(){ close(false); };
|
||||
void stop() { close(false); };
|
||||
int8_t abort();
|
||||
bool free();
|
||||
|
||||
@@ -169,7 +169,7 @@ class AsyncClient {
|
||||
* @param data
|
||||
* @return size_t
|
||||
*/
|
||||
size_t write(const char* data){ return data == NULL ? 0 : write(data, strlen(data)); };
|
||||
size_t write(const char* data) { return data == NULL ? 0 : write(data, strlen(data)); };
|
||||
|
||||
uint8_t state();
|
||||
bool connecting();
|
||||
|
Reference in New Issue
Block a user