req can be NULL if we are coming from an error path.

This commit is contained in:
Joris Vink 2015-08-02 16:53:40 +02:00
parent e95d9cc88e
commit a20fb00789
1 changed files with 2 additions and 1 deletions

View File

@ -1247,7 +1247,8 @@ http_response_normal(struct http_request *req, struct connection *c,
}
}
if (req->owner->proto != CONN_PROTO_WEBSOCKET) {
/* Note that req CAN be NULL. */
if (req != NULL && req->owner->proto != CONN_PROTO_WEBSOCKET) {
if (http_keepalive_time && connection_close == 0) {
kore_buf_appendf(header_buf,
"connection: keep-alive\r\n");