- fd = OPEN (pipename, O_RDONLY | O_ASYNC);
- if (fd == -1)
- {
- if (smtp_shutdown == GNUNET_NO)
- GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);
- continue;
- }
- fdes = fdopen (fd, "r");
- while (smtp_shutdown == GNUNET_NO)
- {
- /* skip until end of header */
- do
- {
- READLINE (line, linesize);
- }
- while ((line[0] != '\r') && (line[0] != '\n')); /* expect newline */
- READLINE (line, linesize); /* read base64 encoded message; decode, process */
- pos = 0;
- while (1)
- {
- pos = strlen (line) - 1; /* ignore new line */
- READLINE (&line[pos], linesize - pos); /* read base64 encoded message; decode, process */
- if ((line[pos] == '\r') || (line[pos] == '\n'))
- break; /* empty line => end of message! */
- }
- size = base64_decode (line, pos, &out);
- if (size < sizeof (SMTPMessage))
- {
- GNUNET_GE_BREAK (ectx, 0);
- GNUNET_free (out);
- goto END;
- }
-
- mp = (SMTPMessage *) & out[size - sizeof (SMTPMessage)];
- if (ntohs (mp->header.size) != size)
- {
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_WARNING | GNUNET_GE_BULK |
- GNUNET_GE_USER,
- _
- ("Received malformed message via %s. Ignored.\n"),
- "SMTP");
+ if (smtp_shutdown == GNUNET_NO)
+ GNUNET_thread_sleep (5 * GNUNET_CRON_SECONDS);
+ continue;
+ }
+ fdes = fdopen (fd, "r");
+ while (smtp_shutdown == GNUNET_NO)
+ {
+ /* skip until end of header */
+ do
+ {
+ READLINE (line, linesize);
+ }
+ while ((line[0] != '\r') && (line[0] != '\n')); /* expect newline */
+ READLINE (line, linesize); /* read base64 encoded message; decode, process */
+ pos = 0;
+ while (1)
+ {
+ pos = strlen (line) - 1; /* ignore new line */
+ READLINE (&line[pos], linesize - pos); /* read base64 encoded message; decode, process */
+ if ((line[pos] == '\r') || (line[pos] == '\n'))
+ break; /* empty line => end of message! */
+ }
+ size = base64_decode (line, pos, &out);
+ if (size < sizeof (SMTPMessage))
+ {
+ GNUNET_GE_BREAK (ectx, 0);
+ GNUNET_free (out);
+ goto END;
+ }
+
+ mp = (SMTPMessage *) &out[size - sizeof (SMTPMessage)];
+ if (ntohs (mp->header.size) != size)
+ {
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _("Received malformed message via %s. Ignored.\n"),
+ "SMTP");