mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
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:
parent
610b67fd8b
commit
81d8014af8
@ -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);
|
||||
|
@ -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*/
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user