bool svccb::fromresvport () const { const sockaddr_in *sinp = reinterpret_cast<const sockaddr_in *> (getsa ()); return (sinp && sinp->sin_family == AF_INET && ntohs (sinp->sin_port) < IPPORT_RESERVED); }
int headerbody(buffer *b,void (*dohf)(),void (*hdone)(),void (*dobl)()) //substdio *ss; //void (*dohf)(); //void (*hdone)(); //void (*dobl)(); { int match; int flaglineok; match = 1; flaglineok = 0; for (;;) { switch(getsa(b,&nextline,&match)) { case -1: return -1; case 0: if (flaglineok) dohf(&line); hdone(); /* no message body; could insert blank line here */ return 0; } if (flaglineok) { if ((nextline.s[0] == ' ') || (nextline.s[0] == '\t')) { if (!stralloc_cat(&line,&nextline)) return -1; continue; } dohf(&line); } if (nextline.len == 1) { hdone(); dobl(&nextline); break; } if (stralloc_starts(&nextline,"From ")) { if (!stralloc_copys(&line,"MBOX-Line: ")) return -1; if (!stralloc_cat(&line,&nextline)) return -1; } else if (hfield_valid(nextline.s,nextline.len)) { if (!stralloc_copy(&line,&nextline)) return -1; } else { hdone(); if (!stralloc_copys(&line,"\n")) return -1; dobl(&line); dobl(&nextline); break; } flaglineok = 1; } for (;;) switch(getsa(b,&nextline,&match)) { case -1: return -1; case 0: return 0; case 1: dobl(&nextline); } }