Add epoll support, fix ETCP timestamp bug, optimize uasync with cached pollfds
This commit is contained in:
1 parent
7bd369341b
commit
8a3f01fbf8
20 files changed
+62
-28
No files matched your search
+6
-4
@@ -242,7 +242,8 @@ int queue_data_put(struct ll_queue* q, struct ll_entry* entry, uint32_t id) {
|
||||
q->tail = entry;
|
||||
|
||||
q->count++;
|
||||
q->total_bytes += entry->size;
|
||||
entry->int_len=entry->len;
|
||||
q->total_bytes += entry->int_len;
|
||||
|
||||
size_t send_q_bytes = queue_total_bytes(q);
|
||||
// DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "check total bytes: new_q_len=%d element_size:%d", send_q_bytes, entry->size);
|
||||
@@ -284,7 +285,8 @@ int queue_data_put_first(struct ll_queue* q, struct ll_entry* entry, uint32_t id
|
||||
q->head = entry;
|
||||
|
||||
q->count++;
|
||||
q->total_bytes += entry->size;
|
||||
entry->int_len=entry->len;
|
||||
q->total_bytes += entry->int_len;
|
||||
|
||||
add_to_hash(q, entry);
|
||||
|
||||
@@ -311,7 +313,7 @@ struct ll_entry* queue_data_get(struct ll_queue* q) {
|
||||
if (!q->head) q->tail = NULL;
|
||||
|
||||
q->count--;
|
||||
q->total_bytes -= entry->size;
|
||||
q->total_bytes -= entry->int_len;
|
||||
|
||||
entry->next = NULL;
|
||||
entry->prev = NULL;
|
||||
@@ -398,7 +400,7 @@ int queue_remove_data(struct ll_queue* q, struct ll_entry* entry) {
|
||||
}
|
||||
|
||||
q->count--;
|
||||
q->total_bytes -= entry->size;
|
||||
q->total_bytes -= entry->int_len;
|
||||
|
||||
entry->next = NULL;
|
||||
entry->prev = NULL;
|
||||
|
||||
@@ -26,6 +26,7 @@ struct ll_entry {
|
||||
|
||||
uint16_t len; // размер пакета (dgram)
|
||||
uint16_t memlen; // размер выделенной памяти (dgram)
|
||||
uint16_t int_len; // размер (private, not use!)
|
||||
uint8_t* dgram; // данные пакета
|
||||
void (*dgram_free_fn)(uint8_t* data, void* arg); // функция освобождения блока
|
||||
struct memory_pool* dgram_pool; // Пул, из которого выделен этот элемент (NULL, если выделен через malloc)
|
||||
|
||||
Reference in new issue
Block a user