FS-5921 --resolve mod_mongo: use jsonString() instead of toString(), tabs instead of spaces

This commit is contained in:
Chris Rienzo 2013-11-04 14:28:07 -05:00
parent ad8796f581
commit 381caad87f
3 changed files with 157 additions and 158 deletions

View File

@ -1,6 +1,6 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2012, Anthony Minessale II <anthm@freeswitch.org>
* Copyright (C) 2005-2013, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
@ -82,7 +82,7 @@ SWITCH_STANDARD_API(mongo_mapreduce_function)
conn->runCommand(conn->nsGetDB(ns), cmd.done(), out);
mongo_connection_pool_put(globals.conn_pool, conn, SWITCH_FALSE);
stream->write_function(stream, "-OK\n%s\n", out.toString().c_str());
stream->write_function(stream, "-OK\n%s\n", out.jsonString().c_str());
} else {
stream->write_function(stream, "-ERR\nNo connection\n");
}
@ -130,7 +130,7 @@ SWITCH_STANDARD_API(mongo_find_one_function)
BSONObj res = conn->findOne(ns, Query(query), &fields);
mongo_connection_pool_put(globals.conn_pool, conn, SWITCH_FALSE);
stream->write_function(stream, "-OK\n%s\n", res.toString().c_str());
stream->write_function(stream, "-OK\n%s\n", res.jsonString().c_str());
} else {
stream->write_function(stream, "-ERR\nNo connection\n");
}

View File

@ -1,6 +1,6 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2012, Anthony Minessale II <anthm@freeswitch.org>
* Copyright (C) 2005-2013, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*

View File

@ -1,6 +1,6 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2012, Anthony Minessale II <anthm@freeswitch.org>
* Copyright (C) 2005-2013, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
@ -103,7 +103,6 @@ switch_status_t mongo_connection_pool_create(mongo_connection_pool_t **conn_pool
cpool->min_connections = min_connections;
cpool->max_connections = max_connections;
cpool->conn_str = switch_core_strdup(pool, conn_str);
cpool->pool = pool;
for (cpool->size = 0; cpool->size < min_connections; cpool->size++) {