https://issues.apache.org/bugzilla/show_bug.cgi?id=39673

Yann Ylavic <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30888|0                           |1
        is obsolete|                            |
  Attachment #30889|0                           |1
        is obsolete|                            |

--- Comment #20 from Yann Ylavic <[email protected]> ---
Created attachment 31751
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31751&action=edit
Handle aside connections is mod_proxy (2.4.x)

(In reply to Vittorio Guglielmo from comment #19)
> opening a page containing various iframes each pointing to some of two
> Sharepoint backends, I find it address calls toward the wrong connection
> (backend).

Thanks for testing.

The previous patch did not work correctly whenever multiple requests on the
same client connection address different backend.
The only backend connection associated with the client one was reused, whether
or not the worker has changed.

This new patch addresses this by handling a hashtable of backend connections
(one per worker) for one client connection.

It is quite different from the previous one, by allowing any (proxy) module to
use the new :

+/**
+ * Acquire a connection from worker connection pool, or associated with
+ * the given conn_rec or request_rec.
+ * @param proxy_function calling proxy scheme (http, ajp, ...)
+ * @param conn    acquired connection
+ * @param worker  worker used for obtaining connection
+ * @param s       current server record
+ * @param baton   associated baton (or conn_rec if @acquire is NULL)
+ * @param acquire function (if not NULL) used to acquire aside connections,
+ *                  given @baton, @conn, @worker, and @s
+ * @param release function (if not NULL) used to release acquired connection,
+ *                  given @baton, @conn, @worker, and @s, as callback
+ * @return        OK or HTTP_XXX error
+ * @note If the connection limit has been reached, the function will
+ * block until a connection becomes available or the timeout has
+ * elapsed.
+ * @note If the given @baton is not NULL and @acquire is NULL, the baton is
+ * considered a conn_rec to which a connection will be attached (by worker).
+ */
+PROXY_DECLARE(int) ap_proxy_acquire_connection_ex(const char *proxy_function,
+                                                  proxy_conn_rec **conn,
+                                                  proxy_worker *worker,
+                                                  server_rec *s, void *baton,
+                                                  ap_proxy_acquire_fn acquire,
+                                                  ap_proxy_release_fn
release);
+

For now, only mod_proxy_http and mod_proxy_ajp have been changed to do so,
since the others seem not to reuse connections, but maybe it is worth using a
quick way to acquire/release a connection (ie. no reslist locks) for those too,
especially if it is always closed at the end (no recycling).

Can you give this new patch a try?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to