#include <proto/frontend.h>
#include <proto/hdr_idx.h>
#include <proto/log.h>
+#include <proto/raw_sock.h>
#include <proto/session.h>
#include <proto/pipe.h>
#include <proto/protocols.h>
session_store_counters(s);
pool_free2(pool2_session, s);
out_close:
- if (ret < 0 && p->mode == PR_MODE_HTTP) {
+ if (ret < 0 && l->data == &raw_sock && p->mode == PR_MODE_HTTP) {
/* critical error, no more memory, try to emit a 500 response */
struct chunk *err_msg = http_error_message(s, HTTP_ERR_500);
send(cfd, err_msg->str, err_msg->len, MSG_DONTWAIT|MSG_NOSIGNAL);