Skip to content

Commit

Permalink
Fix Accept addrlen initialization (#1116)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanou authored Nov 8, 2024
1 parent bd1ba15 commit 1f3ffbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generated/nixnetsocket/nixnetsocket_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace nixnetsocket_grpc {
auto initialization_behavior = request->initialization_behavior();

auto addr = allocate_output_storage<nxsockaddr, SockAddr>();
nxsocklen_t addrlen {};
auto addrlen = static_cast<nxsocklen_t>(sizeof(addr.storage));
bool new_session_initialized {};
auto init_lambda = [&] () {
auto socket_out = library_->Accept(socket, &addr, &addrlen);
Expand Down
3 changes: 2 additions & 1 deletion source/codegen/metadata/nixnetsocket/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
'direction': 'out',
'name': 'addrlen',
'include_in_proto': False,
'type': 'nxsocklen_t'
'type': 'nxsocklen_t',
'hardcoded_value': 'static_cast<nxsocklen_t>(sizeof(addr.storage))'
},
{
'direction': 'out',
Expand Down

0 comments on commit 1f3ffbe

Please sign in to comment.