Commit 9c20010b authored by Marek Vavruša's avatar Marek Vavruša

libknot/processing: moved packet parsing out of overlay_consume()

the overlay may be used for cached data now, and it's not okay to reparse
it if not needed or wanted
parent b9b323a3
...@@ -144,6 +144,7 @@ static int tcp_handle(tcp_context_t *tcp, int fd, ...@@ -144,6 +144,7 @@ static int tcp_handle(tcp_context_t *tcp, int fd,
knot_overlay_add(&tcp->overlay, NS_PROC_QUERY, &param); knot_overlay_add(&tcp->overlay, NS_PROC_QUERY, &param);
/* Input packet. */ /* Input packet. */
(void) knot_pkt_parse(query, 0);
int state = knot_overlay_consume(&tcp->overlay, query); int state = knot_overlay_consume(&tcp->overlay, query);
/* Resolve until NOOP or finished. */ /* Resolve until NOOP or finished. */
......
...@@ -134,6 +134,7 @@ void udp_handle(udp_context_t *udp, int fd, struct sockaddr_storage *ss, ...@@ -134,6 +134,7 @@ void udp_handle(udp_context_t *udp, int fd, struct sockaddr_storage *ss,
knot_overlay_add(&udp->overlay, NS_PROC_QUERY, &param); knot_overlay_add(&udp->overlay, NS_PROC_QUERY, &param);
/* Input packet. */ /* Input packet. */
(void) knot_pkt_parse(query, 0);
int state = knot_overlay_consume(&udp->overlay, query); int state = knot_overlay_consume(&udp->overlay, query);
/* Process answer. */ /* Process answer. */
......
...@@ -89,8 +89,6 @@ int knot_overlay_consume(struct knot_overlay *overlay, knot_pkt_t *pkt) ...@@ -89,8 +89,6 @@ int knot_overlay_consume(struct knot_overlay *overlay, knot_pkt_t *pkt)
return overlay->state; return overlay->state;
} }
knot_pkt_parse(pkt, 0);
ITERATE_LAYERS(overlay, knot_layer_consume, pkt); ITERATE_LAYERS(overlay, knot_layer_consume, pkt);
} }
......
...@@ -255,6 +255,7 @@ static int request_io(struct knot_requestor *req, struct knot_request *last, ...@@ -255,6 +255,7 @@ static int request_io(struct knot_requestor *req, struct knot_request *last,
return ret; return ret;
} }
(void) knot_pkt_parse(query, 0);
knot_overlay_consume(&req->overlay, resp); knot_overlay_consume(&req->overlay, resp);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment