~james-page/ubuntu/raring/dovecot/autopkgtest

« back to all changes in this revision

Viewing changes to src/lib/istream-private.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 11:11:54 UTC
  • mfrom: (1.15.2) (4.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120611111154-678cwbdj6ktgsv1h
Tags: 1:2.1.7-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/{control,rules}: enable PIE hardening.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
    xz compression in Ubuntu.
  + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
    install of extra packages on upgrade.
  + d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.
  + d/control: Drop B-D on systemd.
* Dropped changes:
  + d/patches/fix-racey-restart.patch: part of 2.1.x, no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef ISTREAM_PRIVATE_H
 
2
#define ISTREAM_PRIVATE_H
 
3
 
 
4
#include "istream.h"
 
5
#include "iostream-private.h"
 
6
 
 
7
#define I_STREAM_MIN_SIZE IO_BLOCK_SIZE
 
8
 
 
9
struct istream_private {
 
10
/* inheritance: */
 
11
        struct iostream_private iostream;
 
12
 
 
13
/* methods: */
 
14
        ssize_t (*read)(struct istream_private *stream);
 
15
        void (*seek)(struct istream_private *stream,
 
16
                     uoff_t v_offset, bool mark);
 
17
        void (*sync)(struct istream_private *stream);
 
18
        const struct stat *(*stat)(struct istream_private *stream, bool exact);
 
19
        int (*get_size)(struct istream_private *stream, bool exact, uoff_t *size_r);
 
20
 
 
21
/* data: */
 
22
        struct istream istream;
 
23
 
 
24
        int fd;
 
25
        uoff_t abs_start_offset;
 
26
        struct stat statbuf;
 
27
 
 
28
        const unsigned char *buffer;
 
29
        unsigned char *w_buffer; /* may be NULL */
 
30
 
 
31
        size_t buffer_size, max_buffer_size, init_buffer_size;
 
32
        size_t skip, pos;
 
33
 
 
34
        struct istream *parent; /* for filter streams */
 
35
        uoff_t parent_start_offset;
 
36
 
 
37
        /* parent stream's expected offset is kept here. i_stream_read()
 
38
           always seeks parent stream to here before calling read(). */
 
39
        uoff_t parent_expected_offset;
 
40
 
 
41
        /* increased every time the stream is changed (e.g. seek, read).
 
42
           this way streams can check if their parent streams have been
 
43
           accessed behind them. */
 
44
        unsigned int access_counter;
 
45
 
 
46
        string_t *line_str; /* for i_stream_next_line() if w_buffer == NULL */
 
47
        unsigned int return_nolf_line:1;
 
48
};
 
49
 
 
50
struct istream *
 
51
i_stream_create(struct istream_private *stream, struct istream *parent, int fd);
 
52
 
 
53
void i_stream_compress(struct istream_private *stream);
 
54
void i_stream_grow_buffer(struct istream_private *stream, size_t bytes);
 
55
bool i_stream_get_buffer_space(struct istream_private *stream,
 
56
                               size_t wanted_size, size_t *size_r);
 
57
ssize_t i_stream_read_copy_from_parent(struct istream *istream);
 
58
void i_stream_default_seek(struct istream_private *stream,
 
59
                           uoff_t v_offset, bool mark);
 
60
 
 
61
#endif