Skip to content

Instantly share code, notes, and snippets.

View nox's full-sized avatar
🥖

Anthony Ramine nox

🥖
View GitHub Profile
diff --git i/handlersocket/database.cpp w/handlersocket/database.cpp
index f332840..a760062 100644
--- i/handlersocket/database.cpp
+++ w/handlersocket/database.cpp
@@ -801,7 +801,7 @@ dbcontext::cmd_find_internal(dbcallback_i& cb, const prep_stmt& pst,
if (is_first) {
is_first = false;
const key_part_map kpm = (1U << args.kvalslen) - 1;
- r = hnd->index_read_map(table->record[0], key_buf, kpm, find_flag);
+ r = hnd->ha_index_read_map(table->record[0], key_buf, kpm, find_flag);
%%% [Experimental]. These functions help writing parse transforms by
%%% implementing a bottom-up traversal which behaves kind of like
%%% lists:mapfoldl.
-type transform_fun(Acc) ::
fun((abstract_expr(), Acc) -> {abstract_expr(), Acc}).
-spec transform_clauses(transform_fun(Acc), Acc, Cs) -> {Cs, Acc} when
Cs :: [abstract_clause()].
transform_clauses(TF, Acc0, Cs) ->
$ time erl -pa deps/*/ebin -pa ebin -noshell -eval "proper:module(ex_http_props)." -run erlang halt
Testing ex_http_props:prop_content_type_correctly_parsed/0
....................................................................................................
OK: Passed 100 test(s).
Testing ex_http_props:prop_content_disposition_correctly_parsed/0
....................................................................................................
OK: Passed 100 test(s).
nox@Bellcross:~/src/ex_http[R14B03-64]$ erl -pa deps/*/ebin -pa ebin Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.8.4 (abort with ^G)
1> proper_gen:sample(ex_http_types:content_disposition()).
{{<<"*">>,
[{<<"zqkh">>,<<"ePnomf">>},
{<<"*">>,<<"et">>},
{<<"g">>,<<"m_fIxo3swwqt">>},
{<<"evo">>,<<"lfp">>},
{<<"p">>,<<"T">>},
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.8.4 (abort with ^G)
1> {{Type, SubType}, [{Param, Value}]}=ex_mime:media_type(<<"text/Plain; charset=utf-8">>).
{{<<"text">>,<<"plain">>},[{<<"charset">>,<<"utf-8">>}]}
2> lists:map(fun binary:referenced_byte_size/1, [Type, SubType, Param, Value]).
[25,5,25,25]
nox@Bellcross:~$ . .kerl/installs/R14B03-64/activate
nox@Bellcross:~[R14B03-64]$ kerl_deactivate
nox@Bellcross:~$
1> {{T, SubT}, [{Name, Value}]} = ex_mime:media_type(<<"text/plain; charset=utf-8">>).
{{<<"text">>,<<"plain">>},[{<<"charset">>,<<"utf-8">>}]}
2> [ binary:referenced_byte_size(Bin) || Bin <- [T, SubT, Name, Value] ].
[25,25,25,25]
1> {{T, SubT}, [{Name, Value}]} = ex_mime:media_type(<<"text/Plain; charset=utf-8">>).
{{<<"text">>,<<"plain">>},[{<<"charset">>,<<"utf-8">>}]}
2> [ binary:referenced_byte_size(Bin) || Bin <- [T, SubT, Name, Value] ].
[25,5,25,25]
1> {{Type, Subtype}, Parameters} = ex_mime:media_type(<<"text/plain; charset=utf-8">>).
{{<<"text">>,<<"plain">>},[{<<"charset">>,<<"utf-8">>}]}
2> binary:referenced_byte_size(Subtype).
25
3> {{Type, Subtype2}, Parameters} = ex_mime:media_type(<<"text/Plain; charset=utf-8">>).
{{<<"text">>,<<"plain">>},[{<<"charset">>,<<"utf-8">>}]}
4> binary:referenced_byte_size(Subtype2).
5
-module(ex_formdata).
-type data() :: {Name::binary(), [ex_mime:parameter()],
[ex_multipart:http_header()], Body::binary()}.
-type cont(T) :: fun((folding_result(T), T) -> T).
-type folding_result(T) :: {data, data(), fun((T) -> T)}
| {more, fun((binary()) -> T)}
| {prologue, binary()}.
-export_type([data/0, cont/1, folding_result/1]).