CLEANUP: http: make it more obvious that msg->som is always null outside of chunks
Since the recent buffer reorg, msg->som is redundant with buf->p but still
appears at a number of places. This tiny patch allows to confirm that som
follows two states :
- 0 from the moment the message starts to be parsed
- relative offset to ->p for start of chunk when parsing chunks
During this second state, ->sol is never used, so we should probably merge
the two.
diff --git a/src/backend.c b/src/backend.c
index 3cc568c..9a5b196 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -260,8 +260,8 @@
const char *params = b_ptr(req, (int)(msg->sov - req->o));
const char *p = params;
- if (len > buffer_len(req) - (msg->sov - msg->som))
- len = buffer_len(req) - (msg->sov - msg->som);
+ if (len > buffer_len(req) - msg->sov)
+ len = buffer_len(req) - msg->sov;
if (len == 0)
return NULL;