MINOR: shctx: Remove explicit 'from' param from shctx_row_data_append

This parameter is not necessary since the first element of a row always
has a pointer to the row's tail.
This commit is contained in:
Remi Tricot-Le Breton 2023-11-16 17:38:14 +01:00 committed by William Lallemand
parent 610b67fd8b
commit 81d8014af8
4 changed files with 6 additions and 7 deletions

View File

@ -27,7 +27,7 @@ struct shared_block *shctx_row_reserve_hot(struct shared_context *shctx,
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);

View File

@ -682,7 +682,7 @@ cache_store_http_payload(struct stream *s, struct filter *filter, struct http_ms
}
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;
@ -1240,7 +1240,7 @@ enum act_return http_action_store_cache(struct act_rule *rule, struct proxy *px,
*/
/* 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*/

View File

@ -167,8 +167,7 @@ void shctx_row_dec_hot(struct shared_context *shctx, struct shared_block *first)
* 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;
@ -178,7 +177,7 @@ int shctx_row_data_append(struct shared_context *shctx,
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)

View File

@ -4260,7 +4260,7 @@ static int sh_ssl_sess_store(unsigned char *s_id, unsigned char *data, int data_
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;
}