~ubuntu-branches/ubuntu/oneiric/firebird2.5/oneiric-security

« back to all changes in this revision

Viewing changes to src/jrd/svc.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2010-07-27 18:12:34 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100727181234-88lvl2nuord9ysx5
Tags: 2.5.0.26054~ReleaseCandidate3.ds2-1
* New upstream release candidate

* update d/copyright to reflect changes in upstream sources
* drop patches applied/implemented upstream
  + refresh the rest to apply cleanly
* Standards-Version: 3.9.1 (no changes necessary)

Show diffs side-by-side

added added

removed removed

Lines of Context:
390
390
        }
391
391
}
392
392
 
393
 
void Service::output(const char* text)
394
 
{
395
 
        ULONG len = strlen(text);
396
 
        enqueue(reinterpret_cast<const UCHAR*>(text), len);
397
 
}
398
 
 
399
 
void Service::printf(const SCHAR* format, ...)
 
393
void Service::outputVerbose(const char* text)
 
394
{
 
395
        if (!usvcDataMode)
 
396
        {
 
397
                ULONG len = strlen(text);
 
398
                enqueue(reinterpret_cast<const UCHAR*>(text), len);
 
399
        }
 
400
}
 
401
 
 
402
void Service::outputError(const char* text)
 
403
{
 
404
        // should do nothing - but protect ourself for a while
 
405
        fb_assert(!usvcDataMode);
 
406
        ULONG len = strlen(text);
 
407
        enqueue(reinterpret_cast<const UCHAR*>(text), len);
 
408
}
 
409
 
 
410
void Service::outputData(const char* text)
 
411
{
 
412
        fb_assert(usvcDataMode);
 
413
        ULONG len = strlen(text);
 
414
        enqueue(reinterpret_cast<const UCHAR*>(text), len);
 
415
}
 
416
 
 
417
void Service::printf(bool /*err*/, const SCHAR* format, ...)
400
418
{
401
419
        // Ensure that service is not detached.
402
420
        if (svc_flags & SVC_detached)
1560
1578
                        recv_item_length, recv_items, res_successful);
1561
1579
        }
1562
1580
 
 
1581
        if (status.hasData())
 
1582
        {
 
1583
                status.raise();
 
1584
        }
 
1585
 
1563
1586
        }       // try
1564
1587
        catch (const Firebird::Exception& ex)
1565
1588
        {
1583
1606
                finish(SVC_finished);
1584
1607
        }
1585
1608
 
1586
 
        status.copyTo(svc_status);
1587
1609
        return svc_status[1];
1588
1610
}
1589
1611
 
2199
2221
                        started();
2200
2222
                        svc_started = true;
2201
2223
                        TEXT buffer[100];
 
2224
                        setDataMode(true);
2202
2225
                        while (!feof(file) && !ferror(file))
2203
2226
                        {
2204
2227
                                fgets(buffer, sizeof(buffer), file);
2205
 
                                output(buffer);
 
2228
                                outputData(buffer);
2206
2229
                        }
 
2230
                        setDataMode(false);
2207
2231
                }
2208
2232
 
2209
2233
                if (!file || (file && ferror(file)))