You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/10/13 02:55:06 UTC
svn commit: r1531610 - in /subversion/trunk/subversion: include/svn_ra.h
libsvn_ra_svn/client.c tests/libsvn_ra/ra-test.c
Author: brane
Date: Sun Oct 13 00:55:06 2013
New Revision: 1531610
URL: http://svn.apache.org/r1531610
Log:
Change the RA tunnel callbacks so that they no longer refer to types
defined in the svn_ra_svn.h header.
* subversion/include/svn_ra.h
(struct svn_ra_svn_conn_st): Remove forward declaration.
(svn_ra_open_tunnel_func_t): Replace the conn output parameter with
request and response file handles.
* subversion/libsvn_ra_svn/client.c (open_session): Update to match
the changed open-tunnel callback signature, and creat the ra_svn
session here.
* subversion/tests/libsvn_ra/ra-test.c: Do not include svn_ra_svn.h.
(open_tunnel): Fix signature and implementation.
Modified:
subversion/trunk/subversion/include/svn_ra.h
subversion/trunk/subversion/libsvn_ra_svn/client.c
subversion/trunk/subversion/tests/libsvn_ra/ra-test.c
Modified: subversion/trunk/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_ra.h?rev=1531610&r1=1531609&r2=1531610&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_ra.h (original)
+++ subversion/trunk/subversion/include/svn_ra.h Sun Oct 13 00:55:06 2013
@@ -272,18 +272,15 @@ typedef svn_error_t *(*svn_ra_replay_rev
/**
- * Forward-declared ra_svn connection type.
- * @see svn_ra_svn.h
- */
-struct svn_ra_svn_conn_st;
-
-/**
* Callback function for opening a tunnel in ra_svn.
*
* Given the @a tunnel_name, tunnel @a user and server @a hostname and
* @a port, return a new ra_svn connection in @a conn. The returned
* connection must be allocated from @a pool.
*
+ * @a request and @a response are the standard input and output,
+ * respectively, of the process on the other end of the tunnel.
+ *
* @a tunnel_baton will be passed on to the close-unnel callback.
*
* @a open_baton is the baton as originally passed to ra_open.
@@ -291,7 +288,7 @@ struct svn_ra_svn_conn_st;
* @since New in 1.9.
*/
typedef svn_error_t *(*svn_ra_open_tunnel_func_t)(
- struct svn_ra_svn_conn_st **conn,
+ apr_file_t **request, apr_file_t **response,
void **tunnel_baton, void *open_baton,
const char *tunnel_name, const char *user,
const char *hostname, int port,
Modified: subversion/trunk/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/client.c?rev=1531610&r1=1531609&r2=1531610&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/client.c Sun Oct 13 00:55:06 2013
@@ -629,11 +629,12 @@ static svn_error_t *open_session(svn_ra_
SVN_ERR(make_tunnel(tunnel_argv, &conn, pool));
else
{
- void *tunnel_baton = NULL;
- SVN_ERR(callbacks->open_tunnel(&conn, &tunnel_baton,
- callbacks_baton,
- tunnel_name, uri->user,
- uri->hostname, uri->port,
+ void *tunnel_baton;
+ apr_file_t *request;
+ apr_file_t *response;
+ SVN_ERR(callbacks->open_tunnel(&request, &response, &tunnel_baton,
+ callbacks_baton, tunnel_name,
+ uri->user, uri->hostname, uri->port,
pool));
if (callbacks->close_tunnel)
{
@@ -648,6 +649,11 @@ static svn_error_t *open_session(svn_ra_
apr_pool_cleanup_register(pool, td, close_tunnel_cleanup,
apr_pool_cleanup_null);
}
+
+ conn = svn_ra_svn_create_conn3(NULL, response, request,
+ SVN_DELTA_COMPRESSION_LEVEL_DEFAULT,
+ 0, 0, pool);
+ SVN_ERR(svn_ra_svn__skip_leading_garbage(conn, pool));
}
}
else
Modified: subversion/trunk/subversion/tests/libsvn_ra/ra-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_ra/ra-test.c?rev=1531610&r1=1531609&r2=1531610&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_ra/ra-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_ra/ra-test.c Sun Oct 13 00:55:06 2013
@@ -25,13 +25,13 @@
#include <apr_general.h>
#include <apr_pools.h>
+#include <apr_file_io.h>
#define SVN_DEPRECATED
#include "svn_error.h"
#include "svn_delta.h"
#include "svn_ra.h"
-#include "svn_ra_svn.h"
#include "svn_pools.h"
#include "svn_cmdline.h"
#include "svn_dirent_uri.h"
@@ -97,8 +97,8 @@ commit_changes(svn_ra_session_t *session
static int tunnel_open_count;
static svn_error_t *
-open_tunnel(svn_ra_svn_conn_t **conn, void **tunnel_baton,
- void *callbacks_baton,
+open_tunnel(apr_file_t **request, apr_file_t **response,
+ void **tunnel_baton, void *callbacks_baton,
const char *tunnel_name, const char *user,
const char *hostname, int port,
apr_pool_t *pool)
@@ -144,10 +144,8 @@ open_tunnel(svn_ra_svn_conn_t **conn, vo
apr_file_inherit_unset(proc->in);
apr_file_inherit_unset(proc->out);
- *conn = svn_ra_svn_create_conn3(NULL, proc->out, proc->in,
- SVN_DELTA_COMPRESSION_LEVEL_DEFAULT,
- 0, 0, pool);
-
+ *request = proc->in;
+ *response = proc->out;
*tunnel_baton = NULL;
++tunnel_open_count;
return SVN_NO_ERROR;