Better buffer reset
This commit is contained in:
parent
7d7b40724c
commit
2d0f285bc2
1 changed files with 3 additions and 0 deletions
|
@ -119,6 +119,7 @@ void mv_buffer_rtof(struct algo_ctx* app_ctx, struct evt_core_fdinfo* from) {
|
||||||
|
|
||||||
bp->mode = BP_READING;
|
bp->mode = BP_READING;
|
||||||
bp->aread = 0;
|
bp->aread = 0;
|
||||||
|
bp->ap_count = 0;
|
||||||
g_queue_push_tail (app_ctx->free_buffer, bp);
|
g_queue_push_tail (app_ctx->free_buffer, bp);
|
||||||
g_hash_table_remove(app_ctx->used_buffer, &(from->fd));
|
g_hash_table_remove(app_ctx->used_buffer, &(from->fd));
|
||||||
}
|
}
|
||||||
|
@ -131,6 +132,7 @@ void mv_buffer_wtof(struct algo_ctx* app_ctx, struct evt_core_fdinfo* fdinfo) {
|
||||||
}
|
}
|
||||||
bp->mode = BP_READING;
|
bp->mode = BP_READING;
|
||||||
bp->aread = 0;
|
bp->aread = 0;
|
||||||
|
bp->ap_count = 0;
|
||||||
g_queue_push_tail (app_ctx->free_buffer, bp);
|
g_queue_push_tail (app_ctx->free_buffer, bp);
|
||||||
g_hash_table_remove(app_ctx->used_buffer, &(fdinfo->fd));
|
g_hash_table_remove(app_ctx->used_buffer, &(fdinfo->fd));
|
||||||
}
|
}
|
||||||
|
@ -187,6 +189,7 @@ void mv_buffer_atof(struct algo_ctx* app_ctx, void* from) {
|
||||||
// 2. Reset it
|
// 2. Reset it
|
||||||
bp->mode = BP_READING;
|
bp->mode = BP_READING;
|
||||||
bp->aread = 0;
|
bp->aread = 0;
|
||||||
|
bp->ap_count = 0;
|
||||||
|
|
||||||
// 3. We move it
|
// 3. We move it
|
||||||
g_hash_table_remove (app_ctx->application_waiting, from);
|
g_hash_table_remove (app_ctx->application_waiting, from);
|
||||||
|
|
Loading…
Reference in a new issue