[MEDIUM] http: fix handling of message pointers
Some message pointers were not usable once the message reached the
HTTP_MSG_DONE state. This is the case for ->som which points to the
body because it is needed to parse chunks. There is one case where
we need the beginning of the message : server redirect. We have to
call http_get_path() after the request has been parsed. So we rely
on ->sol without counting on ->som. In order to achieve this, we're
making ->rq.{u,v} relative to the beginning of the message instead
of the buffer. That simplifies the code and makes it cleaner.
Preliminary tests show this is OK.
diff --git a/src/backend.c b/src/backend.c
index 34783f5..3d815ac 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -535,19 +535,19 @@
case BE_LB_HASH_URI:
/* URI hashing */
s->srv = get_server_uh(s->be,
- s->txn.req.sol - s->txn.req.som + s->txn.req.sl.rq.u,
+ s->txn.req.sol + s->txn.req.sl.rq.u,
s->txn.req.sl.rq.u_l);
break;
case BE_LB_HASH_PRM:
/* URL Parameter hashing */
if (s->txn.meth == HTTP_METH_POST &&
- memchr(s->txn.req.sol - s->txn.req.som + s->txn.req.sl.rq.u, '&',
+ memchr(s->txn.req.sol + s->txn.req.sl.rq.u, '&',
s->txn.req.sl.rq.u_l ) == NULL)
s->srv = get_server_ph_post(s);
else
s->srv = get_server_ph(s->be,
- s->txn.req.sol - s->txn.req.som + s->txn.req.sl.rq.u,
+ s->txn.req.sol + s->txn.req.sl.rq.u,
s->txn.req.sl.rq.u_l);
break;