File: addheader1.cc

package info (click to toggle)
crossroads 2.65-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,664 kB
  • ctags: 355
  • sloc: cpp: 4,212; perl: 1,658; xml: 269; makefile: 186; sh: 46
file content (20 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "httpbuffer"

void Httpbuffer::addheader (string const &h) {
    PROFILE("Httpbuffer::addheader(string)");

    if (!headersreceived())
	return;
    
    unsigned i;
    for (i = 0; i < h.size(); i++)
	if (h[i] == ':') {
	    string var = h.substr(0, i);
	    i++;
	    while (isspace(h[i]))
		i++;
	    string val = h.substr(i);
	    addheader (var, val);
	    return;
	}
}