git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-svn: fix "Malformed network data" with svn:// servers

From
EWEric Wong <normalperson@yhbt.net>
Date
Sep 7, 2007, 07:34 UTC
Message-ID
<20070907073424.GA16468@mayonaise>
In-Reply-To
<20070807134220.23420.qmail@c96e4a6cce1e57.315fe32.mid.smarden.org>

We have a workaround for the reparent function not working correctly on the SVN native protocol servers. This workaround opens a new connection (SVN::Ra object) to the new URL/directory.

Since libsvn appears limited to only supporting one connection at a time, this workaround invalidates the Git::SVN::Ra object that is $self inside gs_fetch_loop_common(). So we need to restart that connection once all the fetching is done for each loop iteration to be able to run get_log() successfully.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
  Gerrit Pape <pape@smarden.org> wrote:
  > On Wed, Jul 04, 2007 at 02:07:42PM -0700, Eric Wong wrote:
  > >   Although this fixes blocking reads, this does *not* fix the
  > >   "Malformed network data" issue, which has been around for a
  > >   while...
  > > 
  > >   I'll try to find time to fix the "Malformed network data" bug
  > >   in a few days time, but it's not fatal (just restart git-svn,
  > >   this error happens at a point where it's not possible to have
  > >   a corrupted import).
  > 
  > Hi, this still is a problem we face on Debian with 1.5.3-rc3
  >  http://bugs.debian.org/436142
  >  http://bugs.debian.org/430091
  > 
  > I'm sorry, I didn't manage to provide a patch.
  Sorry for the latency again.
 git-svn.perl |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index d3c8cd0..7df4098 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3175,6 +3175,7 @@ sub gs_do_switch {
 			$reparented = 1;
 		} else {
 			$ra = Git::SVN::Ra->new($full_url);
+			$self->{-invalid} = 1;
 		}
 	}
 	$ra ||= $self;
@@ -3310,6 +3311,11 @@ sub gs_fetch_loop_common {
 		$min = $max + 1;
 		$max += $inc;
 		$max = $head if ($max > $head);
+		if ($self->{-invalid}) {
+			my $ra_url = $self->{url};
+			$self = undef;
+			$self = Git::SVN::Ra->new($ra_url);
+		}
 	}
 }
 
-- 
Eric Wong
Previous: Gerrit PapeNext: Eric Wong
Message 5 of 9 in “git-svn: libsvn-perl_1.4.4 and do_switch()”
  1. Gerrit PapeJun 26, 2007
  2. Gerrit PapeJul 4, 2007
  3. git-svn: fix blocking with svn:// servers after do_switchEric Wong, Jul 4, 2007
  4. git-svn: "Malformed network data" issueGerrit Pape, Aug 7, 2007
  5. git-svn: fix "Malformed network data" with svn:// serversEric Wong, Sep 7, 2007
  6. Eric WongSep 7, 2007
  7. git-svn: fix "Malformed network data" with svn:// serversEric Wong, Sep 7, 2007
  8. Gerrit PapeFeb 8, 2008
  9. Gerrit PapeApr 18, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.