]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] replace the ambiguous client_return function by stream_int_return
authorWilly Tarreau <w@1wt.eu>
Sun, 30 Nov 2008 18:22:53 +0000 (19:22 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 30 Nov 2008 18:22:53 +0000 (19:22 +0100)
This one applies to a stream interface, which makes more sense.

include/proto/proto_http.h
include/proto/senddata.h
include/proto/stream_interface.h
src/proto_http.c
src/senddata.c
src/stream_interface.c

index 0fcbea65c89778845a2913057c242432071a1f88..e291eae3d7e0be2fc77a55316e712d41d14ad71b 100644 (file)
@@ -66,7 +66,6 @@ int process_request(struct session *t);
 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);
 
index 5cb5b6441bce8afa89ccf4f477bc979a16623bd8..eb658037137786df3f1b0fbe48d35b44b55617e7 100644 (file)
@@ -28,7 +28,6 @@
 #include <types/session.h>
 
 void client_retnclose(struct session *s, const struct chunk *msg);
-void client_return(struct session *s, const struct chunk *msg);
 
 #endif /* _PROTO_SENDDATA_H */
 
index 9967a6e33192bd1b7f965284f7971e24ec13947a..bbdcecc71612ead961b1c517dca873f463500bb2 100644 (file)
@@ -3,7 +3,7 @@
   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
@@ -31,6 +31,7 @@
 /* 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 */
 
index b14322eb9a6c0a6646926a1d5d5e304a8a7ee594..e3216415aaeb8327437c01b0793ba7c6e0d104fd 100644 (file)
@@ -549,7 +549,7 @@ void srv_close_with_err(struct session *t, int err, int finst,
        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;
@@ -2675,7 +2675,7 @@ int process_response(struct session *t)
                                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))
@@ -2704,7 +2704,7 @@ int process_response(struct session *t)
                                //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))
@@ -2729,7 +2729,7 @@ int process_response(struct session *t)
                                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))
@@ -2753,7 +2753,7 @@ int process_response(struct session *t)
                                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))
@@ -2853,7 +2853,7 @@ int process_response(struct session *t)
                                        //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))
index 5d4b8a6be983868f818bd2bbbc6271a26b7fe604..fd1d8389bf15f3b5635edc18b82194a63a2c0fc1 100644 (file)
@@ -63,21 +63,6 @@ void client_retnclose(struct session *s, const struct chunk *msg)
        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
index debdaa71fbb2b657fc04bd0a380977061251c272..96087906f90d999e50cf938b68a6ad26d1a57d0e 100644 (file)
@@ -58,6 +58,19 @@ void stream_int_report_error(struct stream_interface *si)
        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