Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
home:Ledest:erlang:24
erlang
7061-esock-Accept-binaries-for-string-socket-op...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 7061-esock-Accept-binaries-for-string-socket-options.patch of Package erlang
From a32d3f1ea245923f2d33f980e1a944f3832be618 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov <ab@fmap.me> Date: Fri, 25 Nov 2022 11:53:55 +0700 Subject: [PATCH 1/2] [esock] Accept binaries for string socket options --- erts/emulator/nifs/common/prim_socket_nif.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erts/emulator/nifs/common/prim_socket_nif.c b/erts/emulator/nifs/common/prim_socket_nif.c index b80f7bea5f..d27e7b96d6 100644 --- a/erts/emulator/nifs/common/prim_socket_nif.c +++ b/erts/emulator/nifs/common/prim_socket_nif.c @@ -8132,12 +8132,21 @@ ERL_NIF_TERM esock_setopt_str_opt(ErlNifEnv* env, ERL_NIF_TERM result; int optLen; char* val = MALLOC(max); + ErlNifBinary bin; ESOCK_ASSERT( val != NULL ); if ((optLen = GET_STR(env, eVal, val, max)) > 0) { optLen--; + result = + esock_setopt_level_opt(env, descP, level, opt, + val, optLen); + } else if (enif_inspect_binary(env, eVal, &bin)) { + optLen = esock_strnlen(bin.data, max - 1); + sys_memcpy(val, bin.data, optLen); + val[optLen] = '\0'; + result = esock_setopt_level_opt(env, descP, level, opt, val, optLen); -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor