WIP
This commit is contained in:
+1
-1
@@ -168,7 +168,7 @@ authenticate(State = #s{socket = Socket}) ->
|
|||||||
await_auth(State = #s{socket = Socket}, Ref, From) ->
|
await_auth(State = #s{socket = Socket}, Ref, From) ->
|
||||||
ok = active_once(State),
|
ok = active_once(State),
|
||||||
receive
|
receive
|
||||||
{tcp, Socket, <<"ok:", Binary/binary>>} ->
|
{tcp, Socket, <<"OK:", Binary/binary>>} ->
|
||||||
From ! {Ref, ok},
|
From ! {Ref, ok},
|
||||||
case zx_lib:b_to_ts(Binary) of
|
case zx_lib:b_to_ts(Binary) of
|
||||||
{ok, {manifest, Manifest}} ->
|
{ok, {manifest, Manifest}} ->
|
||||||
|
|||||||
+14
-5
@@ -79,6 +79,16 @@
|
|||||||
% sig = none :: none | {Key :: binary(), Sig :: binary()}}).
|
% sig = none :: none | {Key :: binary(), Sig :: binary()}}).
|
||||||
|
|
||||||
|
|
||||||
|
-type meta() :: {Name :: binary(), % UTF8 binary string
|
||||||
|
Size :: pos_integer(), % Size in bytes
|
||||||
|
TS :: pos_integer(), % Timestamp is the height at creation
|
||||||
|
TTL :: pos_integer(), % Expiry height is TS + TTL
|
||||||
|
Sig :: none | sig()}.
|
||||||
|
-type sig() :: {ID :: id(),
|
||||||
|
Sig :: binary()}.
|
||||||
|
-type id() :: binary(). % ID is binary string of the pubkey, serialized <<"ak_...">>
|
||||||
|
|
||||||
|
|
||||||
%%% Interface
|
%%% Interface
|
||||||
|
|
||||||
-spec to_front() -> ok.
|
-spec to_front() -> ok.
|
||||||
@@ -102,8 +112,7 @@ trouble(Info) ->
|
|||||||
|
|
||||||
|
|
||||||
-spec pending(Manifest) -> ok
|
-spec pending(Manifest) -> ok
|
||||||
when Manifest :: [Transfer],
|
when Manifest :: [meta()].
|
||||||
Transfer :: {Name :: string(), Size :: pos_integer()}.
|
|
||||||
|
|
||||||
pending(Manifest) ->
|
pending(Manifest) ->
|
||||||
wx_object:cast(?MODULE, {pending, Manifest}).
|
wx_object:cast(?MODULE, {pending, Manifest}).
|
||||||
@@ -313,13 +322,13 @@ terminate(Reason, State) ->
|
|||||||
|
|
||||||
%%% doers
|
%%% doers
|
||||||
|
|
||||||
do_pending(State, Manifest) ->
|
do_pending(Manifest, State) ->
|
||||||
ok = tell(info, "Would do_pending: ~p", [Manifest]),
|
ok = tell(info, "Would do_pending: ~p", [Manifest]),
|
||||||
State.
|
State.
|
||||||
|
|
||||||
|
|
||||||
do_accounts(State, Manifest) ->
|
do_accounts(Manifest, State) ->
|
||||||
ok = tell(info, "Would do_pending: ~p", [Manifest]),
|
ok = tell(info, "Would do_accounts: ~p", [Manifest]),
|
||||||
State.
|
State.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user