Sun Java System Web Proxy Server 4.0.11 NSAPI Developer's Guide

protocol_scan_headers

Scans HTTP headers from a specified network buffer, and places them in a specified parameter block.

Folded lines are joined and the linefeeds are removed but not the whitespace. Any repeat headers are joined and the two field bodies are separated by a comma and space. For example, multiple mail headers are combined into one header and a comma is used to separate the field bodies.

Syntax

#include <frame/protocol.h>
int protocol_scan_headers(Session *sn, netbuf *buf, char *t, pblock *headers);

Returns

Returns REQ_PROCEED if the operation succeeded, or REQ_ABORTED if the operation did not succeed.

Parameters

Session *sn is the session that generated the request. The structure named by sn contains a pointer to a netbuf called inbuf. If the parameter buf is NULL, the function automatically uses inbuf.

Note that sn is an optional parameter that is used for error logs. Use NULL if you wish.

netbuf *buf is the network buffer to be scanned for HTTP headers.

char *t defines a string of length REQ_MAX_LINE. This is an optimization for the internal code to reduce usage of runtime stack.

pblock *headers is the parameter block to receive the headers.

See Also

protocol_handle_session, protocol_start_response, protocol_status