forked from Mirrors/privacore-open-source-search-engine
allow more than 2gb of mem to be allocated to hold resulting docids.
This commit is contained in:
11
Msg40.cpp
11
Msg40.cpp
@ -1243,11 +1243,12 @@ bool Msg40::reallocMsg20Buf ( ) {
|
||||
m_buf2 = NULL;
|
||||
m_bufMaxSize2 = need;
|
||||
|
||||
if ( need > 2000000000 ) {
|
||||
log("msg40: need too much mem=%"INT64,need);
|
||||
m_errno = g_errno;
|
||||
return false;
|
||||
}
|
||||
// if ( need > 2000000000 ) {
|
||||
// log("msg40: need too much mem=%"INT64,need);
|
||||
// m_errno = ENOMEM;
|
||||
// g_errno = ENOMEM;
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// do the alloc
|
||||
if ( need ) m_buf2 = (char *)mmalloc ( need ,"Msg40msg20");
|
||||
|
@ -1261,11 +1261,13 @@ bool gotResults ( void *state ) {
|
||||
}
|
||||
|
||||
// this causes ooms everywhere, not a good fix
|
||||
// if ( ! msg40->m_msg20 && ! si->m_docIdsOnly ) {
|
||||
// log("msg40: failed to get results q=%s",si->m_q.m_orig);
|
||||
// g_errno = ENOMEM;
|
||||
// return sendReply(st,NULL);
|
||||
// }
|
||||
if ( ! msg40->m_msg20 && ! si->m_docIdsOnly && msg40->m_errno ) {
|
||||
log("msg40: failed to get results q=%s",si->m_q.m_orig);
|
||||
//g_errno = ENOMEM;
|
||||
g_errno = msg40->m_errno;
|
||||
return sendReply(st,NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user