public inbox for overseers@sourceware.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@zembu.com>
To: kingdon@redhat.com
Cc: tromey@cygnus.com, overseers@sourceware.cygnus.com
Subject: Re: question about kcvs
Date: Sat, 20 May 2000 14:30:00 -0000	[thread overview]
Message-ID: <20000520213013.15359.qmail@daffy.airs.com> (raw)
Message-ID: <20000520143000.EjI7mCul875JYiTDpnlYY71gnuTKfg81dohDYslFjqM@z> (raw)
In-Reply-To: <200005201723.NAA04789@devserv.devel.redhat.com>

   Date: Sat, 20 May 2000 13:23:05 -0400
   From: Jim Kingdon <kingdon@redhat.com>

   So, Ian, care to submit a patch to CVS to fix the error reporting bug
   in CVS?

   I'll even check it in if you don't want to (although if memory serves
   you still do have checkin access to CVS).

   That is just embarrassing...  "Use GDB to see the real error message"...
   Kind of cool in a geek way, but....

Geeze, I can't believe people are just too lazy to drop into gdb.
What is the world coming to?

I don't know if I still have cvs checkin access.  I'm too lazy to find
out.

Ian


2000-05-20  Ian Lance Taylor  <ian@zembu.com>

	* client.c (connect_to_gserver): Handle server error messages
	reasonably.


--- client.c.~1~	Fri Aug 14 14:04:09 1998
+++ client.c	Sat May 20 14:27:32 2000
@@ -3927,7 +3927,29 @@
 
 	    recv_bytes (sock, cbuf, 2);
 	    need = ((cbuf[0] & 0xff) << 8) | (cbuf[1] & 0xff);
-	    assert (need <= sizeof buf);
+
+	    if (need > sizeof buf)
+	    {
+		int got;
+
+		/* This usually means that the server sent us an error
+		   message.  Read it byte by byte and print it out.
+		   FIXME: This is a terrible error handling strategy.
+		   However, even if we fix the server, we will still
+		   want to do this to work with older servers.  */
+		buf[0] = cbuf[0];
+		buf[1] = cbuf[1];
+		got = recv (sock, buf + 2, sizeof buf - 2, 0);
+		if (got < 0)
+		    error (1, 0, "recv() from server %s: %s",
+			   CVSroot_hostname, SOCK_STRERROR (SOCK_ERRNO));
+		buf[got + 2] = '\0';
+		if (buf[got + 1] == '\n')
+		    buf[got + 1] = '\0';
+		error (1, 0, "error from server %s: %s", CVSroot_hostname,
+		       buf);
+	    }
+
 	    recv_bytes (sock, buf, need);
 	    tok_in.length = need;
 	}

  parent reply	other threads:[~2000-05-20 14:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-30  6:08 Tom Tromey
2000-05-19 15:05 ` Tom Tromey
2000-12-30  6:08 ` Ian Lance Taylor
2000-05-19 20:10   ` Ian Lance Taylor
2000-12-30  6:08   ` Jason Molenda
2000-05-19 21:00     ` Jason Molenda
2000-12-30  6:08     ` Jeffrey A Law
2000-05-20  8:47       ` Jeffrey A Law
2000-12-30  6:08     ` Chris Faylor
2000-05-19 21:06       ` Chris Faylor
2000-12-30  6:08   ` Jim Kingdon
2000-05-20 10:23     ` Jim Kingdon
2000-12-30  6:08     ` Ian Lance Taylor [this message]
2000-05-20 14:30       ` Ian Lance Taylor
2000-12-30  6:08       ` Jim Kingdon
2000-05-20 15:02         ` Jim Kingdon
2000-12-30  6:08 ` Jason Molenda
2000-05-19 15:12   ` Jason Molenda
2000-12-30  6:08   ` Tom Tromey
2000-05-19 15:14     ` Tom Tromey
2000-12-30  6:08 ` Ian Lance Taylor
2000-05-19 16:35   ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000520213013.15359.qmail@daffy.airs.com \
    --to=ian@zembu.com \
    --cc=kingdon@redhat.com \
    --cc=overseers@sourceware.cygnus.com \
    --cc=tromey@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).