Permalink
Browse files

use md5 namespacing in sample conf

  • Loading branch information...
mojombo committed Jul 6, 2008
1 parent aa67075 commit 52550895ced587890b95408e2360edfdb6627dd5
Showing with 10 additions and 10 deletions.
  1. +1 −1 egitd.conf
  2. +9 −9 elibs/server.erl
View
@@ -1,3 +1,3 @@
-volcano ([^/]*)/([^/]*) "/Users/tom/dev/sandbox/git/" ++ conf:namespace3(Match1) ++ "/" ++ Match1 ++ "/" ++ Match2.
+volcano ([^/]*)/([^/]*) "/Users/tom/dev/sandbox/git/" ++ conf:hexmod8(Match1) ++ "/" ++ conf:md5_namespace3(Match1) ++ "/" ++ Match1 ++ "/" ++ Match2.
github.com ([^/]*) "/data/git/repositories/" ++ Match1.
gist.github.com (.*)\.git "/data/git/gists/" ++ conf:namespace3(Match1) ++ "/" ++ Match1 ++ ".git".
View
@@ -53,19 +53,19 @@ handle_method(Sock) ->
Method = extract_method_name(Header),
% dispatch
- case Method of
- {ok, "upload-pack"} ->
- handle_upload_pack(Sock, Host, Header);
- {ok, "receive-pack"} ->
- receive_pack:handle(Sock, Host, Header);
- invalid ->
- gen_tcp:send(Sock, "Invalid method declaration. Upgrade to the latest git.\n"),
- ok = gen_tcp:close(Sock)
- end;
+ handle_method_dispatch(Method, Sock, Host, Header);
{error, closed} ->
ok = gen_tcp:close(Sock)
end.
+handle_method_dispatch({ok, "upload-pack"}, Sock, Host, Header) ->
+ handle_upload_pack(Sock, Host, Header);
+handle_method_dispatch({ok, "receive-pack"}, Sock, Host, Header) ->
+ receive_pack:handle(Sock, Host, Header);
+handle_method_dispatch(invalid, Sock, _Host, _Header) ->
+ gen_tcp:send(Sock, "Invalid method declaration. Upgrade to the latest git.\n"),
+ ok = gen_tcp:close(Sock).
+
handle_upload_pack(Sock, Host, Header) ->
try
handle_upload_pack_impl(Sock, Host, Header)

0 comments on commit 5255089

Please sign in to comment.