Skip to content

peername() fails on stream-handles #405

Description

@jcpetruzza

The quicer:peername() function is defined as:

@doc Peer name
%% mimic {@link ssl:peername/1}
-spec peername(connection_handle() | stream_handle()) ->
    {ok, {inet:ip_address(), inet:port_number()}} | {error, any()}.
peername(Handle) ->
    quicer_nif:getopt(Handle, remote_address, false).

So from the spec, it looks like it would work on both connection and stream handles. However, the NIF only handles ATOM_QUIC_PARAM_CONN_REMOTE_ADDRESS in get_connection_opt() and not get_stream_opt(), so currently fails with param_error if the NIF is used on a stream.

Not sure if this is a documentation error or an oversight

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions