Permalink
Browse files

Replace tab indentation with spaces

  • Loading branch information...
astaple committed Dec 29, 2008
1 parent b53f593 commit b7cbd301124045fccab665f939a68d703e70629b
Showing with 11,126 additions and 10,426 deletions.
  1. +7 −7 client/connpool.cpp
  2. +22 −20 client/connpool.h
  3. +160 −158 client/dbclient.cpp
  4. +129 −115 client/dbclient.h
  5. +5 −5 client/model.cpp
  6. +6 −6 client/model.h
  7. +647 −638 db/btree.cpp
  8. +195 −161 db/btree.h
  9. +157 −157 db/btreecursor.cpp
  10. +145 −143 db/clientcursor.cpp
  11. +49 −47 db/clientcursor.h
  12. +106 −100 db/cloner.cpp
  13. +21 −21 db/commands.cpp
  14. +14 −10 db/commands.h
  15. +139 −110 db/cursor.h
  16. +68 −66 db/database.h
  17. +284 −284 db/db.cpp
  18. +68 −65 db/db.h
  19. +308 −251 db/dbcommands.cpp
  20. +53 −51 db/dbeval.cpp
  21. +7 −7 db/dbhelpers.cpp
  22. +13 −11 db/dbhelpers.h
  23. +8 −8 db/dbinfo.cpp
  24. +15 −13 db/dbinfo.h
  25. +82 −76 db/dbmessage.h
  26. +36 −32 db/dbwebserver.cpp
  27. +363 −359 db/instance.cpp
  28. +37 −33 db/instance.h
  29. +21 −21 db/introspect.cpp
  30. +35 −23 db/introspect.h
  31. +459 −457 db/javajs.cpp
  32. +148 −121 db/javajs.h
  33. +6 −6 db/javatest.cpp
  34. +481 −456 db/jsobj.cpp
  35. +524 −469 db/jsobj.h
  36. +48 −41 db/json.cpp
  37. +3 −3 db/json.h
  38. +340 −334 db/matcher.cpp
  39. +63 −56 db/matcher.h
  40. +88 −88 db/minilex.h
  41. +274 −271 db/namespace.cpp
  42. +232 −218 db/namespace.h
  43. +762 −756 db/pdfile.cpp
  44. +251 −233 db/pdfile.h
  45. +624 −622 db/query.cpp
  46. +9 −9 db/query.h
  47. +7 −7 db/queryoptimizer.cpp
  48. +9 −9 db/queryoptimizer.h
  49. +597 −575 db/repl.cpp
  50. +110 −92 db/repl.h
  51. +36 −36 db/replset.h
  52. +4 −4 db/resource.h
  53. +93 −90 db/scanandorder.h
  54. +104 −71 db/storage.h
  55. +41 −38 db/tests.cpp
  56. +71 −71 dbgrid/dbgrid.cpp
  57. +17 −11 dbgrid/dbgrid_commands.cpp
  58. +9 −9 dbgrid/gridconfig.cpp
  59. +22 −18 dbgrid/gridconfig.h
  60. +31 −31 dbgrid/griddatabase.cpp
  61. +6 −4 dbgrid/griddatabase.h
  62. +60 −60 dbgrid/request.cpp
  63. +3 −3 dbgrid/shard.cpp
  64. +8 −6 dbgrid/shard.h
  65. +202 −180 dbtests/btreetests.cpp
  66. +43 −43 dbtests/dbtests.cpp
  67. +3 −3 dbtests/dbtests.h
  68. +88 −88 dbtests/jsobjtests.cpp
  69. +58 −52 dbtests/mockdbclient.h
  70. +356 −338 dbtests/namespacetests.cpp
  71. +283 −275 dbtests/pairingtests.cpp
  72. +179 −175 grid/message.cpp
  73. +106 −89 grid/message.h
  74. +18 −18 stdafx.cpp
  75. +89 −58 stdafx.h
  76. +3 −3 targetver.h
  77. +11 −11 util/background.cpp
  78. +20 −13 util/background.h
  79. +73 −48 util/builder.h
  80. +144 −121 util/goodies.h
  81. +90 −86 util/hashtab.h
  82. +84 −43 util/log.h
  83. +43 −43 util/lruishmap.h
  84. +36 −36 util/miniwebserver.cpp
  85. +6 −6 util/miniwebserver.h
  86. +112 −107 util/mmap.cpp
  87. +19 −17 util/mmap.h
  88. +134 −134 util/sock.cpp
  89. +127 −107 util/sock.h
  90. +18 −18 util/unittest.h
  91. +41 −41 util/util.cpp
