Use pop3d_outf instead of fprintf; (struct daemon_param): Initialize transcript member.
Showing
1 changed file
with
14 additions
and
13 deletions
... | @@ -32,7 +32,8 @@ struct daemon_param daemon_param = { | ... | @@ -32,7 +32,8 @@ struct daemon_param daemon_param = { |
32 | MODE_INTERACTIVE, /* Start in interactive (inetd) mode */ | 32 | MODE_INTERACTIVE, /* Start in interactive (inetd) mode */ |
33 | 20, /* Default maximum number of children */ | 33 | 20, /* Default maximum number of children */ |
34 | 110, /* Standard POP3 port */ | 34 | 110, /* Standard POP3 port */ |
35 | 600 /* Idle timeout */ | 35 | 600, /* Idle timeout */ |
36 | 0, /* No transcript by default */ | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | /* Number of child processes. */ | 39 | /* Number of child processes. */ |
... | @@ -255,7 +256,7 @@ pop3d_mainloop (int infile, int outfile) | ... | @@ -255,7 +256,7 @@ pop3d_mainloop (int infile, int outfile) |
255 | } | 256 | } |
256 | 257 | ||
257 | /* Lets boogie. */ | 258 | /* Lets boogie. */ |
258 | fprintf (ofile, "+OK POP3 Ready %s\r\n", md5shared); | 259 | pop3d_outf ("+OK POP3 Ready %s\r\n", md5shared); |
259 | 260 | ||
260 | while (state != UPDATE) | 261 | while (state != UPDATE) |
261 | { | 262 | { |
... | @@ -323,27 +324,27 @@ pop3d_mainloop (int infile, int outfile) | ... | @@ -323,27 +324,27 @@ pop3d_mainloop (int infile, int outfile) |
323 | if (status == OK) | 324 | if (status == OK) |
324 | ; /* Everything is good. */ | 325 | ; /* Everything is good. */ |
325 | else if (status == ERR_WRONG_STATE) | 326 | else if (status == ERR_WRONG_STATE) |
326 | fprintf (ofile, "-ERR " BAD_STATE "\r\n"); | 327 | pop3d_outf ("-ERR " BAD_STATE "\r\n"); |
327 | else if (status == ERR_BAD_ARGS) | 328 | else if (status == ERR_BAD_ARGS) |
328 | fprintf (ofile, "-ERR " BAD_ARGS "\r\n"); | 329 | pop3d_outf ("-ERR " BAD_ARGS "\r\n"); |
329 | else if (status == ERR_NO_MESG) | 330 | else if (status == ERR_NO_MESG) |
330 | fprintf (ofile, "-ERR " NO_MESG "\r\n"); | 331 | pop3d_outf ("-ERR " NO_MESG "\r\n"); |
331 | else if (status == ERR_MESG_DELE) | 332 | else if (status == ERR_MESG_DELE) |
332 | fprintf (ofile, "-ERR " MESG_DELE "\r\n"); | 333 | pop3d_outf ("-ERR " MESG_DELE "\r\n"); |
333 | else if (status == ERR_NOT_IMPL) | 334 | else if (status == ERR_NOT_IMPL) |
334 | fprintf (ofile, "-ERR " NOT_IMPL "\r\n"); | 335 | pop3d_outf ("-ERR " NOT_IMPL "\r\n"); |
335 | else if (status == ERR_BAD_CMD) | 336 | else if (status == ERR_BAD_CMD) |
336 | fprintf (ofile, "-ERR " BAD_COMMAND "\r\n"); | 337 | pop3d_outf ("-ERR " BAD_COMMAND "\r\n"); |
337 | else if (status == ERR_BAD_LOGIN) | 338 | else if (status == ERR_BAD_LOGIN) |
338 | fprintf (ofile, "-ERR " BAD_LOGIN "\r\n"); | 339 | pop3d_outf ("-ERR " BAD_LOGIN "\r\n"); |
339 | else if (status == ERR_MBOX_LOCK) | 340 | else if (status == ERR_MBOX_LOCK) |
340 | fprintf (ofile, "-ERR [IN-USE] " MBOX_LOCK "\r\n"); | 341 | pop3d_outf ("-ERR [IN-USE] " MBOX_LOCK "\r\n"); |
341 | else if (status == ERR_TOO_LONG) | 342 | else if (status == ERR_TOO_LONG) |
342 | fprintf (ofile, "-ERR " TOO_LONG "\r\n"); | 343 | pop3d_outf ("-ERR " TOO_LONG "\r\n"); |
343 | else if (status == ERR_FILE) | 344 | else if (status == ERR_FILE) |
344 | fprintf (ofile, "-ERR " FILE_EXP "\r\n"); | 345 | pop3d_outf ("-ERR " FILE_EXP "\r\n"); |
345 | else | 346 | else |
346 | fprintf (ofile, "-ERR unknown error\r\n"); | 347 | pop3d_outf ("-ERR unknown error\r\n"); |
347 | 348 | ||
348 | free (cmd); | 349 | free (cmd); |
349 | free (arg); | 350 | free (arg); | ... | ... |
-
Please register or sign in to post a comment