~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2007-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2007-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "istream.h"
13
13
{
14
14
        const char *dir;
15
15
 
16
 
        dir = mailbox_list_get_path(mail->box->list, mail->box->name,
17
 
                                    MAILBOX_LIST_PATH_TYPE_MAILBOX);
 
16
        dir = mailbox_get_path(mail->box);
18
17
        return t_strdup_printf("%s/%u.", dir, mail->uid);
19
18
}
20
19
 
99
98
                      struct istream **stream_r)
100
99
{
101
100
        struct index_mail *mail = (struct index_mail *)_mail;
 
101
        struct istream *input;
102
102
        const char *path;
103
103
        int fd;
104
104
 
115
115
                        }
116
116
                        return -1;
117
117
                }
118
 
                mail->data.stream = i_stream_create_fd(fd, 0, TRUE);
119
 
                i_stream_set_name(mail->data.stream, path);
120
 
                index_mail_set_read_buffer_size(_mail, mail->data.stream);
 
118
                input = i_stream_create_fd(fd, 0, TRUE);
 
119
                i_stream_set_name(input, path);
 
120
                index_mail_set_read_buffer_size(_mail, input);
121
121
                if (mail->mail.v.istream_opened != NULL) {
122
 
                        if (mail->mail.v.istream_opened(_mail, stream_r) < 0)
 
122
                        if (mail->mail.v.istream_opened(_mail, &input) < 0) {
 
123
                                i_stream_unref(&input);
123
124
                                return -1;
 
125
                        }
124
126
                }
 
127
                mail->data.stream = input;
125
128
        }
126
129
 
127
130
        return index_mail_init_stream(mail, hdr_size, body_size, stream_r);
141
144
        index_mail_get_keywords,
142
145
        index_mail_get_keyword_indexes,
143
146
        index_mail_get_modseq,
 
147
        index_mail_get_pvt_modseq,
144
148
        index_mail_get_parts,
145
149
        index_mail_get_date,
146
150
        cydir_mail_get_received_date,
151
155
        index_mail_get_headers,
152
156
        index_mail_get_header_stream,
153
157
        cydir_mail_get_stream,
 
158
        index_mail_get_binary_stream,
154
159
        index_mail_get_special,
155
160
        index_mail_get_real_mail,
156
161
        index_mail_update_flags,
157
162
        index_mail_update_keywords,
158
163
        index_mail_update_modseq,
 
164
        index_mail_update_pvt_modseq,
159
165
        NULL,
160
166
        index_mail_expunge,
161
167
        index_mail_set_cache_corrupted,