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.

§212 ANNOYANCE-FILTER POP3 PROXY SERVER CLASS DEFINITION 175<br />

212. Send the status line received from the server back to the client. Why wait so long? Because if<br />

we’ve modified the multi-line reply, we also may wish to modify the status line to reflect the length of<br />

the modified reply.<br />

〈 Relay the status line from the server to the client 212 〉 ≡<br />

clientLength = send (clientSocket , serverBuffer , serverLength , 0);<br />

if (clientLength ≠ serverLength ) {<br />

perror ("POP3Proxy␣relaying␣status␣of␣request␣to␣client");<br />

break;<br />

}<br />

if (popProxyTrace ) {<br />

cerr ≪ "POP3:␣Relaying␣" ≪ serverLength ≪ "␣byte␣status␣line␣to␣client:␣" ≪<br />

serverBuffer ;<br />

if ((serverLength ≡ 0) ∨ (serverBuffer [serverLength − 1]) ≠ ’\n’) {<br />

cerr ≪ endl ; /∗ “Can’t happen”—but just in case ∗/<br />

}<br />

}<br />

This code is used in section 204.

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

Saved successfully!

Ooh no, something went wrong!