summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/query.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/db/query.cpp b/db/query.cpp
index 7fdf3197bdd..baa82c7102f 100644
--- a/db/query.cpp
+++ b/db/query.cpp
@@ -907,9 +907,14 @@ namespace mongo {
}
QueryResult* getMore(const char *ns, int ntoreturn, long long cursorid) {
- BufBuilder b(32768);
-
ClientCursor *cc = ClientCursor::find(cursorid);
+
+ int bufSize = 512;
+ if ( cc ){
+ bufSize += sizeof( QueryResult );
+ bufSize += ( ntoreturn ? 4 : 1 ) * 1024 * 1024;
+ }
+ BufBuilder b( bufSize );
b.skip(sizeof(QueryResult));