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

« back to all changes in this revision

Viewing changes to src/lib-storage/index/cydir/cydir-mail.c

  • 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
 
/* Copyright (c) 2007-2011 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2007-2012 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "istream.h"
20
20
 
21
21
static int cydir_mail_stat(struct mail *mail, struct stat *st_r)
22
22
{
23
 
        struct mail_private *p = (struct mail_private *)mail;
24
23
        const char *path;
25
24
 
26
 
        if (mail->lookup_abort == MAIL_LOOKUP_ABORT_NOT_IN_CACHE)
27
 
                return mail_set_aborted(mail);
 
25
        if (mail->lookup_abort == MAIL_LOOKUP_ABORT_NOT_IN_CACHE) {
 
26
                mail_set_aborted(mail);
 
27
                return -1;
 
28
        }
28
29
 
29
 
        p->stats_stat_lookup_count++;
 
30
        mail->transaction->stats.stat_lookup_count++;
30
31
        path = cydir_mail_get_path(mail);
31
32
        if (stat(path, st_r) < 0) {
32
33
                if (errno == ENOENT)
92
93
}
93
94
 
94
95
static int
95
 
cydir_mail_get_stream(struct mail *_mail, struct message_size *hdr_size,
96
 
                      struct message_size *body_size, struct istream **stream_r)
 
96
cydir_mail_get_stream(struct mail *_mail, bool get_body ATTR_UNUSED,
 
97
                      struct message_size *hdr_size,
 
98
                      struct message_size *body_size,
 
99
                      struct istream **stream_r)
97
100
{
98
101
        struct index_mail *mail = (struct index_mail *)_mail;
99
102
        const char *path;
100
103
        int fd;
101
104
 
102
105
        if (mail->data.stream == NULL) {
103
 
                mail->mail.stats_open_lookup_count++;
 
106
                _mail->transaction->stats.open_lookup_count++;
104
107
                path = cydir_mail_get_path(_mail);
105
108
                fd = open(path, O_RDONLY);
106
109
                if (fd == -1) {
130
133
        index_mail_set_seq,
131
134
        index_mail_set_uid,
132
135
        index_mail_set_uid_cache_updates,
 
136
        index_mail_prefetch,
 
137
        index_mail_precache,
 
138
        index_mail_add_temp_wanted_fields,
133
139
 
134
140
        index_mail_get_flags,
135
141
        index_mail_get_keywords,
152
158
        index_mail_update_modseq,
153
159
        NULL,
154
160
        index_mail_expunge,
155
 
        index_mail_parse,
156
161
        index_mail_set_cache_corrupted,
157
162
        index_mail_opened
158
163
};