| 258 | } |
| 259 | |
| 260 | TSkBuffer* cache_skip_first_buffer(TRWCache* cache) |
| 261 | { |
| 262 | TSkBuffer* buff = TAILQ_FIRST(&cache->list); |
| 263 | if ((NULL == cache) || (NULL == buff)) |
| 264 | { |
| 265 | return NULL; |
| 266 | } |
| 267 | |
| 268 | TAILQ_REMOVE(&cache->list, buff, entry); |
| 269 | if (cache->len >= buff->data_len) |
| 270 | { |
| 271 | cache->len -= buff->data_len; |
| 272 | } |
| 273 | |
| 274 | if (cache->count > 0) |
| 275 | { |
| 276 | cache->count--; |
| 277 | } |
| 278 | |
| 279 | return buff; |
| 280 | } |
| 281 | |
| 282 | int32_t cache_append_data(TRWCache* cache, const void* data, uint32_t len) |
| 283 | { |