~cpick/mongrel2/release

« back to all changes in this revision

Viewing changes to src/response.c

  • Committer: Chris Pick
  • Date: 2013-06-30 16:39:57 UTC
  • mfrom: (1106.1.15)
  • Revision ID: git-v1:ec39967acb6bc9867ed9b9dc3774304ca6b9c294
Merge tag 'v1.8.1' into debian

Hotfix for github issue 148

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
// TODO: for now these are full error responses, but let people change them
44
44
 
 
45
struct tagbstring HTTP_100 = bsStatic("HTTP/1.1 100 Continue\r\n\r\n");
 
46
 
45
47
struct tagbstring HTTP_400 = bsStatic("HTTP/1.1 400 Bad Request\r\n"
46
48
    "Content-Type: text/plain\r\n"
47
49
    "Connection: close\r\n"
108
110
    "\r\n\r\n"
109
111
    "Precondition Failed");
110
112
 
 
113
struct tagbstring HTTP_417 = bsStatic("HTTP/1.1 417 Expectation Failed\r\n"
 
114
                                      "Content-Type: text/plain\r\n"
 
115
                                      "Connection: close\r\n"
 
116
                                      "Content-Length: 18\r\n"
 
117
                                      "Server: " VERSION "\r\n"
 
118
                                      "\r\n"
 
119
                                      "Expectation Failed");
 
120
 
111
121
 
112
122
struct tagbstring HTTP_304 = bsStatic("HTTP/1.1 304 Not Modified\r\n"
113
123
    "Connection: close\r\n"
120
130
        "<!DOCTYPE cross-domain-policy SYSTEM \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">"
121
131
        "<cross-domain-policy> <allow-access-from domain=\"*\" to-ports=\"*\" /></cross-domain-policy>");
122
132
 
123
 
 
124
133
int Response_send_status(Connection *conn, bstring error)
125
134
{
126
135
    return IOBuf_send(conn->iob, bdata(error), blength(error));