summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_server.erl
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2008-08-31 09:43:41 +0000
committerChristopher Lenz <cmlenz@apache.org>2008-08-31 09:43:41 +0000
commit15a175144d83d6177e9bbb923a7f7157e5ea8917 (patch)
tree92b7becc9610c46f87ddf7ab4c313642b007c4aa /src/couchdb/couch_server.erl
parentac4075a7987dc43aadeb18a94e07f090d1b77546 (diff)
Merged json_term_changes branch back into trunk.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@690668 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_server.erl')
-rw-r--r--src/couchdb/couch_server.erl17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl
index b6969f42..c3630f83 100644
--- a/src/couchdb/couch_server.erl
+++ b/src/couchdb/couch_server.erl
@@ -124,7 +124,7 @@ all_databases() ->
[$/ | RelativeFilename] -> ok;
RelativeFilename -> ok
end,
- [filename:rootname(RelativeFilename, ".couch") | AccIn]
+ [list_to_binary(filename:rootname(RelativeFilename, ".couch")) | AccIn]
end, []),
{ok, Filenames}.
@@ -174,9 +174,10 @@ handle_call(get_server, _From, Server) ->
handle_call(get_root, _From, #server{root_dir=Root}=Server) ->
{reply, {ok, Root}, Server};
handle_call({open, DbName, Options}, {FromPid,_}, Server) ->
- case check_dbname(Server, DbName) of
+ DbNameList = binary_to_list(DbName),
+ case check_dbname(Server, DbNameList) of
ok ->
- Filepath = get_full_filename(Server, DbName),
+ Filepath = get_full_filename(Server, DbNameList),
LruTime = now(),
case ets:lookup(couch_dbs_by_name, DbName) of
[] ->
@@ -207,9 +208,10 @@ handle_call({open, DbName, Options}, {FromPid,_}, Server) ->
{reply, Error, Server}
end;
handle_call({create, DbName, Options}, {FromPid,_}, Server) ->
- case check_dbname(Server, DbName) of
+ DbNameList = binary_to_list(DbName),
+ case check_dbname(Server, DbNameList) of
ok ->
- Filepath = get_full_filename(Server, DbName),
+ Filepath = get_full_filename(Server, DbNameList),
case ets:lookup(couch_dbs_by_name, DbName) of
[] ->
@@ -233,9 +235,10 @@ handle_call({create, DbName, Options}, {FromPid,_}, Server) ->
{reply, Error, Server}
end;
handle_call({delete, DbName}, _From, Server) ->
- case check_dbname(Server, DbName) of
+ DbNameList = binary_to_list(DbName),
+ case check_dbname(Server, DbNameList) of
ok ->
- FullFilepath = get_full_filename(Server, DbName),
+ FullFilepath = get_full_filename(Server, DbNameList),
Server2 =
case ets:lookup(couch_dbs_by_name, DbName) of
[] -> Server;