Beispiel #1
0
 void receivedGetMore(DbResponse& dbresponse, /*AbstractMessagingPort& dbMsgPort, */Message& m, stringstream& ss) {
     DbMessage d(m);
     const char *ns = d.getns();
     ss << ns;
     setClient(ns);
     cc().top.setRead();
     int ntoreturn = d.pullInt();
     long long cursorid = d.pullInt64();
     ss << " cid:" << cursorid;
     ss << " ntoreturn:" << ntoreturn;
     QueryResult* msgdata;
     try {
         AuthenticationInfo *ai = currentClient.get()->ai;
         uassert("unauthorized", ai->isAuthorized(cc().database()->name.c_str()));
         msgdata = getMore(ns, ntoreturn, cursorid, ss);
     }
     catch ( AssertionException& e ) {
         ss << " exception " + e.toString();
         msgdata = emptyMoreResult(cursorid);
     }
     Message *resp = new Message();
     resp->setData(msgdata, true);
     ss << " bytes:" << resp->data->dataLen();
     ss << " nreturned:" << msgdata->nReturned;
     dbresponse.response = resp;
     dbresponse.responseTo = m.data->id;
     //dbMsgPort.reply(m, resp);
 }
Beispiel #2
0
 void doIt() {
     std::cout <<"Yes I Can "<<getMore(3,4)<<std::endl;
 }