[sr-dev] [kamailio/kamailio] Wanted HTTP/2 parser (#1794)

sergey-safarov notifications at github.com
Tue Jan 8 16:47:55 CET 2019


### Description
Current `parser_fline.c` is not supports HTTP/2 protocol and generates errors like below
This is happens because [`HTTP_VERSION`](https://github.com/kamailio/kamailio/blob/cfc89db53c087382c29d809dc0bc56f7351af2d1/src/core/parser/parse_fline.c#L102) macro designed to work only with [`HTTP/1.x`](https://github.com/kamailio/kamailio/blob/cfc89db53c087382c29d809dc0bc56f7351af2d1/src/core/parser/parse_fline.h#L49) protocol.

### Expected behavior
Response from `HTTP/2` enabled server is parsed without error.

#### Actual observed behavior
```
246(251) ERROR: <core> [core/parser/parse_fline.c:257]: parse_first_line(): parse_first_line: bad message (offset: 11)
246(251) ERROR: <core> [core/parser/msg_parser.c:675]: parse_msg(): ERROR: parse_msg: message=<HTTP/2 200 
date: Tue, 08 Jan 2019 15:12:16 GMT
content-type: text/html; charset=UTF-8
server: Apache/2.4.37 (Amazon) OpenSSL/1.0.2k-fips PHP/7.2.11
cache-control: no-transform,public,max-age=300,s-maxage=900, no-cache, private
set-cookie: laravel_session=eyJpdiI6ImZGbU96ajZPV2lkVGZLeHJFNlwvNEJ3PT0iLCJ2YWx1ZSI6IjZmdWdLT0JNNUNFU1ppRWtOTVlmTVphaG4yM25ZcHFWUmUrdlhpMXlYZ2dKK3NYT3JmeG82MkNrSW9VZHdhRkgiLCJtYWMiOiI5MmI1ZWY1YWY1ZDQ3N2Q5ZGMyNzY2OGM2M2ZmNGNlNmY1MGRmYzcyMDhkZTFjM2ZkOTFjMWJlNTRkZmM3MmJkIn0%3D; expires=Tue, 08-Jan-2019 18:12:16 GMT; Max-Age=10800; path=/; httponly
access-control-allow-headers: origin, x-requested-with, content-type
access-control-allow-methods: PUT, GET, POST, DELETE, OPTIONS

{"type":"registration_update","error_code":200,"text_description":"registration_update request succedded","call_id":"FrrQl6Dp~l"}>
```

#### Debugging Data
None

#### Log Messages
None

#### SIP Traffic
None

### Possible Solutions
Not know by me

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
/ # kamailio -v
version: kamailio 5.1.6 (x86_64/linux) 
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown 
compiled on 03:24:34 Nov 23 2018 with gcc 8.2.0
```

* **Operating System**:
```
/ # cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.8.0
PRETTY_NAME="Alpine Linux v3.8"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"
```


-- 
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/issues/1794
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20190108/c36ca260/attachment-0001.html>


More information about the sr-dev mailing list