"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/backend.c" between
haproxy-2.2.1.tar.gz and haproxy-2.2.2.tar.gz

About: HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments.

backend.c  (haproxy-2.2.1):backend.c  (haproxy-2.2.2)
skipping to change at line 1459 skipping to change at line 1459
} }
srv_cs = si_alloc_cs(&s->si[1], srv_conn); srv_cs = si_alloc_cs(&s->si[1], srv_conn);
if (!srv_cs) { if (!srv_cs) {
conn_free(srv_conn); conn_free(srv_conn);
return SF_ERR_RESOURCE; return SF_ERR_RESOURCE;
} }
srv_conn->ctx = srv_cs; srv_conn->ctx = srv_cs;
#if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negot iation) #if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negot iation)
if (!srv || if (!srv ||
((!(srv->ssl_ctx.alpn_str) && !(srv->ssl_ctx.npn_str)) || (srv->use_ssl != 1 || (!(srv->ssl_ctx.alpn_str) && !(srv->ssl
srv->mux_proto || s->be->mode != PR_MODE_HTTP)) _ctx.npn_str)) ||
srv->mux_proto || s->be->mode != PR_MODE_HTTP))
#endif #endif
init_mux = 1; init_mux = 1;
#if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negot iation) #if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negot iation)
else else
srv_conn->owner = s->sess; srv_conn->owner = s->sess;
#endif #endif
/* process the case where the server requires the PROXY protocol to be sent */ /* process the case where the server requires the PROXY protocol to be sent */
srv_conn->send_proxy_ofs = 0; srv_conn->send_proxy_ofs = 0;
if (srv && srv->pp_opts) { if (srv && srv->pp_opts) {
skipping to change at line 1519 skipping to change at line 1519
} else { } else {
_HA_ATOMIC_ADD(&s->be->be_counters.connect, 1); _HA_ATOMIC_ADD(&s->be->be_counters.connect, 1);
if (srv) if (srv)
_HA_ATOMIC_ADD(&srv->counters.connect, 1); _HA_ATOMIC_ADD(&srv->counters.connect, 1);
} }
err = si_connect(&s->si[1], srv_conn); err = si_connect(&s->si[1], srv_conn);
if (err != SF_ERR_NONE) if (err != SF_ERR_NONE)
return err; return err;
/* The CO_FL_SEND_PROXY flag may have been set by the connect method,
* if so, add our handshake pseudo-XPRT now.
*/
if ((srv_conn->flags & CO_FL_HANDSHAKE)) {
if (xprt_add_hs(srv_conn) < 0) {
conn_full_close(srv_conn);
return SF_ERR_INTERNAL;
}
}
/* We have to defer the mux initialization until after si_connect() /* We have to defer the mux initialization until after si_connect()
* has been called, as we need the xprt to have been properly * has been called, as we need the xprt to have been properly
* initialized, or any attempt to recv during the mux init may * initialized, or any attempt to recv during the mux init may
* fail, and flag the connection as CO_FL_ERROR. * fail, and flag the connection as CO_FL_ERROR.
*/ */
if (init_mux) { if (init_mux) {
if (conn_install_mux_be(srv_conn, srv_cs, s->sess) < 0) { if (conn_install_mux_be(srv_conn, srv_cs, s->sess) < 0) {
conn_full_close(srv_conn); conn_full_close(srv_conn);
return SF_ERR_INTERNAL; return SF_ERR_INTERNAL;
} }
/* If we're doing http-reuse always, and the connection is not /* If we're doing http-reuse always, and the connection is not
* private with available streams (an http2 connection), add it * private with available streams (an http2 connection), add it
* to the available list, so that others can use it right away. * to the available list, so that others can use it right away.
*/ */
if (srv && ((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_ALWS ) && if (srv && ((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_ALWS ) &&
!(srv_conn->flags & CO_FL_PRIVATE) && srv_conn->mux->avail_st reams(srv_conn) > 0) !(srv_conn->flags & CO_FL_PRIVATE) && srv_conn->mux->avail_st reams(srv_conn) > 0)
LIST_ADDQ(&srv->available_conns[tid], mt_list_to_list(&sr v_conn->list)); LIST_ADDQ(&srv->available_conns[tid], mt_list_to_list(&sr v_conn->list));
} }
/* The CO_FL_SEND_PROXY flag may have been set by the connect method,
* if so, add our handshake pseudo-XPRT now.
*/
if ((srv_conn->flags & CO_FL_HANDSHAKE)) {
if (xprt_add_hs(srv_conn) < 0) {
conn_full_close(srv_conn);
return SF_ERR_INTERNAL;
}
}
#if USE_OPENSSL && (defined(OPENSSL_IS_BORINGSSL) || (HA_OPENSSL_VERSION_NUMBER >= 0x10101000L)) #if USE_OPENSSL && (defined(OPENSSL_IS_BORINGSSL) || (HA_OPENSSL_VERSION_NUMBER >= 0x10101000L))
if (!reuse && cli_conn && srv && srv_conn->mux && if (!reuse && cli_conn && srv && srv_conn->mux &&
(srv->ssl_ctx.options & SRV_SSL_O_EARLY_DATA) && (srv->ssl_ctx.options & SRV_SSL_O_EARLY_DATA) &&
/* Only attempt to use early data if either the client sent /* Only attempt to use early data if either the client sent
* early data, so that we know it can handle a 425, or if * early data, so that we know it can handle a 425, or if
* we are allwoed to retry requests on early data failure, and * we are allwoed to retry requests on early data failure, and
* it's our first try * it's our first try
*/ */
skipping to change at line 1626 skipping to change at line 1627
/* Report EOI on the channel if it was reached from the mux point of /* Report EOI on the channel if it was reached from the mux point of
* view. * view.
* *
* Note: This test is only required because si_cs_process is also the SI * Note: This test is only required because si_cs_process is also the SI
* wake callback. Otherwise si_cs_recv()/si_cs_send() already take * wake callback. Otherwise si_cs_recv()/si_cs_send() already take
* care of it. * care of it.
*/ */
if ((srv_cs->flags & CS_FL_EOI) && !(si_ic(&s->si[1])->flags & CF_EOI)) if ((srv_cs->flags & CS_FL_EOI) && !(si_ic(&s->si[1])->flags & CF_EOI))
si_ic(&s->si[1])->flags |= (CF_EOI|CF_READ_PARTIAL); si_ic(&s->si[1])->flags |= (CF_EOI|CF_READ_PARTIAL);
/* catch all sync connect while the mux is not already installed */
if (!srv_conn->mux && !(srv_conn->flags & CO_FL_WAIT_XPRT)) {
if (conn_create_mux(srv_conn) < 0) {
conn_full_close(srv_conn);
return SF_ERR_INTERNAL;
}
}
return SF_ERR_NONE; /* connection is OK */ return SF_ERR_NONE; /* connection is OK */
} }
/* This function performs the "redispatch" part of a connection attempt. It /* This function performs the "redispatch" part of a connection attempt. It
* will assign a server if required, queue the connection if required, and * will assign a server if required, queue the connection if required, and
* handle errors that might arise at this level. It can change the server * handle errors that might arise at this level. It can change the server
* state. It will return 1 if it encounters an error, switches the server * state. It will return 1 if it encounters an error, switches the server
* state, or has to queue a connection. Otherwise, it will return 0 indicating * state, or has to queue a connection. Otherwise, it will return 0 indicating
* that the connection is ready to use. * that the connection is ready to use.
*/ */
 End of changes. 4 change blocks. 
11 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)