From da00619c4ab24766a2288cc35fdebbe9f805c90b Mon Sep 17 00:00:00 2001 From: Constantine Date: Tue, 15 Aug 2023 20:59:09 +0300 Subject: [PATCH] Rework HTTP1 request adjusting (Part 2/2) `tfw_http_msg_expand_from_pool` splitted into two functions first `tfw_http_msg_expand_from_pool` for HTTP1 messages and second `tfw_h2_msg_expand_from_pool` for HTTP2 messages. --- fw/cache.c | 13 ++++----- fw/hpack.c | 31 ++++++++++---------- fw/http.c | 40 ++++++++++++------------- fw/http_msg.c | 61 ++++++++++++++++++++++++++------------- fw/http_msg.h | 13 +++++---- fw/http_sess.c | 7 ++--- fw/t/unit/test_http_msg.c | 6 ++-- 7 files changed, 94 insertions(+), 77 deletions(-) diff --git a/fw/cache.c b/fw/cache.c index 148545e637..965588e88f 100644 --- a/fw/cache.c +++ b/fw/cache.c @@ -637,7 +637,7 @@ tfw_cache_h2_write(TDB *db, TdbVRec **trec, TfwHttpResp *resp, char **data, TfwStr c = { 0 }; TdbVRec *tr = *trec; TfwHttpTransIter *mit = &resp->mit; - TfwMsgIter *it = &mit->iter; + TfwMsgIter *it = &resp->iter; int r = 0, copied = 0; while (1) { @@ -713,7 +713,7 @@ tfw_cache_set_status(TDB *db, TfwCacheEntry *ce, TfwHttpResp *resp, TdbVRec **trec, char **p, unsigned long *acc_len) { int r; - TfwMsgIter *it = &resp->mit.iter; + TfwMsgIter *it = &resp->iter; struct sk_buff **skb_head = &resp->msg.skb_head; bool h2_mode = TFW_MSG_H2(resp->req); TfwDecodeCacheIter dc_iter = {}; @@ -906,7 +906,7 @@ tfw_cache_send_304(TfwHttpReq *req, TfwCacheEntry *ce) if (!(resp = tfw_http_msg_alloc_resp_light(req))) goto err_create; - it = &resp->mit.iter; + it = &resp->iter; skb_head = &resp->msg.skb_head; if (!TFW_MSG_H2(req)) { @@ -2628,7 +2628,6 @@ tfw_cache_set_hdr_age(TfwHttpResp *resp, TfwCacheEntry *ce) int r; size_t digs; bool to_h2 = TFW_MSG_H2(resp->req); - TfwHttpTransIter *mit = &resp->mit; struct sk_buff **skb_head = &resp->msg.skb_head; long age = tfw_cache_entry_age(ce); char cstr_age[TFW_ULTOA_BUF_SIZ] = {0}; @@ -2657,11 +2656,11 @@ tfw_cache_set_hdr_age(TfwHttpResp *resp, TfwCacheEntry *ce) if ((r = tfw_hpack_encode(resp, &h_age, false, false))) goto err; } else { - if ((r = tfw_http_msg_expand_data(&mit->iter, skb_head, + if ((r = tfw_http_msg_expand_data(&resp->iter, skb_head, &h_age, NULL))) goto err; - if ((r = tfw_http_msg_expand_data(&mit->iter, skb_head, + if ((r = tfw_http_msg_expand_data(&resp->iter, skb_head, &g_crlf, NULL))) goto err; } @@ -2750,7 +2749,7 @@ tfw_cache_build_resp(TfwHttpReq *req, TfwCacheEntry *ce, long lifetime, mit = &resp->mit; skb_head = &resp->msg.skb_head; WARN_ON_ONCE(mit->acc_len); - it = &mit->iter; + it = &resp->iter; /* * Set 'set-cookie' header if needed, for HTTP/2 or HTTP/1.1 diff --git a/fw/hpack.c b/fw/hpack.c index ee6cc20b43..8aba542f8a 100644 --- a/fw/hpack.c +++ b/fw/hpack.c @@ -1773,8 +1773,7 @@ tfw_hpack_cache_decode_expand(TfwHPack *__restrict hp, unsigned int state; int r = T_OK; TfwStr exp_str = {}; - TfwHttpTransIter *mit = &resp->mit; - TfwMsgIter *it = &mit->iter; + TfwMsgIter *it = &resp->iter; const unsigned char *last = src + n; unsigned char *prev = src; struct sk_buff **skb_head = &resp->msg.skb_head; @@ -3366,7 +3365,7 @@ tfw_hpack_write_idx(TfwHttpResp *__restrict resp, TfwHPackInt *__restrict idx, bool use_pool) { TfwHttpTransIter *mit = &resp->mit; - TfwMsgIter *iter = &mit->iter; + TfwMsgIter *iter = &resp->iter; struct sk_buff **skb_head = &resp->msg.skb_head; const TfwStr s_idx = { .data = idx->buf, @@ -3378,8 +3377,8 @@ tfw_hpack_write_idx(TfwHttpResp *__restrict resp, TfwHPackInt *__restrict idx, s_idx.data); if (use_pool) - return tfw_http_msg_expand_from_pool((TfwHttpMsg *)resp, - &s_idx); + return tfw_h2_msg_expand_from_pool((TfwHttpMsg *)resp, + &s_idx, &resp->mit); return tfw_http_msg_expand_data(iter, skb_head, &s_idx, &mit->start_off); @@ -3419,14 +3418,16 @@ tfw_hpack_hdr_add(TfwHttpResp *__restrict resp, TfwStr *__restrict hdr, s_nlen.data = nlen.buf; s_nlen.len = nlen.sz; - r = tfw_http_msg_expand_from_pool(msg, &s_nlen); + r = tfw_h2_msg_expand_from_pool(msg, &s_nlen, &resp->mit); if (unlikely(r)) return r; if (trans) - r = tfw_http_msg_expand_from_pool_lc(msg, &s_name); + r = tfw_h2_msg_expand_from_pool_lc(msg, &s_name, + &resp->mit); else - r = tfw_http_msg_expand_from_pool(msg, &s_name); + r = tfw_h2_msg_expand_from_pool(msg, &s_name, + &resp->mit); if (unlikely(r)) return r; } @@ -3435,12 +3436,12 @@ tfw_hpack_hdr_add(TfwHttpResp *__restrict resp, TfwStr *__restrict hdr, s_vlen.data = vlen.buf; s_vlen.len = vlen.sz; - r = tfw_http_msg_expand_from_pool(msg, &s_vlen); + r = tfw_h2_msg_expand_from_pool(msg, &s_vlen, &resp->mit); if (unlikely(r)) return r; if (!TFW_STR_EMPTY(&s_val)) - r = tfw_http_msg_expand_from_pool(msg, &s_val); + r = tfw_h2_msg_expand_from_pool(msg, &s_val, &resp->mit); return r; } @@ -3456,7 +3457,7 @@ tfw_hpack_hdr_expand(TfwHttpResp *__restrict resp, TfwStr *__restrict hdr, int ret; TfwStr *c, *end; TfwHttpTransIter *mit = &resp->mit; - TfwMsgIter *iter = &mit->iter; + TfwMsgIter *iter = &resp->iter; struct sk_buff **skb_head = &resp->msg.skb_head; TfwStr s_val; @@ -3530,7 +3531,7 @@ __tfw_hpack_encode(TfwHttpResp *__restrict resp, TfwStr *__restrict hdr, TfwHPackETbl *tbl = &ctx->hpack.enc_tbl; int r = HPACK_IDX_ST_NOT_FOUND; bool name_indexed = true; - struct sk_buff *skb = resp->mit.iter.skb; + struct sk_buff *skb = resp->iter.skb; if (WARN_ON_ONCE(!hdr || TFW_STR_EMPTY(hdr))) return -EINVAL; @@ -3607,14 +3608,14 @@ __tfw_hpack_encode(TfwHttpResp *__restrict resp, TfwStr *__restrict hdr, * Very long headers can be located in several skbs, * mark them all. */ - while(skb && unlikely(skb != resp->mit.iter.skb)) { + while(skb && unlikely(skb != resp->iter.skb)) { skb_set_tfw_flags(skb, SS_F_HTTT2_FRAME_HEADERS); skb_set_tfw_cb(skb, resp->req->stream->id); skb = skb->next; } - skb_set_tfw_flags(resp->mit.iter.skb, SS_F_HTTT2_FRAME_HEADERS); - skb_set_tfw_cb(resp->mit.iter.skb, resp->req->stream->id); + skb_set_tfw_flags(resp->iter.skb, SS_F_HTTT2_FRAME_HEADERS); + skb_set_tfw_cb(resp->iter.skb, resp->req->stream->id); } return r; } diff --git a/fw/http.c b/fw/http.c index c30733a131..724b03c9d4 100644 --- a/fw/http.c +++ b/fw/http.c @@ -606,7 +606,7 @@ tfw_h2_prep_resp(TfwHttpResp *resp, unsigned short status, TfwStr *msg, __TFW_STR_CH(&hdr, 0)->len = name->len - SLEN(S_CRLF) - 2; if (__TFW_STR_CH(msg, i + 1)->nchunks) { - TfwMsgIter *iter = &mit->iter; + TfwMsgIter *iter = &resp->iter; struct sk_buff **skb_head = &resp->msg.skb_head; TfwHPackInt vlen; TfwStr s_vlen = {}; @@ -647,7 +647,7 @@ tfw_h2_prep_resp(TfwHttpResp *resp, unsigned short status, TfwStr *msg, * Responses built locally has room for frame header reserved * in SKB linear data. */ - mit->frame_head = mit->iter.skb->data; + mit->frame_head = resp->iter.skb->data; hdrs_len += mit->acc_len; @@ -2930,7 +2930,6 @@ int tfw_http_expand_hbh(TfwHttpResp *resp, unsigned short status) { TfwHttpReq *req = resp->req; - TfwHttpTransIter *mit = &resp->mit; struct sk_buff **skb_head = &resp->msg.skb_head; bool proxy_close = test_bit(TFW_HTTP_B_CONN_CLOSE, resp->flags) && (status / 100 == 4); @@ -2968,7 +2967,7 @@ tfw_http_expand_hbh(TfwHttpResp *resp, unsigned short status) tfw_http_req_set_conn_close(req); return add_h_conn - ? tfw_http_msg_expand_data(&mit->iter, skb_head, &h_conn, NULL) + ? tfw_http_msg_expand_data(&resp->iter, skb_head, &h_conn, NULL) : 0; } @@ -3027,7 +3026,6 @@ tfw_http_expand_stale_warn(TfwHttpResp *resp) { /* TODO: adjust for #865 */ struct sk_buff **skb_head = &resp->msg.skb_head; - TfwHttpTransIter *mit = &resp->mit; TfwStr wh = { .chunks = (TfwStr []){ { .data = S_WARN, .len = SLEN(S_WARN) }, @@ -3039,7 +3037,7 @@ tfw_http_expand_stale_warn(TfwHttpResp *resp) .nchunks = 4, }; - return tfw_http_msg_expand_data(&mit->iter, skb_head, &wh, NULL); + return tfw_http_msg_expand_data(&resp->iter, skb_head, &wh, NULL); } static inline int @@ -3047,7 +3045,6 @@ __tfw_http_add_hdr_date(TfwHttpResp *resp, bool cache) { int r; struct sk_buff **skb_head = &resp->msg.skb_head; - TfwHttpTransIter *mit = &resp->mit; char *date = *this_cpu_ptr(&g_buf); TfwStr h_date = { .chunks = (TfwStr []) { @@ -3064,7 +3061,7 @@ __tfw_http_add_hdr_date(TfwHttpResp *resp, bool cache) if (!cache) r = tfw_http_msg_expand_from_pool((TfwHttpMsg *)resp, &h_date); else - r = tfw_http_msg_expand_data(&mit->iter, skb_head, &h_date, + r = tfw_http_msg_expand_data(&resp->iter, skb_head, &h_date, NULL); if (unlikely(r)) @@ -3098,14 +3095,13 @@ __tfw_http_add_hdr_server(TfwHttpResp *resp, bool cache) { int r; struct sk_buff **skb_head = &resp->msg.skb_head; - TfwHttpTransIter *mit = &resp->mit; static char s_server[] = S_F_SERVER TFW_NAME "/" TFW_VERSION S_CRLF; TfwStr hdr = { .data = s_server, .len = SLEN(s_server) }; if (!cache) r = tfw_http_msg_expand_from_pool((TfwHttpMsg *)resp, &hdr); else - r = tfw_http_msg_expand_data(&mit->iter, skb_head, &hdr, NULL); + r = tfw_http_msg_expand_data(&resp->iter, skb_head, &hdr, NULL); if (unlikely(r)) T_ERR("Unable to add Server: header to resp [%p]\n", resp); @@ -3163,13 +3159,13 @@ __tfw_http_add_hdr_via(TfwHttpMsg *hm, int http_version, bool from_cache) &TFW_STR_STRING(S_CRLF)); } else { struct sk_buff **skb_head = &hm->msg.skb_head; - TfwHttpTransIter *mit = &((TfwHttpResp *)hm)->mit; + TfwMsgIter *it = &hm->iter; TfwStr crlf = { .data = S_CRLF, .len = SLEN(S_CRLF) }; - r = tfw_http_msg_expand_data(&mit->iter, skb_head, &rh, NULL); + r = tfw_http_msg_expand_data(it, skb_head, &rh, NULL); if (unlikely(r)) goto err; - r = tfw_http_msg_expand_data(&mit->iter, skb_head, &crlf, NULL); + r = tfw_http_msg_expand_data(it, skb_head, &crlf, NULL); } if (unlikely(r)) @@ -4098,12 +4094,12 @@ tfw_h1_purge_resp_clean(TfwHttpResp *resp, TfwHttpMsgCleanup *cleanup) static int tfw_http_adjust_resp(TfwHttpResp *resp) { - int r, hdr_start = TFW_HTTP_HDR_CONTENT_LENGTH;; + int r, hdr_start = TFW_HTTP_HDR_CONTENT_LENGTH; TfwHttpReq *req = resp->req; TfwHttpMsg *hm = (TfwHttpMsg *)resp; unsigned long conn_flg = 0; TfwHttpMsgCleanup cleanup = {}; - TfwHttpTransIter *mit = &resp->mit; + TfwMsgIter *iter = &resp->iter; TfwStr *pos, *end, *s_line = &resp->h_tbl->tbl[TFW_HTTP_STATUS_LINE]; static const DEFINE_TFW_STR(crlf, S_CRLF); const TfwHdrMods *h_mods = tfw_vhost_get_hdr_mods(req->location, @@ -4138,13 +4134,13 @@ tfw_http_adjust_resp(TfwHttpResp *resp) if (unlikely(r)) goto clean; - tfw_h2_msg_transform_setup(mit, resp->msg.skb_head); + tfw_msg_transform_setup(iter, resp->msg.skb_head); } else { /* * When response doesn't have body, just remove * headers and use current skb as skb head. */ - tfw_h2_msg_transform_setup(mit, resp->msg.skb_head); + tfw_msg_transform_setup(iter, resp->msg.skb_head); r = tfw_http_msg_cutoff_headers(hm, &cleanup); if (unlikely(r)) @@ -4169,7 +4165,7 @@ tfw_http_adjust_resp(TfwHttpResp *resp) hdr_start = TFW_HTTP_HDR_CONTENT_TYPE; } else { /* Response for regular request. */ - tfw_h2_msg_transform_setup(mit, resp->msg.skb_head); + tfw_msg_transform_setup(iter, resp->msg.skb_head); r = tfw_http_msg_cutoff_headers(hm, &cleanup); if (unlikely(r)) goto clean; @@ -4870,8 +4866,7 @@ static int tfw_h2_append_predefined_body(TfwHttpResp *resp, unsigned int stream_id, const TfwStr *body) { - TfwHttpTransIter *mit = &resp->mit; - TfwMsgIter *it = &mit->iter; + TfwMsgIter *it = &resp->iter; size_t len, max_copy = PAGE_SIZE; char *data; int r; @@ -5323,7 +5318,8 @@ tfw_h2_resp_adjust_fwd(TfwHttpResp *resp) * adjusting of particular headers. */ WARN_ON_ONCE(mit->acc_len); - tfw_h2_msg_transform_setup(mit, resp->msg.skb_head); + BUG_ON(mit->frame_head); + tfw_msg_transform_setup(&resp->iter, resp->msg.skb_head); if (tfw_http_msg_cutoff_headers((TfwHttpMsg *)resp, &cleanup)) goto clean; @@ -5332,7 +5328,7 @@ tfw_h2_resp_adjust_fwd(TfwHttpResp *resp) * Alloc room for frame header. After this call resp->pool * must be used only as skb paged data. */ - r = tfw_http_msg_setup_transform_pool(mit, resp->pool); + r = tfw_http_msg_setup_transform_pool(mit, &resp->iter, resp->pool); if (unlikely(r)) goto clean; diff --git a/fw/http_msg.c b/fw/http_msg.c index b5ab5e8512..97f23bbdde 100644 --- a/fw/http_msg.c +++ b/fw/http_msg.c @@ -1323,16 +1323,16 @@ tfw_http_msg_alloc_from_pool(TfwMsgIter *it, TfwPool* pool, size_t size) * data, which will split the paged fragment. */ int -tfw_http_msg_setup_transform_pool(TfwHttpTransIter *mit, TfwPool* pool) +tfw_http_msg_setup_transform_pool(TfwHttpTransIter *mit, TfwMsgIter *it, + TfwPool* pool) { int r; char* addr; bool np; - TfwMsgIter *it = &mit->iter; unsigned int room = TFW_POOL_CHUNK_ROOM(pool); BUG_ON(room < 0); - BUG_ON(mit->iter.frag > 0); + BUG_ON(it->frag > 0); /* Alloc a full page if room smaller than MIN_FRAG_SIZE. */ if (room < MIN_HDR_FRAG_SIZE) @@ -1349,7 +1349,7 @@ tfw_http_msg_setup_transform_pool(TfwHttpTransIter *mit, TfwPool* pool) if (unlikely(r)) return r; - ss_skb_adjust_data_len(mit->iter.skb, FRAME_HEADER_SIZE); + ss_skb_adjust_data_len(it->skb, FRAME_HEADER_SIZE); mit->frame_head = addr; mit->curr_ptr = addr + FRAME_HEADER_SIZE; @@ -1362,7 +1362,7 @@ tfw_http_msg_setup_transform_pool(TfwHttpTransIter *mit, TfwPool* pool) static inline int __tfw_http_msg_move_body(TfwHttpMsg *resp, struct sk_buff *nskb) { - TfwMsgIter *it = &resp->mit.iter; + TfwMsgIter *it = &resp->iter; struct sk_buff **body; int r, frag; char *p; @@ -1427,12 +1427,13 @@ __tfw_http_msg_linear_transform(TfwMsgIter *it) */ static int __tfw_http_msg_expand_from_pool(TfwHttpMsg *hm, const TfwStr *str, + unsigned int *copied, void cpy(void *dest, const void *src, size_t n)) { int r; + char *addr; const TfwStr *c, *end; - unsigned int room, skb_room, n_copy, rlen, off; - TfwHttpTransIter *mit = &hm->mit; + unsigned int room, skb_room, n_copy, rlen, off, acc = 0; TfwMsgIter *it = &hm->iter; TfwPool* pool = hm->pool; @@ -1502,35 +1503,55 @@ __tfw_http_msg_expand_from_pool(TfwHttpMsg *hm, const TfwStr *str, n_copy = min(n_copy, skb_room); - mit->curr_ptr = tfw_http_msg_alloc_from_pool(it, pool, - n_copy); - if (unlikely(!mit->curr_ptr)) + addr = tfw_http_msg_alloc_from_pool(it, pool, n_copy); + if (unlikely(!addr)) return r; - cpy(mit->curr_ptr, c->data + off, n_copy); + cpy(addr, c->data + off, n_copy); rlen -= n_copy; - mit->acc_len += n_copy; - mit->curr_ptr += n_copy; + acc += n_copy; - T_DBG3("%s: acc_len=%lu, n_copy=%u, mit->curr_ptr=%pK", - __func__, mit->acc_len, - n_copy, mit->curr_ptr); + T_DBG3("%s: n_copy=%u", __func__, n_copy,); } } + *copied = acc; + return 0; } int tfw_http_msg_expand_from_pool(TfwHttpMsg *hm, const TfwStr *str) { - return __tfw_http_msg_expand_from_pool(hm, str, memcpy_fast); + unsigned int n; + + return __tfw_http_msg_expand_from_pool(hm, str, &n, memcpy_fast); } int -tfw_http_msg_expand_from_pool_lc(TfwHttpMsg *hm, const TfwStr *str) +tfw_h2_msg_expand_from_pool(TfwHttpMsg *hm, const TfwStr *str, + TfwHttpTransIter *mit) { - return __tfw_http_msg_expand_from_pool(hm, str, tfw_cstrtolower); + int r; + unsigned int n; + + r = __tfw_http_msg_expand_from_pool(hm, str, &n, memcpy_fast); + mit->acc_len += n; + + return r; +} + +int +tfw_h2_msg_expand_from_pool_lc(TfwHttpMsg *hm, const TfwStr *str, + TfwHttpTransIter *mit) +{ + int r; + unsigned int n; + + r = __tfw_http_msg_expand_from_pool(hm, str, &n, tfw_cstrtolower); + mit->acc_len += n; + + return r; } static inline void @@ -1595,7 +1616,7 @@ tfw_http_msg_cutoff_headers(TfwHttpMsg *hm, TfwHttpMsgCleanup* cleanup) { int i, ret; char *begin, *end; - TfwMsgIter *it = &hm->mit.iter; + TfwMsgIter *it = &hm->iter; char* body = TFW_STR_CHUNK(&hm->body, 0)->data; TfwStr *crlf = TFW_STR_LAST(&hm->crlf); char *off = body ? body : crlf->data + crlf->len; diff --git a/fw/http_msg.h b/fw/http_msg.h index 1c31e851b9..2baef5f72d 100644 --- a/fw/http_msg.h +++ b/fw/http_msg.h @@ -106,12 +106,9 @@ tfw_http_msg_alloc_resp_light(TfwHttpReq *req) } static inline void -tfw_h2_msg_transform_setup(TfwHttpTransIter *mit, struct sk_buff *skb) +tfw_msg_transform_setup(TfwMsgIter *iter, struct sk_buff *skb) { - TfwMsgIter *iter = &mit->iter; - BUG_ON(!skb); - BUG_ON(mit->frame_head); iter->frag = -1; iter->skb = skb; @@ -168,9 +165,13 @@ int tfw_http_msg_grow_hdr_tbl(TfwHttpMsg *hm); void tfw_http_msg_free(TfwHttpMsg *m); int tfw_http_msg_expand_data(TfwMsgIter *it, struct sk_buff **skb_head, const TfwStr *src, unsigned int *start_off); -int tfw_http_msg_setup_transform_pool(TfwHttpTransIter *mit, TfwPool* pool); +int tfw_http_msg_setup_transform_pool(TfwHttpTransIter *mit, TfwMsgIter *it, + TfwPool* pool); int tfw_http_msg_expand_from_pool(TfwHttpMsg *hm, const TfwStr *str); -int tfw_http_msg_expand_from_pool_lc(TfwHttpMsg *hm, const TfwStr *str); +int tfw_h2_msg_expand_from_pool(TfwHttpMsg *hm, const TfwStr *str, + TfwHttpTransIter *mit); +int tfw_h2_msg_expand_from_pool_lc(TfwHttpMsg *hm, const TfwStr *str, + TfwHttpTransIter *mit); int __hdr_name_cmp(const TfwStr *hdr, const TfwStr *cmp_hdr); int __http_hdr_lookup(TfwHttpMsg *hm, const TfwStr *hdr); int tfw_http_msg_cutoff_headers(TfwHttpMsg *hm, TfwHttpMsgCleanup* cleanup); diff --git a/fw/http_sess.c b/fw/http_sess.c index b8eb83d36c..3df7eea03f 100644 --- a/fw/http_sess.c +++ b/fw/http_sess.c @@ -432,14 +432,13 @@ tfw_http_sticky_add(TfwHttpResp *resp, bool cache) if (unlikely(r)) goto err; } else if (cache) { - TfwHttpTransIter *mit = &resp->mit; + TfwMsgIter *it = &resp->iter; struct sk_buff **skb_head = &resp->msg.skb_head; - r = tfw_http_msg_expand_data(&mit->iter, skb_head, - &set_cookie, NULL); + r = tfw_http_msg_expand_data(it, skb_head, &set_cookie, NULL); if (unlikely(r)) goto err; - r = tfw_http_msg_expand_data(&mit->iter, skb_head, &crlf, NULL); + r = tfw_http_msg_expand_data(it, skb_head, &crlf, NULL); } else { r = tfw_http_msg_expand_from_pool(hm, &set_cookie); if (unlikely(r)) diff --git a/fw/t/unit/test_http_msg.c b/fw/t/unit/test_http_msg.c index 0ffdf1490c..878a39472d 100644 --- a/fw/t/unit/test_http_msg.c +++ b/fw/t/unit/test_http_msg.c @@ -103,7 +103,7 @@ __test_resp_alloc(TfwStr *head_data, TfwStr *paged_data, return NULL; skb->next = skb->prev = skb; - it = &hmresp->mit.iter; + it = &hmresp->iter; it->skb = it->skb_head = skb; it->frag = -1; @@ -149,7 +149,7 @@ TEST(http_msg, expand_from_pool) if (!resp) return; - it = &resp->mit.iter; + it = &resp->iter; EXPECT_FALSE(it->skb->data_len == head->len + hdr->len + pgd->len); tfw_http_msg_expand_from_pool((TfwHttpMsg *)resp, hdr); @@ -197,7 +197,7 @@ do { \ if (!resp) return; - it = &resp->mit.iter; + it = &resp->iter; EXPECT_FALSE(it->skb->data_len == skbsz); tfw_http_msg_expand_from_pool((TfwHttpMsg *)resp, &hdr);