8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 07:23:04 +01:00

Fixed #7141: Services manager breaks long lines into 1023 bytes portions when using isc_info_svc_line in Service::query()

This commit is contained in:
AlexPeshkoff 2022-03-03 20:07:22 +03:00
parent 7ee5c370a0
commit 462b824ee6
2 changed files with 20 additions and 7 deletions

View File

@ -1979,7 +1979,7 @@ THREAD_ENTRY_DECLARE Service::run(THREAD_ENTRY_PARAM arg)
Thread::Handle thrHandle = svc->svc_thread;
svc->svc_thread = 0;
svc->started();
svc->svc_sem_full.release();
svc->unblockQueryGet();
svc->finish(SVC_finished);
if (thrHandle)
@ -2304,7 +2304,7 @@ void Service::enqueue(const UCHAR* s, ULONG len)
{
if (checkForShutdown() || (svc_flags & SVC_detached))
{
svc_sem_full.release();
unblockQueryGet();
return;
}
@ -2316,13 +2316,13 @@ void Service::enqueue(const UCHAR* s, ULONG len)
{
if (flagFirst)
{
svc_sem_full.release();
unblockQueryGet(true);
flagFirst = false;
}
svc_sem_empty.tryEnter(1, 0);
if (checkForShutdown() || (svc_flags & SVC_detached))
{
svc_sem_full.release();
unblockQueryGet();
return;
}
}
@ -2344,6 +2344,13 @@ void Service::enqueue(const UCHAR* s, ULONG len)
s += cnt;
len -= cnt;
}
unblockQueryGet();
}
void Service::unblockQueryGet(bool over)
{
svc_output_overflow = over;
svc_sem_full.release();
}
@ -2434,8 +2441,11 @@ void Service::get(UCHAR* buffer, USHORT length, USHORT flags, USHORT timeout, US
buffer[(*return_length)++] = ch;
}
if (!(flags & GET_LINE))
if (svc_output_overflow || !(flags & GET_LINE))
{
svc_output_overflow = false;
svc_stdout_head = head;
}
}
if (flags & GET_LINE)
@ -2534,7 +2544,7 @@ ULONG Service::getBytes(UCHAR* buffer, ULONG size)
svc_stdin_size_requested = size;
svc_stdin_buffer = buffer;
// Wakeup Service::query() if it waits for data from service
svc_sem_full.release();
unblockQueryGet();
}
// Wait for data from client
@ -2574,7 +2584,7 @@ void Service::finish(USHORT flag)
if (svc_flags & SVC_finished)
{
svc_sem_full.release();
unblockQueryGet();
}
else
{

View File

@ -339,6 +339,9 @@ public:
private:
Firebird::Semaphore svc_sem_empty, svc_sem_full;
bool svc_output_overflow;
void unblockQueryGet(bool over = false);
class Validate
{