forked from Mirrors/privacore-open-source-search-engine
Moved State8 from .h file to .cp file. Made sendPageParser2 static
This commit is contained in:
117
PageParser.cpp
117
PageParser.cpp
@ -5,6 +5,86 @@
|
||||
//#include "IndexTable2.h"
|
||||
//#include "XmlDoc.h" // addCheckboxSpan()
|
||||
|
||||
class State8 {
|
||||
public:
|
||||
TopTree m_topTree;
|
||||
//Msg16 m_msg16;
|
||||
//Msg14 m_msg14;
|
||||
//Msg15 m_msg15;
|
||||
Msg22 m_msg22;
|
||||
SafeBuf m_dbuf;
|
||||
//XmlDoc m_doc;
|
||||
//Url m_url;
|
||||
//Url m_rootUrl;
|
||||
char *m_u;
|
||||
int32_t m_ulen;
|
||||
bool m_applyRulesetToRoot;
|
||||
char m_rootQuality;
|
||||
int32_t m_reparseRootRetries;
|
||||
char m_coll[MAX_COLL_LEN];
|
||||
int32_t m_collLen;
|
||||
//int32_t m_sfn;
|
||||
//int32_t m_urlLen;
|
||||
TcpSocket *m_s;
|
||||
bool m_isLocal;
|
||||
char m_pwd[32];
|
||||
HttpRequest m_r;
|
||||
int32_t m_old;
|
||||
// recyle the link info from the title rec?
|
||||
int32_t m_recycle;
|
||||
// recycle the link info that was imported from another coll?
|
||||
int32_t m_recycle2;
|
||||
int32_t m_render;
|
||||
char m_recompute;
|
||||
int32_t m_oips;
|
||||
char m_linkInfoColl[11];
|
||||
// char m_buf[16384 * 1024];
|
||||
|
||||
//int32_t m_page;
|
||||
// m_pbuf now points to m_sbuf if we are showing the parsing junk
|
||||
SafeBuf m_xbuf;
|
||||
SafeBuf m_wbuf;
|
||||
bool m_donePrinting;
|
||||
//SafeBuf m_sbuf;
|
||||
// this is a buffer which cats m_sbuf into it
|
||||
//SafeBuf m_sbuf2;
|
||||
|
||||
// new state vars for Msg3b.cpp
|
||||
int64_t m_docId;
|
||||
void *m_state ;
|
||||
void (* m_callback) (void *state);
|
||||
Query m_tq;
|
||||
Query *m_q;
|
||||
int64_t *m_termFreqs;
|
||||
float *m_termFreqWeights;
|
||||
float *m_affWeights;
|
||||
//score_t m_total;
|
||||
bool m_freeIt;
|
||||
bool m_blocked;
|
||||
|
||||
// these are from rearranging the code
|
||||
int32_t m_indexCode;
|
||||
//uint64_t m_chksum1;
|
||||
int64_t m_took1;
|
||||
int64_t m_took1b;
|
||||
int64_t m_took2;
|
||||
int64_t m_took3;
|
||||
|
||||
char m_didRootDom;
|
||||
char m_didRootWWW;
|
||||
char m_wasRootDom;
|
||||
|
||||
// call Msg16 with a versino of title rec to do
|
||||
int32_t m_titleRecVersion;
|
||||
|
||||
char m_hopCount;
|
||||
|
||||
//TitleRec m_tr;
|
||||
|
||||
//XmlDoc m_oldDoc;
|
||||
XmlDoc m_xd;
|
||||
};
|
||||
|
||||
bool g_inPageParser = false;
|
||||
bool g_inPageInject = false;
|
||||
|
||||
@ -12,6 +92,17 @@ bool g_inPageInject = false;
|
||||
static bool processLoop ( void *state ) ;
|
||||
static bool gotXmlDoc ( void *state ) ;
|
||||
static bool sendErrorReply ( void *state , int32_t err ) ;
|
||||
static bool sendPageParser2 ( TcpSocket *s ,
|
||||
HttpRequest *r ,
|
||||
class State8 *st ,
|
||||
int64_t docId ,
|
||||
Query *q ,
|
||||
int64_t *termFreqs ,
|
||||
float *termFreqWeights ,
|
||||
float *affWeights ,
|
||||
void *state ,
|
||||
void (* callback)(void *state) ) ;
|
||||
|
||||
|
||||
// . returns false if blocked, true otherwise
|
||||
// . sets g_errno on error
|
||||
@ -26,19 +117,19 @@ bool sendPageParser ( TcpSocket *s , HttpRequest *r ) {
|
||||
// . a new interface so Msg3b can call this with "s" set to NULL
|
||||
// . returns false if blocked, true otherwise
|
||||
// . sets g_errno on error
|
||||
bool sendPageParser2 ( TcpSocket *s ,
|
||||
HttpRequest *r ,
|
||||
State8 *st ,
|
||||
int64_t docId ,
|
||||
Query *q ,
|
||||
// in query term space, not imap space
|
||||
int64_t *termFreqs ,
|
||||
// in imap space
|
||||
float *termFreqWeights ,
|
||||
// in imap space
|
||||
float *affWeights ,
|
||||
void *state ,
|
||||
void (* callback)(void *state) ) {
|
||||
static bool sendPageParser2 ( TcpSocket *s ,
|
||||
HttpRequest *r ,
|
||||
State8 *st ,
|
||||
int64_t docId ,
|
||||
Query *q ,
|
||||
// in query term space, not imap space
|
||||
int64_t *termFreqs ,
|
||||
// in imap space
|
||||
float *termFreqWeights ,
|
||||
// in imap space
|
||||
float *affWeights ,
|
||||
void *state ,
|
||||
void (* callback)(void *state) ) {
|
||||
|
||||
//log("parser: read sock=%"INT32"",s->m_sd);
|
||||
|
||||
|
91
PageParser.h
91
PageParser.h
@ -16,95 +16,4 @@ extern bool g_inPageInject ;
|
||||
|
||||
bool sendPageAnalyze ( TcpSocket *s , HttpRequest *r ) ;
|
||||
|
||||
bool sendPageParser2 ( TcpSocket *s ,
|
||||
HttpRequest *r ,
|
||||
class State8 *st ,
|
||||
int64_t docId ,
|
||||
Query *q ,
|
||||
int64_t *termFreqs ,
|
||||
float *termFreqWeights ,
|
||||
float *affWeights ,
|
||||
void *state ,
|
||||
void (* callback)(void *state) ) ;
|
||||
|
||||
class State8 {
|
||||
public:
|
||||
TopTree m_topTree;
|
||||
//Msg16 m_msg16;
|
||||
//Msg14 m_msg14;
|
||||
//Msg15 m_msg15;
|
||||
Msg22 m_msg22;
|
||||
SafeBuf m_dbuf;
|
||||
//XmlDoc m_doc;
|
||||
//Url m_url;
|
||||
//Url m_rootUrl;
|
||||
char *m_u;
|
||||
int32_t m_ulen;
|
||||
bool m_applyRulesetToRoot;
|
||||
char m_rootQuality;
|
||||
int32_t m_reparseRootRetries;
|
||||
char m_coll[MAX_COLL_LEN];
|
||||
int32_t m_collLen;
|
||||
//int32_t m_sfn;
|
||||
//int32_t m_urlLen;
|
||||
TcpSocket *m_s;
|
||||
bool m_isLocal;
|
||||
char m_pwd[32];
|
||||
HttpRequest m_r;
|
||||
int32_t m_old;
|
||||
// recyle the link info from the title rec?
|
||||
int32_t m_recycle;
|
||||
// recycle the link info that was imported from another coll?
|
||||
int32_t m_recycle2;
|
||||
int32_t m_render;
|
||||
char m_recompute;
|
||||
int32_t m_oips;
|
||||
char m_linkInfoColl[11];
|
||||
// char m_buf[16384 * 1024];
|
||||
|
||||
//int32_t m_page;
|
||||
// m_pbuf now points to m_sbuf if we are showing the parsing junk
|
||||
SafeBuf m_xbuf;
|
||||
SafeBuf m_wbuf;
|
||||
bool m_donePrinting;
|
||||
//SafeBuf m_sbuf;
|
||||
// this is a buffer which cats m_sbuf into it
|
||||
//SafeBuf m_sbuf2;
|
||||
|
||||
// new state vars for Msg3b.cpp
|
||||
int64_t m_docId;
|
||||
void *m_state ;
|
||||
void (* m_callback) (void *state);
|
||||
Query m_tq;
|
||||
Query *m_q;
|
||||
int64_t *m_termFreqs;
|
||||
float *m_termFreqWeights;
|
||||
float *m_affWeights;
|
||||
//score_t m_total;
|
||||
bool m_freeIt;
|
||||
bool m_blocked;
|
||||
|
||||
// these are from rearranging the code
|
||||
int32_t m_indexCode;
|
||||
//uint64_t m_chksum1;
|
||||
int64_t m_took1;
|
||||
int64_t m_took1b;
|
||||
int64_t m_took2;
|
||||
int64_t m_took3;
|
||||
|
||||
char m_didRootDom;
|
||||
char m_didRootWWW;
|
||||
char m_wasRootDom;
|
||||
|
||||
// call Msg16 with a versino of title rec to do
|
||||
int32_t m_titleRecVersion;
|
||||
|
||||
char m_hopCount;
|
||||
|
||||
//TitleRec m_tr;
|
||||
|
||||
//XmlDoc m_oldDoc;
|
||||
XmlDoc m_xd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user