summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/db.cpp2
-rw-r--r--db/query.cpp1
-rw-r--r--grid/message.cpp13
-rw-r--r--grid/message.h1
4 files changed, 11 insertions, 6 deletions
diff --git a/db/db.cpp b/db/db.cpp
index 1b5eb5d5bc2..108e318e5d1 100644
--- a/db/db.cpp
+++ b/db/db.cpp
@@ -406,7 +406,7 @@ void connThread()
stringstream ss;
if( !dbMsgPort.recv(m) ) {
- cout << "MessagingPort::recv(): returned false" << endl;
+ cout << "MessagingPort::recv(): returned false " << dbMsgPort.farEnd.toString() << endl;
dbMsgPort.shutdown();
break;
}
diff --git a/db/query.cpp b/db/query.cpp
index bfef39534fd..0cb8dd83d5b 100644
--- a/db/query.cpp
+++ b/db/query.cpp
@@ -130,6 +130,7 @@ auto_ptr<Cursor> getIndexCursor(const char *ns, JSObj& query, JSObj& order) {
}
}
JSObj q2 = b2.done();
+ cout << "using index " << d->indexes[i].indexNamespace() << endl;
return auto_ptr<Cursor>(
new BtreeCursor(d->indexes[i].head, q2, 1, true));
}
diff --git a/grid/message.cpp b/grid/message.cpp
index caf2cd7e8a8..cfa9a02a912 100644
--- a/grid/message.cpp
+++ b/grid/message.cpp
@@ -121,16 +121,19 @@ bool MessagingPort::recv(Message& m) {
// assert( x == 4 );
- assert( len >= 0 && len <= 16000000 );
+ if( len < 0 || len > 16000000 ) {
+ cout << "bad recv() len: " << len << '\n';
+ return false;
+ }
int z = (len+1023)&0xfffffc00; assert(z>=len);
MsgData *md = (MsgData *) malloc(z);
md->len = len;
- if ( len <= 0 ){
- cout << "got a length of 0, something is wrong" << endl;
- return false;
- }
+ if ( len <= 0 ){
+ cout << "got a length of 0, something is wrong" << endl;
+ return false;
+ }
char *p = (char *) &md->id;
int left = len -4;
diff --git a/grid/message.h b/grid/message.h
index 604e9a67343..be2749c8bea 100644
--- a/grid/message.h
+++ b/grid/message.h
@@ -45,6 +45,7 @@ public:
private:
int sock;
+public:
SockAddr farEnd;
};