*/
si_release_endpoint(&s->si[1]);
+ srv = objt_server(s->target);
+
+ if (s->be->mode != PR_MODE_HTTP)
+ goto skip_reuse;
+
/* first, search for a matching connection in the session's idle conns */
srv_conn = session_get_conn(s->sess, s->target);
if (srv_conn)
reuse = 1;
- srv = objt_server(s->target);
-
if (srv && !reuse && reuse_mode != PR_O_REUSE_NEVR) {
/* Below we pick connections from the safe, idle or
* available (which are safe too) lists based
else
srv_conn = NULL;
+skip_reuse:
/* no reuse or failed to reuse the connection above, pick a new one */
if (!srv_conn) {
srv_conn = conn_new(s->target);
conn_full_close(srv_conn);
return SF_ERR_INTERNAL;
}
- /* If we're doing http-reuse always, and the connection is not
- * private with available streams (an http2 connection), add it
- * to the available list, so that others can use it right
- * away. If the connection is private or we're doing http-reuse
- * safe and the mux protocol supports multiplexing, add it in
- * the session server list.
- */
- if (srv && reuse_mode == PR_O_REUSE_ALWS &&
- !(srv_conn->flags & CO_FL_PRIVATE) && srv_conn->mux->avail_streams(srv_conn) > 0)
- LIST_ADDQ(&srv->available_conns[tid], mt_list_to_list(&srv_conn->list));
- else if (srv_conn->flags & CO_FL_PRIVATE ||
- (reuse_mode == PR_O_REUSE_SAFE &&
- srv_conn->mux->flags & MX_FL_HOL_RISK)) {
- /* If it fail now, the same will be done in mux->detach() callback */
- session_add_conn(s->sess, srv_conn, srv_conn->target);
+ if (s->be->mode != PR_MODE_HTTP) {
+ /* If we're doing http-reuse always, and the connection
+ * is not private with available streams (an http2
+ * connection), add it to the available list, so that
+ * others can use it right away. If the connection is
+ * private or we're doing http-reuse safe and the mux
+ * protocol supports multiplexing, add it in the
+ * session server list.
+ */
+ if (srv && reuse_mode == PR_O_REUSE_ALWS &&
+ !(srv_conn->flags & CO_FL_PRIVATE) &&
+ srv_conn->mux->avail_streams(srv_conn) > 0) {
+ LIST_ADDQ(&srv->available_conns[tid], mt_list_to_list(&srv_conn->list));
+ }
+ else if (srv_conn->flags & CO_FL_PRIVATE ||
+ (reuse_mode == PR_O_REUSE_SAFE &&
+ srv_conn->mux->flags & MX_FL_HOL_RISK)) {
+ /* If it fail now, the same will be done in mux->detach() callback */
+ session_add_conn(s->sess, srv_conn, srv_conn->target);
+ }
}
}