[Libwebsockets] Correct way to initialize connect_info and context_info

Pranjali Chumbhale pranjalic at safeai.ai
Tue Mar 24 01:37:53 CET 2020


Hello team,
This is how I initialize the connect info and context info in my case:
std::memset(m_context_info, 0, sizeof(*m_context_info));
std::memset(m_context_info, 0, sizeof(*m_connect_info));
Following is my gdb debug log.

(gdb) print(m_connect_info->address)
$4 = 0x894801c083480027 <error: Cannot access memory at address
0x894801c083480027>
(gdb) print(m_connect_info->address)
$5 = 0x894801c083480027 <error: Cannot access memory at address
0x894801c083480027>
(gdb) print(m_connect_info)
$6 = (lws_client_connect_info *) 0x55d9eb7820f4
     <std::_Tuple_impl<0ul, testing::internal::GTestFlagSaver*,
std::default_delete<testing::internal::GTestFlagSaver>
>::_M_head(std::_Tuple_impl<0ul, testing::internal::GTestFlagSaver*,
std::default_delete<testing::internal::GTestFlagSaver> >&)+42>
(gdb) print(m_connect_info->address)
$7 = 0x894801c083480027 <error: Cannot access memory at address
0x894801c083480027>
(gdb) print(*m_connect_info.address)
Cannot access memory at address 0x894801c083480027

What am I missing?

Regards,
Pranjali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200323/4e507b4e/attachment.htm>


More information about the Libwebsockets mailing list