View
@@ -3,16 +3,16 @@
/**
* Copyright (C) 2008 10gen Inc.
-*
+*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
-*
+*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
-*
+*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -24,16 +24,16 @@
DBConnectionPool pool;
-DBClientConnection* DBConnectionPool::get(const string& host) {
+DBClientConnection* DBConnectionPool::get(const string& host) {
boostlock L(poolMutex);
PoolForHost *&p = pools[host];
- if( p == 0 )
+ if ( p == 0 )
p = new PoolForHost();
- if( p->pool.empty() ) {
+ if ( p->pool.empty() ) {
string errmsg;
DBClientConnection *c = new DBClientConnection();
- if( !c->connect(host.c_str(), errmsg) ) {
+ if ( !c->connect(host.c_str(), errmsg) ) {
delete c;
uassert("dbconnectionpool: connect failed", false);
return 0;
View
@@ -2,16 +2,16 @@
/**
* Copyright (C) 2008 10gen Inc.
-*
+*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
-*
+*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
-*
+*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -21,18 +21,18 @@
#include <queue>
#include "dbclient.h"
-struct PoolForHost {
+struct PoolForHost {
queue<DBClientConnection*> pool;
};
-class DBConnectionPool {
+class DBConnectionPool {
boost::mutex poolMutex;
map<string,PoolForHost*> pools;
public:
/* generally, use ScopedDbConnection and do not call these directly */
DBClientConnection *get(const string& host);
- void release(const string& host, DBClientConnection *c) {
+ void release(const string& host, DBClientConnection *c) {
boostlock L(poolMutex);
pools[host]->pool.push(c);
}
@@ -43,40 +43,42 @@ extern DBConnectionPool pool;
/* Use to get a connection from the pool. On exceptions things
clean up nicely.
*/
-class ScopedDbConnection {
- const string host;
+class ScopedDbConnection {
+ const string host;
DBClientConnection *_conn;
public:
- DBClientConnection& conn() { return *_conn; }
+ DBClientConnection& conn() {
+ return *_conn;
+ }
/* throws UserAssertionAcception if can't connect */
- ScopedDbConnection(const string& _host) :
- host(_host), _conn( pool.get(_host) ) { }
+ ScopedDbConnection(const string& _host) :
+ host(_host), _conn( pool.get(_host) ) { }
- /* Force closure of the connection. You should call this if you leave it in
+ /* Force closure of the connection. You should call this if you leave it in
a bad state. Destructor will do this too, but it is verbose.
*/
- void kill() {
+ void kill() {
delete _conn;
_conn = 0;
}
- /* Call this when you are done with the ocnnection.
+ /* Call this when you are done with the ocnnection.
Why? See note in the destructor below.
*/
- void done() {
- if( _conn->isFailed() )
+ void done() {
+ if ( _conn->isFailed() )
kill();
else
pool.release(host, _conn);
_conn = 0;
}
~ScopedDbConnection() {
- if( _conn ) {
- /* you are supposed to call done(). if you did that, correctly, we
- only get here if an exception was thrown. in such a scenario, we can't
- be sure we fully read all expected data of a reply on the socket. so
+ if ( _conn ) {
+ /* you are supposed to call done(). if you did that, correctly, we
+ only get here if an exception was thrown. in such a scenario, we can't
+ be sure we fully read all expected data of a reply on the socket. so
we don't try to reuse the connection. The cout is just informational.
*/
cout << "~ScopedDBConnection: _conn != null\n";
Oops, something went wrong.

0 comments on commit b7cbd30

Please sign in to comment.