This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seqbind.erl:none: error in parse transform 'seqbind': {undef, | |
[{seqbind,parse_transform, | |
[[{attribute,1,file,{"seqbind.erl",1}}, | |
{attribute,1,module,seqbind}, | |
{attribute,2,export, | |
[{parse_transform,2}]}, | |
{attribute,3,export,[{i,3}]}, | |
{attribute,5,record, | |
{state, | |
[{record_field,7, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(auth_handler). | |
-compile({parse_transform, seqbind}). | |
-export([init/3, handle/2, terminate/2]). | |
-define(USERNAME, <<"admin">>). | |
-define(PASSWORD, <<"password">>). | |
%% public | |
init(_Transport, Req, []) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl | |
index a0f571b..107582f 100644 | |
--- a/src/cowboy_protocol.erl | |
+++ b/src/cowboy_protocol.erl | |
@@ -519,7 +519,8 @@ resume(State, Env, Tail, Module, Function, Args) -> | |
end. | |
-spec next_request(cowboy_req:req(), #state{}, any()) -> ok. | |
-next_request(Req, State=#state{req_keepalive=Keepalive, timeout=Timeout}, | |
+next_request(Req, State=#state{req_keepalive=Keepalive, timeout=Timeout, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ fifo USE_GDB=true erl -pa ebin/ | |
GNU gdb 6.3.50-20050815 (Apple version gdb-1822) (Sun Aug 5 03:00:42 UTC 2012) | |
Copyright 2004 Free Software Foundation, Inc. | |
GDB is free software, covered by the GNU General Public License, and you are | |
welcome to change it and/or distribute copies of it under certain conditions. | |
Type "show copying" to see the conditions. | |
There is absolutely no warranty for GDB. Type "show warranty" for details. | |
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done | |
(gdb) run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(benchmark). | |
-define(DEFAULT_CONCURENCY, 1). | |
-define(DEFAULT_SEQUENTIAL, 10000). | |
-export([ | |
main/0 | |
]). | |
%% public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
encode_composite_column(Column) -> | |
encode_composite_column(binary:split(Column, <<":">>), []). | |
encode_composite_column([], Acc) -> | |
iolist_to_binary(Acc); | |
encode_composite_column([H | T], Acc) -> | |
Size = byte_size(H), | |
encode_composite_column(T, [Acc ++ [<<0, Size/integer, H/binary, 0>>]]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lpgauth@h005 ~/benchmark_webservers $ ./benchmark.sh | |
Cowboy webserver: | |
Running 10s test @ http://localhost:8080/ | |
8 threads and 20 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 714.01us 0.90ms 7.83ms 80.45% | |
Req/Sec 4.08k 0.90k 6.00k 56.80% | |
Latency Distribution | |
50% 50.00us | |
75% 1.49ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(macro). | |
-export([test/0]). | |
-define(TEST(Value), case Value of true -> true; (X) -> X end). | |
test() -> | |
true = ?TEST(true), | |
<<"test">> = ?TEST(<<"test">>). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(record). | |
-export([test/0]). | |
-record(request, { | |
timestamp, | |
handler, | |
bid | |
}). | |
-record(bid, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl | |
index beaffdc..c2e3c3f 100644 | |
--- a/lib/ssh/src/ssh_transport.erl | |
+++ b/lib/ssh/src/ssh_transport.erl | |
@@ -206,6 +206,7 @@ key_exchange_init_msg(Ssh0) -> | |
kex_init(#ssh{role = Role, opts = Opts, available_host_keys = HostKeyAlgs}) -> | |
Random = ssh_bits:random(16), | |
Compression = case proplists:get_value(compression, Opts, none) of | |
+ zlib_openssh -> ["zlib@openssh.com", "none"]; | |
zlib -> ["zlib", "none"]; |