subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1350646 - in /subversion/trunk/subversion/libsvn_ra_serf: ra_serf.h serf.c update.c
Date Fri, 15 Jun 2012 14:52:56 GMT
Author: philip
Date: Fri Jun 15 14:52:55 2012
New Revision: 1350646

URL: http://svn.apache.org/viewvc?rev=1350646&view=rev
Log:
Move a constant to avoid hard-coding it twice.

* subversion/libsvn_ra_serf/update.c
  (MAX_NR_OF_CONNS): Move to...

* subversion/libsvn_ra_serf/ra_serf.h
  (MAX_NR_OF_CONNS): ...here.
  (struct svn_ra_serf__session_t): Make conns a known size array.

* subversion/libsvn_ra_serf/serf.c
  (svn_ra_serf__open): Don't allocate svn_ra_serf__connection_t.conns.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
    subversion/trunk/subversion/libsvn_ra_serf/serf.c
    subversion/trunk/subversion/libsvn_ra_serf/update.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h?rev=1350646&r1=1350645&r2=1350646&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Fri Jun 15 14:52:55 2012
@@ -103,6 +103,9 @@ typedef struct svn_ra_serf__connection_t
 
 } svn_ra_serf__connection_t;
 
+/** Max. number of connctions we'll open to the server. */
+#define MAX_NR_OF_CONNS 4
+
 /*
  * The master serf RA session.
  *
@@ -122,7 +125,7 @@ struct svn_ra_serf__session_t {
   svn_boolean_t using_compression;
 
   /* The current connection */
-  svn_ra_serf__connection_t **conns;
+  svn_ra_serf__connection_t *conns[MAX_NR_OF_CONNS];
   int num_conns;
   int cur_conn;
 

Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1350646&r1=1350645&r2=1350646&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Fri Jun 15 14:52:55 2012
@@ -394,9 +394,6 @@ svn_ra_serf__open(svn_ra_session_t *sess
 
   SVN_ERR(load_config(serf_sess, config, serf_sess->pool));
 
-
-  serf_sess->conns = apr_palloc(serf_sess->pool, sizeof(*serf_sess->conns) * 4);
-
   serf_sess->conns[0] = apr_pcalloc(serf_sess->pool,
                                     sizeof(*serf_sess->conns[0]));
   serf_sess->conns[0]->http10 = TRUE;  /* until we confirm HTTP/1.1  */

Modified: subversion/trunk/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/update.c?rev=1350646&r1=1350645&r2=1350646&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/update.c Fri Jun 15 14:52:55 2012
@@ -2253,8 +2253,6 @@ link_path(void *report_baton,
   return APR_SUCCESS;
 }
 
-/** Max. number of connctions we'll open to the server. */
-#define MAX_NR_OF_CONNS 4
 /** Minimum nr. of outstanding requests needed before a new connection is
  *  opened. */
 #define REQS_PER_CONN 8



Mime
View raw message