From: Willy Tarreau Date: Sun, 18 Oct 2009 21:56:35 +0000 (+0200) Subject: [MINOR] http: remove the last call to stream_int_return X-Git-Tag: v1.4-dev5~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e89b84848b4eb58549692e8c44084bd17ca24dd;p=thirdparty%2Fhaproxy.git [MINOR] http: remove the last call to stream_int_return And remove the now unused function itself too. --- diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index 6ee6ebfc61..4e7f734195 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -1,23 +1,23 @@ /* - include/proto/stream_interface.h - This file contains stream_interface function prototypes - - Copyright (C) 2000-2009 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 - exclusively. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ + * include/proto/stream_interface.h + * This file contains stream_interface function prototypes + * + * Copyright (C) 2000-2009 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 + * exclusively. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ #ifndef _PROTO_STREAM_INTERFACE_H #define _PROTO_STREAM_INTERFACE_H @@ -31,7 +31,6 @@ /* main event functions used to move data between sockets and buffers */ int 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); void stream_int_retnclose(struct stream_interface *si, const struct chunk *msg); /* functions used when running a stream interface as a task */ diff --git a/src/proto_http.c b/src/proto_http.c index f98ff5ad28..b83beb9e1e 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -3247,11 +3247,9 @@ int http_process_res_common(struct session *t, struct buffer *rep, int an_bit, s t->srv->counters.failed_resp++; cur_proxy->counters.failed_resp++; return_srv_prx_502: - buffer_shutr_now(rep); - buffer_shutw_now(req); rep->analysers = 0; txn->status = 502; - stream_int_return(rep->cons, error_message(t, HTTP_ERR_502)); + stream_int_retnclose(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)) diff --git a/src/stream_interface.c b/src/stream_interface.c index f4b723b6df..fcfa117b8b 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -59,19 +59,6 @@ void stream_int_report_error(struct stream_interface *si) si->ib->flags |= BF_READ_ERROR; } -/* - * Erase any content from input and output buffers, and return a message into - * the output buffer. The message is provided as 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_erase(si->ib); - buffer_cut_tail(si->ob); - if (msg && msg->len) - buffer_write(si->ob, msg->str, msg->len); -} - /* * Returns a message to the client ; the connection is shut down for read, * and the request is cleared so that no server connection can be initiated.