Vakul Garg <vakul.garg@...>
I am running http_server example application with a 6loble link between a zephyr host and linux host.
The http_server example code has been modified to send 4000 bytes of index.html (instead of default size of 170 bytes).
In this case, I see that following error:
[bt] [ERR] bt_l2cap_chan_send: failed to send message -36
The error code means EMSGSIZE.
The l2cap function l2cap_chan_le_send_sdu() finds that the message fragment to be sent is bigger in size than MTU.
Further, I found that the data passed to http library function http_send_msg_raw() is converted to TCP segments, (IP headers added) and handed over to l2cap backed network interface.
The TCP functions do not create segment with the http data message passed by function http_send_flush() as per MTU size.
I see that http_prepare_and_send() prepares a net_pkt by adding several fragments and when it calls http_send_flush(), the size of net_pkt becomes more than allowed as per MTU.
The resultant segment size is bigger than that can be tolerated by l2cap and it results in above mentioned error log.
Can someone comment whether is this TCP behavior intentional?