void shctx_row_inc_hot(struct shared_context *shctx, struct shared_block *first);
void shctx_row_dec_hot(struct shared_context *shctx, struct shared_block *first);
int shctx_row_data_append(struct shared_context *shctx,
- struct shared_block *first, struct shared_block *from,
+ struct shared_block *first,
unsigned char *data, int len);
int shctx_row_data_get(struct shared_context *shctx, struct shared_block *first,
unsigned char *dst, int offset, int len);
}
shctx_unlock(shctx);
- ret = shctx_row_data_append(shctx, st->first_block, st->first_block->last_append,
+ ret = shctx_row_data_append(shctx, st->first_block,
(unsigned char *)b_head(&trash), b_data(&trash));
if (ret < 0)
goto no_cache;
*/
/* does not need to be locked because it's in the "hot" list,
* copy the headers */
- if (shctx_row_data_append(shctx, first, NULL, (unsigned char *)trash.area, trash.data) < 0)
+ if (shctx_row_data_append(shctx, first, (unsigned char *)trash.area, trash.data) < 0)
goto out;
/* register the buffer in the filter ctx for filling it with data*/
* Return the amount of appended data if ret >= 0
* or how much more space it needs to contains the data if < 0.
*/
-int shctx_row_data_append(struct shared_context *shctx,
- struct shared_block *first, struct shared_block *from,
+int shctx_row_data_append(struct shared_context *shctx, struct shared_block *first,
unsigned char *data, int len)
{
int remain, start;
if (len > first->block_count * shctx->block_size - first->len)
return (first->block_count * shctx->block_size - first->len) - len;
- block = from ? from : first;
+ block = first->last_append ? first->last_append : first;
list_for_each_entry_from(block, &shctx->hot, list) {
/* end of copy */
if (len <= 0)
first->len = sizeof(struct sh_ssl_sess_hdr);
}
- if (shctx_row_data_append(ssl_shctx, first, NULL, data, data_len) < 0) {
+ if (shctx_row_data_append(ssl_shctx, first, data, data_len) < 0) {
shctx_row_dec_hot(ssl_shctx, first);
return 0;
}