int process_response(struct session *t);
void client_retnclose(struct session *s, const struct chunk *msg);
-void client_return(struct session *s, const struct chunk *msg);
void srv_close_with_err(struct session *t, int err, int finst,
int status, const struct chunk *msg);
This file contains stream_interface function prototypes
Copyright (C) 2000-2008 Willy Tarreau - w@1wt.eu
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1
/* main event functions used to move data between sockets and buffers */
void stream_int_check_timeouts(struct stream_interface *si);
void stream_int_report_error(struct stream_interface *si);
+void stream_int_return(struct stream_interface *si, const struct chunk *msg);
#endif /* _PROTO_STREAM_INTERFACE_H */
if (status > 0 && msg) {
t->txn.status = status;
if (t->fe->mode == PR_MODE_HTTP)
- client_return(t, msg);
+ stream_int_return(t->rep->cons, msg);
}
if (!(t->flags & SN_ERR_MASK))
t->flags |= err;
t->be->failed_resp++;
rep->analysers = 0;
txn->status = 502;
- client_return(t, error_message(t, HTTP_ERR_502));
+ stream_int_return(rep->cons, error_message(t, HTTP_ERR_502));
if (!(t->flags & SN_ERR_MASK))
t->flags |= SN_ERR_PRXCOND;
if (!(t->flags & SN_FINST_MASK))
//t->be->failed_resp++;
rep->analysers = 0;
txn->status = 502;
- client_return(t, error_message(t, HTTP_ERR_502));
+ stream_int_return(rep->cons, error_message(t, HTTP_ERR_502));
if (!(t->flags & SN_ERR_MASK))
t->flags |= SN_ERR_SRVCL;
if (!(t->flags & SN_FINST_MASK))
t->be->failed_resp++;
rep->analysers = 0;
txn->status = 504;
- client_return(t, error_message(t, HTTP_ERR_504));
+ stream_int_return(rep->cons, error_message(t, HTTP_ERR_504));
if (!(t->flags & SN_ERR_MASK))
t->flags |= SN_ERR_SRVTO;
if (!(t->flags & SN_FINST_MASK))
t->be->failed_resp++;
rep->analysers = 0;
txn->status = 502;
- client_return(t, error_message(t, HTTP_ERR_502));
+ stream_int_return(rep->cons, error_message(t, HTTP_ERR_502));
if (!(t->flags & SN_ERR_MASK))
t->flags |= SN_ERR_SRVCL;
if (!(t->flags & SN_FINST_MASK))
//req->cons->state = SI_ST_CLO;
rep->analysers = 0;
txn->status = 502;
- client_return(t, error_message(t, HTTP_ERR_502));
+ stream_int_return(rep->cons, error_message(t, HTTP_ERR_502));
if (!(t->flags & SN_ERR_MASK))
t->flags |= SN_ERR_PRXCOND;
if (!(t->flags & SN_FINST_MASK))
buffer_write_ena(s->rep);
}
-
-/*
- * returns a message into the rep buffer, and flushes the req buffer.
- * The reply buffer doesn't need to be empty before this. The message
- * is contained in a "chunk". If it is null, then an empty message is
- * used.
- */
-void client_return(struct session *s, const struct chunk *msg)
-{
- buffer_flush(s->req);
- buffer_flush(s->rep);
- if (msg && msg->len)
- buffer_write(s->rep, msg->str, msg->len);
-}
-
/*
* Local variables:
* c-indent-level: 8
si->ib->flags |= BF_READ_ERROR;
}
+/*
+ * Returns a message into the output buffer, and flushes the input buffer. The
+ * output buffer doesn't need to be empty before this. The message is contained
+ * in a "chunk". If it is null, then an empty message is used.
+ */
+void stream_int_return(struct stream_interface *si, const struct chunk *msg)
+{
+ buffer_flush(si->ib);
+ buffer_flush(si->ob);
+ if (msg && msg->len)
+ buffer_write(si->ob, msg->str, msg->len);
+}
+
/*
* Local variables:
* c-indent-level: 8