File: answerblob.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 (15 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "webinterface"

void Webinterface::answer_blob (string const &blob) {
    ostringstream cl;
    cl << blob.size();
    string resp = static_cast<string>
       ("HTTP/1.0 200 OK\r\n") +
	"Content-Type: text/xml\r\n"
	"Connection: close\r\n"
	"Content-Length: " + cl.str() + "\r\n"
	"\r\n" +
	blob;
    Netbuffer buf(resp);
    buf.netwrite(cfd, config.client_write_timeout());
}