Skip to content

Commit c6fcc8a

Browse files
committed
Added the temporary file descriptor to the data_start plugin call.
1 parent d9dba26 commit c6fcc8a

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
lines changed

backend-qmail.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static const response* do_recipient(str* recipient)
4040
return 0;
4141
}
4242

43-
static const response* data_start(void)
43+
static const response* data_start(int fd)
4444
{
4545
const char* qh;
4646

@@ -49,6 +49,7 @@ static const response* data_start(void)
4949
if (chdir(qh) == -1) return &resp_no_chdir;
5050

5151
return 0;
52+
(void)fd;
5253
}
5354

5455
static int retry_write(int fd, const char* bytes, unsigned long len)

mailfront.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ const response* handle_data_start(void)
106106
const response* resp = 0;
107107
if ((session.fd = scratchfile()) == -1)
108108
return &resp_internal;
109-
if (session.backend->data_start != 0)
110-
resp = session.backend->data_start();
111109
if (response_ok(resp))
112-
MODULE_CALL(data_start, (), 0);
110+
MODULE_CALL(data_start, (session.fd), 0);
111+
if (session.backend->data_start != 0)
112+
resp = session.backend->data_start(session.fd);
113113
data_response = response_ok(resp)
114114
? 0
115115
: resp;

mailfront.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct plugin
1616
const response* (*reset)(void);
1717
const response* (*sender)(str*);
1818
const response* (*recipient)(str*);
19-
const response* (*data_start)(void);
19+
const response* (*data_start)(int fd);
2020
const response* (*data_block)(const char* bytes, unsigned long len);
2121
const response* (*message_end)(int fd);
2222
};

plugin-add-received.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static const response* init(void)
124124
return 0;
125125
}
126126

127-
static const response* data_start(void)
127+
static const response* data_start(int fd)
128128
{
129129
if (session.backend->data_block != 0) {
130130
received.len = 0;
@@ -136,6 +136,7 @@ static const response* data_start(void)
136136
return session.backend->data_block(received.s, received.len);
137137
}
138138
return 0;
139+
(void)fd;
139140
}
140141

141142
struct plugin plugin = {

plugin-counters.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static const response* recipient(str* r)
6262
(void)r;
6363
}
6464

65-
static const response* start(void)
65+
static const response* start(int fd)
6666
{
6767
unsigned long maxhops;
6868
minenv("maxdatabytes", "DATABYTES");
@@ -77,6 +77,7 @@ static const response* start(void)
7777
in_rec = 1;
7878
in_dt = 1;
7979
return 0;
80+
(void)fd;
8081
}
8182

8283
static const response* block(const char* bytes, unsigned long len)

plugin-patterns.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static int patterns_read(const char* filename)
8686
return 1;
8787
}
8888

89-
static const response* init(void)
89+
static const response* init(int fd)
9090
{
9191
const char* tmp;
9292
unsigned u;
@@ -101,6 +101,7 @@ static const response* init(void)
101101
linemode = T_HEADER;
102102
linepos = 0;
103103
return 0;
104+
(void)fd;
104105
}
105106

106107
static const response* check_line(void)

plugin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static const response* recipient(str* recipient)
2525
return 0;
2626
}
2727

28-
static const response* data_start(void)
28+
static const response* data_start(int fd)
2929
{
3030
return 0;
3131
}

0 commit comments

Comments
 (0)