brainy commented on code in PR #32:
URL: https://github.com/apache/subversion/pull/32#discussion_r2177835696


##########
subversion/libsvn_ra_serf/util.c:
##########
@@ -451,6 +451,20 @@ ssl_server_cert_cb(void *baton, int failures,
   return save_error(session, err);
 }
 
+#if defined(HAVE_SERF_SSL_ERROR_CB_SET)
+static apr_status_t
+ssl_error_cb(void *baton,
+             const char *message)
+{
+  svn_ra_serf__connection_t *conn = baton;
+  svn_ra_serf__session_t *session = conn->session;
+
+  session->ssl_error = apr_pstrdup(session->pool, message);

Review Comment:
   Something like this:
   ```
       session->ssl_error = svn_error_create(SVN_ERR_RA_SERF_WRAPPED_ERROR,
                                             session->ssl_error, message);
   ```
   The trick is that `svn_error_create()` will copy the `message` to the 
error's internal pool; instead of the messages polluting the session pool 
without any reasonable bounds, they'll just vanish along with the error chain 
when it's cleared. You'd also get the messages in a more natural order, with 
the one returned from `serf_context_run()` on the top of the stack instead of 
the bottom.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@subversion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to