Module Name:    src
Committed By:   pooka
Date:           Sun Feb  6 15:43:20 UTC 2011

Modified Files:
        src/lib/librumpclient: rumpclient.c rumpclient.h

Log Message:
Add another connection retry model which simply does exit(1) if
the connection is severed.
(mostly for tests so that everything can be hooked to rump_server's exit)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/librumpclient/rumpclient.c
cvs rdiff -u -r1.3 -r1.4 src/lib/librumpclient/rumpclient.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.23 src/lib/librumpclient/rumpclient.c:1.24
--- src/lib/librumpclient/rumpclient.c:1.23	Sun Feb  6 15:41:37 2011
+++ src/lib/librumpclient/rumpclient.c	Sun Feb  6 15:43:20 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpclient.c,v 1.23 2011/02/06 15:41:37 pooka Exp $	*/
+/*      $NetBSD: rumpclient.c,v 1.24 2011/02/06 15:43:20 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -101,6 +101,8 @@
 			/* no persistent connections */
 			if (retrytimo == 0)
 				break;
+			if (retrytimo == RUMPCLIENT_RETRYCONN_DIE)
+				exit(1);
 
 			if (!prevreconmsg) {
 				prevreconmsg = time(NULL);
@@ -805,7 +807,7 @@
 rumpclient_setconnretry(time_t timeout)
 {
 
-	if (timeout < RUMPCLIENT_RETRYCONN_ONCE)
+	if (timeout < RUMPCLIENT_RETRYCONN_DIE)
 		return; /* gigo */
 
 	retrytimo = timeout;

Index: src/lib/librumpclient/rumpclient.h
diff -u src/lib/librumpclient/rumpclient.h:1.3 src/lib/librumpclient/rumpclient.h:1.4
--- src/lib/librumpclient/rumpclient.h:1.3	Thu Jan 27 18:04:05 2011
+++ src/lib/librumpclient/rumpclient.h	Sun Feb  6 15:43:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpclient.h,v 1.3 2011/01/27 18:04:05 pooka Exp $	*/
+/*	$NetBSD: rumpclient.h,v 1.4 2011/02/06 15:43:20 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -39,6 +39,7 @@
 
 #define RUMPCLIENT_RETRYCONN_INFTIME ((time_t)-1)
 #define RUMPCLIENT_RETRYCONN_ONCE ((time_t)-2)
+#define RUMPCLIENT_RETRYCONN_DIE ((time_t)-3)
 void rumpclient_setconnretry(time_t);
 
 __END_DECLS

Reply via email to