Skip to content

Commit ce0cbe4

Browse files
committed
Fix typespecs
1 parent 10e898f commit ce0cbe4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/ex_dtls.ex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,17 @@ defmodule ExDTLS do
139139
140140
`timeout` is a time in ms after which `handle_timeout/1` should be called.
141141
"""
142-
@spec do_handshake(dtls()) :: {packets :: binary(), timeout :: integer()}
142+
@spec do_handshake(dtls()) :: {packets :: [binary()], timeout :: integer()}
143143
defdelegate do_handshake(dtls), to: Native
144144

145145
@doc """
146146
Writes data to the DTLS connection.
147147
148148
Generates encrypted packets that need to be passed to the second host.
149149
"""
150-
@spec write_data(dtls(), packets :: binary()) ::
151-
{:ok, packets :: binary()} | {:error, :handshake_not_finished}
152-
defdelegate write_data(dtls, packets), to: Native
150+
@spec write_data(dtls(), data :: binary()) ::
151+
{:ok, packets :: [binary()]} | {:error, :handshake_not_finished}
152+
defdelegate write_data(dtls, data), to: Native
153153

154154
@doc """
155155
Handles peer's packets.
@@ -164,12 +164,12 @@ defmodule ExDTLS do
164164
165165
Both local and remote keying materials consist of `master key` and `master salt`.
166166
"""
167-
@spec handle_data(dtls(), packets :: binary()) ::
167+
@spec handle_data(dtls(), data :: binary()) ::
168168
{:ok, packets :: binary()}
169169
| :handshake_want_read
170-
| {:handshake_packets, packets :: binary(), timeout :: integer()}
170+
| {:handshake_packets, packets :: [binary()], timeout :: integer()}
171171
| {:handshake_finished, local_keying_material :: binary(),
172-
remote_keying_material :: binary(), protection_profile_t(), packets :: binary()}
172+
remote_keying_material :: binary(), protection_profile_t(), packets :: [binary()]}
173173
| {:handshake_finished, local_keying_material :: binary(),
174174
remote_keying_material :: binary(), protection_profile_t()}
175175
| {:error, :handshake_error | :peer_closed_for_writing}
@@ -192,6 +192,6 @@ defmodule ExDTLS do
192192
193193
If there is no timeout to handle, simple `{:ok, dtls()}` tuple is returned.
194194
"""
195-
@spec handle_timeout(dtls()) :: :ok | {:retransmit, packets :: binary(), timeout :: integer()}
195+
@spec handle_timeout(dtls()) :: :ok | {:retransmit, packets :: [binary()], timeout :: integer()}
196196
defdelegate handle_timeout(dtls), to: Native
197197
end

0 commit comments

Comments
 (0)