fix sections infinite loop bug.

This commit is contained in:
Matt Wells 2014-02-25 11:09:07 -08:00
parent ceb623bb8f
commit b58d88c57f
2 changed files with 16 additions and 2 deletions

View File

@ -2088,10 +2088,16 @@ bool sendPageCrawlbot ( TcpSocket *socket , HttpRequest *hr ) {
if ( st->m_seedBank.length() && ! seeds )
seeds = st->m_seedBank.getBufStart();
char *coll = "NONE";
if ( cr ) coll = cr->m_coll;
if ( seeds )
log("crawlbot: adding seeds=\"%s\"",seeds);
log("crawlbot: adding seeds=\"%s\" coll=%s (%li)",
seeds,coll,(long)st->m_collnum);
if ( spots )
log("crawlbot: got spots to add");
log("crawlbot: got spots (len=%li) to add coll=%s (%li)",
(long)gbstrlen(spots),coll,(long)st->m_collnum);
///////
//

View File

@ -139,6 +139,12 @@ bool Sections::set ( Words *w ,
if ( ! w ) return true;
if ( w->m_numWords > 1000000 ) {
log("sections: over 1M words. skipping sections set for "
"performance.");
return true;
}
// save it
m_words = w;
m_bits = bits;
@ -17347,6 +17353,8 @@ bool Sections::setListFlags ( ) {
bool Sections::growSections ( ) {
// make a log note b/c this should not happen a lot because it's slow
log("build: growing sections!");
g_errno = EDOCBADSECTIONS;
return true;
// record old buf start
char *oldBuf = m_sectionBuf.getBufStart();
// grow by 20MB at a time