[MEDIUM] make the http server error function a pointer in the session
It was a bit awkward to have session.c call return_srv_error() for
HTTP error messages related to servers. The function has been adapted
to be passed a pointer to the faulty stream interface, and is now a
pointer in the session. It is possible that in the future, it will
become a callback in the stream interface itself.
diff --git a/include/types/session.h b/include/types/session.h
index 92bfa06..83d0a45 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -188,7 +188,9 @@
long long bytes_in; /* number of bytes transferred from the client to the server */
long long bytes_out; /* number of bytes transferred from the server to the client */
} logs;
- void (*do_log)(struct session *s); /* the function to call in order to log */
+ void (*do_log)(struct session *s); /* the function to call in order to log (or NULL) */
+ void (*srv_error)(struct session *s, /* the function to call upon unrecoverable server errors (or NULL) */
+ struct stream_interface *si);
short int data_source; /* where to get the data we generate ourselves */
short int data_state; /* where to get the data we generate ourselves */
union {