12.06.2015 Views

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

§194 ANNOYANCE-FILTER POP3 PROXY SERVER CLASS DEFINITION 165<br />

void set<strong>Filter</strong>Function (POP3Proxy<strong>Filter</strong>Function ff )<br />

{<br />

filterFunction = ff ;<br />

}<br />

bool acceptConnections (int maxBacklog = 25);<br />

bool serviceConnection (void);<br />

bool operateProxyServer (int maxBacklog = 25);<br />

};<br />

#endif<br />

195. Some of the POP3 protocol command return multiple-line responses, terminated with a line<br />

containing a single “.” (text lines with this value are quoted by appending a single period). We<br />

initialise the multiLine set with commands which always return multiple-line results and cMultiLine<br />

with those which return multiple-line results when invoked with no arguments.<br />

〈 Define multi-line and conditional multi-line commands 195 〉 ≡<br />

multiLine .insert ("capa"); /∗ Extension in RFC 2449 ∗/<br />

multiLine .insert ("retr");<br />

multiLine .insert ("top");<br />

cMultiLine .insert ("list");<br />

cMultiLine .insert ("uidl");<br />

This code is used in section 194.<br />

196. <strong>The</strong> requestor is supposed to define all the properties of the POP3 connection before it is opened.<br />

Here we check for violations of this rule and chastise offenders.<br />

〈 Check for POP3 connection already opened 196 〉 ≡<br />

#ifndef NDEBUG<br />

if (opened ) {<br />

cerr ≪ "Attempt␣to␣modify␣POP3␣connection␣settings␣after␣connection␣opened." ≪ endl ;<br />

abort ( );<br />

}<br />

#endif<br />

This code is used in section 194.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!