[sr-dev] [kamailio/kamailio] extensions to lost and http_client modules (#2675)

Wolfgang Kampichler notifications at github.com
Wed Apr 7 11:58:14 CEST 2021


> Regarding:
> 
> ```
>  1(82) ERROR: <core> [core/parser/parse_body.c:510]: part_multipart_headers_cmp(): error code: "-9" error text: "We reached the end of the buffer".
> ```
> 
> Maybe there are white spaces at the end of body that fit inside the Content-Length in the sipp scenario (try to print the $mb enclosed in some delimiters like [ ] to see it completely. If proves to be a problem, then an issue can be created for this case with a minimal config to reproduce and the sipp scenario for it.
> 
> Then related this PR, while not familiar with all its aspects, it seems some of the questions are actually about further improvements (e.g., handling two Geolocation headers). They do not have to be implemented as part of this PR, can be done separately. If no problems need to be solved on this PR, then it should be merged in order to get more chances to be tested before branching 5.5.


I did check parse_body.c and it seems that part_multipart_headers_cmp logs an ERROR in case it does not find a matching header, which is the case when comparing the first part (application/sdp) of the multipart body (see the example xml). So the error happens any time when comparing sup-parts that do not match. In the example provided the second part contains the `cid` and the function returns the body - I assume if it there is another sub-part before the pidf-lo, we should see another ERROR log. I would propose to log the following as INFO:
`
error = -9;
error_msg = "unsuccessfully reached the end of the buffer";
`
If you agree I'll commit a fix as part of this PR, the result of a local test as below:

```
2021-04-07T11:45:17.418411261+02:00  9(16) INFO: {1 1 INVITE 1-1 at 172.16.16.45} lost [functions.c:844]: lost_function(): ### LOST urn    [urn:service:sos]
2021-04-07T11:45:17.418721057+02:00  9(16) INFO: {1 1 INVITE 1-1 at 172.16.16.45} lost [functions.c:936]: lost_function(): ### LOST loc    [<7607331117 at 10.3.90.20>]
2021-04-07T11:45:17.418780681+02:00  9(16) INFO: {1 1 INVITE 1-1 at 172.16.16.45} <core> [core/parser/parse_body.c:511]: part_multipart_headers_cmp(): result code: "-9" text: "unsuccessfully reached the end of the buffer".
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2675#issuecomment-814781518
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20210407/2ef100b0/attachment.htm>


More information about the sr-dev mailing list