mirror of
https://github.com/gigablast/open-source-search-engine.git
synced 2024-10-04 12:17:35 +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;
|
s->m_sockState = ST_READING;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// close it. without this here the socket only gets
|
if ( s->m_streamingMode ) return true;
|
||||||
// closed for real in the timeout loop
|
|
||||||
destroySocket ( s );
|
// close it. without this here the socket only gets
|
||||||
}
|
// closed for real in the timeout loop
|
||||||
|
destroySocket ( s );
|
||||||
|
|
||||||
// . otherwise, we finished sending a reply
|
// . otherwise, we finished sending a reply
|
||||||
// . our caller should call recycleSocket ( s ) to keep it alive
|
// . 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
|
NULL , // state
|
||||||
qatestWrapper,//m_masterLoop
|
qatestWrapper,//m_masterLoop
|
||||||
0 )) {// niceness
|
0 )) {// niceness
|
||||||
|
log("qa: waiting %i milliseconds",(int)delay);
|
||||||
s_registered = true;
|
s_registered = true;
|
||||||
// wait for it, return -1 since we blocked
|
// wait for it, return -1 since we blocked
|
||||||
return;
|
return;
|
||||||
@ -1071,18 +1072,20 @@ bool qaSyntax ( ) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int s_i;
|
||||||
|
|
||||||
// now query check
|
// now query check
|
||||||
//static bool s_y4 = false;
|
//static bool s_y4 = false;
|
||||||
if ( ! s_flags[4] ) {
|
if ( ! s_flags[4] ) {
|
||||||
wait(1.5);
|
wait(1.5);
|
||||||
s_flags[4] = true;
|
s_flags[4] = true;
|
||||||
|
s_i = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// now run a bunch of queries
|
// now run a bunch of queries
|
||||||
//
|
//
|
||||||
static int s_i = 0;
|
|
||||||
static char *s_q[] ={"cat dog",
|
static char *s_q[] ={"cat dog",
|
||||||
"+cat",
|
"+cat",
|
||||||
"mp3 \"take five\"",
|
"mp3 \"take five\"",
|
||||||
@ -2830,6 +2833,7 @@ bool qatest ( ) {
|
|||||||
if ( s_registered ) {
|
if ( s_registered ) {
|
||||||
g_loop.unregisterSleepCallback(NULL,qatestWrapper);
|
g_loop.unregisterSleepCallback(NULL,qatestWrapper);
|
||||||
s_registered = false;
|
s_registered = false;
|
||||||
|
log("qa: done waiting");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! s_callback ) s_callback = qatest;
|
if ( ! s_callback ) s_callback = qatest;
|
||||||
|
Loading…
Reference in New Issue
Block a user