mirror of
https://github.com/gigablast/open-source-search-engine.git
synced 2024-10-04 04:07:13 +03:00
fix qa bug of not resetting s_i.
fix tcpserver.cpp bug of destroying a streaming socket after what is really not the final write.
This commit is contained in:
parent
d14cb2d5b0
commit
dce8d9f930
@ -1942,11 +1942,12 @@ int32_t TcpServer::writeSocket ( TcpSocket *s ) {
|
||||
s->m_sockState = ST_READING;
|
||||
return 1 ;
|
||||
}
|
||||
else {
|
||||
// close it. without this here the socket only gets
|
||||
// closed for real in the timeout loop
|
||||
destroySocket ( s );
|
||||
}
|
||||
|
||||
if ( s->m_streamingMode ) return true;
|
||||
|
||||
// close it. without this here the socket only gets
|
||||
// closed for real in the timeout loop
|
||||
destroySocket ( s );
|
||||
|
||||
// . otherwise, we finished sending a reply
|
||||
// . our caller should call recycleSocket ( s ) to keep it alive
|
||||
|
6
qa.cpp
6
qa.cpp
@ -26,6 +26,7 @@ void wait( float seconds ) {
|
||||
NULL , // state
|
||||
qatestWrapper,//m_masterLoop
|
||||
0 )) {// niceness
|
||||
log("qa: waiting %i milliseconds",(int)delay);
|
||||
s_registered = true;
|
||||
// wait for it, return -1 since we blocked
|
||||
return;
|
||||
@ -1071,18 +1072,20 @@ bool qaSyntax ( ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static int s_i;
|
||||
|
||||
// now query check
|
||||
//static bool s_y4 = false;
|
||||
if ( ! s_flags[4] ) {
|
||||
wait(1.5);
|
||||
s_flags[4] = true;
|
||||
s_i = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// now run a bunch of queries
|
||||
//
|
||||
static int s_i = 0;
|
||||
static char *s_q[] ={"cat dog",
|
||||
"+cat",
|
||||
"mp3 \"take five\"",
|
||||
@ -2830,6 +2833,7 @@ bool qatest ( ) {
|
||||
if ( s_registered ) {
|
||||
g_loop.unregisterSleepCallback(NULL,qatestWrapper);
|
||||
s_registered = false;
|
||||
log("qa: done waiting");
|
||||
}
|
||||
|
||||
if ( ! s_callback ) s_callback = qatest;
|
||||
|
Loading…
Reference in New Issue
Block a user