summaryrefslogtreecommitdiffstats
path: root/runtime/stream.c
Commit message (Collapse)AuthorAgeFilesLines
* fixed regression from previos (yet unrelease) $omfileFlushOnTXEnd fixtemp.4.6.1.10Rainer Gerhards2010-03-191-0/+3
| | | | | | | | The previous fix fixed an issue with on/off bying used in the exact wrong semantic. It corrected the situation, but failed to fix one spot where the wrong semantics were used. This is done with this commit. Note that this is NOT a bug seen in any released version.
* bugfix: invalid buffer write in (file) stream classRainer Gerhards2010-03-191-1/+2
| | | | | | | currently being accessed buffer could be overwritten with new data. While this probably did not cause access violations, it could case loss and/or duplication of some data (definitely a race with no deterministic outcome)
* bugfix: potential hang condition during filestream closeRainer Gerhards2010-03-191-4/+6
| | | | | predicate was not properly checked when waiting for the background file writer
* bugfix: improper synchronization when "$OMFileFlushOnTXEnd on" was usedRainer Gerhards2010-03-191-11/+35
| | | | | Internal data structures were not properly protected due to missing mutex calls.
* some cleanup, some additional comments and a bit more debug outputRainer Gerhards2010-03-181-2/+11
|
* bugfix(cosmetic): tried to close non-open fd, resulting in close(-1)Rainer Gerhards2010-03-161-2/+7
|
* reduced runtime requirements of inactive debug code a slight bitRainer Gerhards2010-03-161-10/+10
|
* Merge branch 'v4-stable' into v4-stable-nextRainer Gerhards2010-03-101-4/+11
|\
| * fixed regression introduced with previous commitRainer Gerhards2010-03-101-4/+11
| | | | | | | | | | | | disk queue mode did no longer work correctly. A side-effect of this commit here is slightly cleaned-up (and more elegant) code for circular files.
* | some cosmetic changesRainer Gerhards2010-03-101-9/+9
|/ | | | | | note that a buffer size calculation was done wrong, but this was cosmetic because our buffers currently all use byte size, so even though the formula was wrong, the result was correct.
* bugfixes and testbench improvementRainer Gerhards2010-03-101-8/+9
| | | | | | | | | | - improved testbench - bugfix: potential data loss during file stream shutdown - bugfix: potential problems during file stream shutdown The shutdown/close sequence was not clean, what potentially (but unlikely) could lead to some issues. We have not been able to describe any fatal cases, but there was some bug potential. Sequence has now been straighted out.
* bugfix: potential problem (loop, abort) when file write error occuredRainer Gerhards2010-03-091-0/+1
| | | | | | | | | | When a write error occured in stream.c, variable iWritten had the error code but this was handled as if it were the actual number of bytes written. That was used in pointer arithmetic later on, and thus could lead to all sorts of problems. However, this could only happen if the error was EINTR or the file in question was a tty. All other cases were handled properly. Now, iWritten is reset to zero in such cases, resulting in proper retries.
* bugfix: rsyslog hangs when writing to a named pipe which nobody was reading.Rainer Gerhards2010-01-151-3/+10
| | | | Thanks to Michael Biebl for reporting this bug.
* bugfix: named pipes did no longer work (they always got an open error)Rainer Gerhards2009-11-051-0/+1
| | | | this was a regression from the omfile rewrite in 4.5.0
* minor cleanup & preparation for 4.5.4v4.5.4Rainer Gerhards2009-09-291-9/+0
|
* bugfix: this morning's race patch was incomplete, completing nowRainer Gerhards2009-09-241-6/+8
| | | | | | | | we needed to release ALL resources (including file handles!) only after the the async writer thread has terminated (else it may access them). In this case, we had a file handle leak, because the handle was sometimes only opened in the async writer, but the close was attempted before the writer even started (in some cases).
* (temporary?) removal of very conservative locks in stream.cRainer Gerhards2009-09-241-2/+2
| | | | | | ...after we seem to have identified the root cause of the segfault. I leave them commented out so that we can re-activate it if need arises (aka "get some practice drill first").
* bugfix: potential segfault in stream writer on destructionRainer Gerhards2009-09-241-5/+9
| | | | | | | | | | Most severely affected omfile. The problem was that some buffers were freed before the asynchronous writer thread was shut down. So the writer thread accessed invalid data, which may even already be overwritten. Symptoms (with omfile) were segfaults, grabled data and files with random names placed around the file system (most prominently into the root directory). Special thanks to Aaron for helping to track this down.
* minor: increased buffer size to be safe in all casesRainer Gerhards2009-09-221-2/+2
| | | | | if the buffer was too small, we would see more API calls, but no failure, so this is no fix!
* bugfixes: potential problems in out file zip writer.Rainer Gerhards2009-09-221-14/+31
| | | | | | Problems could lead to abort and/or memory leak. The module is now hardened in a very conservative way, which is sub-optimal from a performance point of view. This should be improved if it has proven reliable in practice.
* fixed some minor portability issuesRainer Gerhards2009-09-141-2/+8
|
* very minor cleanupRainer Gerhards2009-08-181-1/+0
|
* bugfix: potential segfault in output file writer (omfile)Rainer Gerhards2009-08-181-0/+1
| | | | | | | | | | | | In async write mode, we use modular arithmetic to index the output buffer array. However, the counter variables accidently were signed, thus resulting in negative indizes after integer overflow. That in turn could lead to segfaults, but was depending on the memory layout of the instance in question (which in turn depended on a number of variables, like compile settings but also configuration). The counters are now unsigned (as they always should have been) and so the dangling mis-indexing does no longer happen. This bug potentially affected all installations, even if only some may actually have seen a segfault.
* calls to prctl() need to be based on configure results (cross-platform issue)Rainer Gerhards2009-07-161-2/+5
| | | | | This is for another prctl() call, not present in the beta version (looks like it would make sense to stick these into a utility function)
* added capability to write incomplete buffers after an inactivity timeoutRainer Gerhards2009-07-071-7/+39
| | | | | | for the stream class and thus finally activating omfile's timeout capability in a useful way without polling and too-high performance overhead.
* fixed a bug introduced today that lead to an abort in queue disk modeRainer Gerhards2009-07-071-9/+12
|
* solved a race conditionRainer Gerhards2009-07-071-14/+49
|
* clean solution for "writing" arbrietary-size user buffers to a streamRainer Gerhards2009-07-071-42/+28
|
* stream now uses a singular buffer strucuture for writingRainer Gerhards2009-07-071-6/+12
|
* moved locking primitivesRainer Gerhards2009-07-071-3/+19
|
* moved zip part to writer threadRainer Gerhards2009-07-061-69/+89
| | | | | | ... this is necessary in preparation for the final solution (we need to have a "unified" writer). If it causes worse performance to have the zip writher togehter with the synchronous write, we may do an async write...
* some minor cleanupRainer Gerhards2009-07-061-16/+16
|
* first shot at asynchronous stream writer with timeout capabilityRainer Gerhards2009-07-061-70/+146
| | | | | ... seems to work on quick testing, but needs a far more testing and improvement. Good milestone commit.
* prevented unneccessary apc callsRainer Gerhards2009-06-231-5/+10
|
* going forward in moving string-handling functions to new interface...Rainer Gerhards2009-06-171-3/+3
|
* milestone: input-side multiSubmit capabilityRainer Gerhards2009-06-161-1/+1
| | | | ... commit before I try to touch the queue side ;)
* Merge branch 'master' into omfileRainer Gerhards2009-06-161-1/+1
|\ | | | | | | | | | | | | | | | | Conflicts: ChangeLog runtime/msg.h tcps_sess.c tcpsrv.c tools/syslogd.c
| * done various optimizations to the stringbuf and its usersRainer Gerhards2009-06-161-1/+1
| |
* | omfile buffers are now synchronized after inactivityRainer Gerhards2009-06-151-0/+68
| | | | | | | | | | | | This is the first shot at this functionality. Currently, we run off a fixed counter in the rsyslogd mainloop, which needs to be restructured. But this code works, so it is a good time for a commit.
* | re-enabled pipe, tty and console in omfileRainer Gerhards2009-06-121-55/+107
| | | | | | | | | | | | | | ... by moving code to stream.c. Thanks to the new design, new cases are not really needed, resulting in cleaner code. I also did a cleanup of header file usage as a side-activity.
* | re-enabled outchannel functionalityRainer Gerhards2009-06-121-6/+124
| |
* | restructered code in perparation for multiple rule set supportRainer Gerhards2009-06-101-3/+0
| | | | | | | | | | | | | | ... this was long overdue, and I finlly tackeld it. It turned out to be more complex than I initially thought. The next step now probably is to actually implement multiple rule sets and the beauty that comes with them.
* | improved error handling and added fsync() supportRainer Gerhards2009-06-081-5/+106
| | | | | | | | | | | | ... restoring missing functionality after the restructuring of imfile. As a side-effect, this also lays the foundation for even more reliable queue engine operations (but this is not yet done).
* | added $OMFileIOBufferSize config directive and plumbingRainer Gerhards2009-06-041-19/+2
| |
* | modified stream class and omfile to work with itRainer Gerhards2009-06-041-24/+144
| | | | | | | | now some basic operations are carried out via the stream class.
* | cleaned up stream class ...Rainer Gerhards2009-06-041-38/+62
|/ | | | | | ... and also made it callable via an rsyslog interface rather then relying on the OS loader (important if we go for using it inside loadbale modules, which we soon possible will)
* reduced number of compile warnings in -pedantic gcc modeRainer Gerhards2008-06-271-2/+2
|
* completed better modularity of runtimeRainer Gerhards2008-04-171-1/+0
| | | | | | | | | | - added the ability to specify an error log function for the runtime - removed dependency of core runtime on dirty.h Note that it is "better" modularity, not perfect. There is still work to do, but I think we can for the time being proceed with other things.
* some more cleanupRainer Gerhards2008-04-161-1/+1
| | | | | reduced dependencies, moved non-runtime files to its own directory except for some whom's status is unclear
* moved runtime files into their own directoryRainer Gerhards2008-04-161-0/+934