gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3458 - in GNUnet/src: applications/rpc transports util/cro


From: grothoff
Subject: [GNUnet-SVN] r3458 - in GNUnet/src: applications/rpc transports util/cron
Date: Sun, 8 Oct 2006 13:17:11 -0700 (PDT)

Author: grothoff
Date: 2006-10-08 13:17:09 -0700 (Sun, 08 Oct 2006)
New Revision: 3458

Modified:
   GNUnet/src/applications/rpc/rpc.c
   GNUnet/src/transports/tcp_helper.c
   GNUnet/src/util/cron/cron.c
Log:
fixes

Modified: GNUnet/src/applications/rpc/rpc.c
===================================================================
--- GNUnet/src/applications/rpc/rpc.c   2006-10-08 20:14:29 UTC (rev 3457)
+++ GNUnet/src/applications/rpc/rpc.c   2006-10-08 20:17:09 UTC (rev 3458)
@@ -439,6 +439,7 @@
   pi->lastRequestTimes[0] = get_time();
   pi->lastRequestId[0] = messageID;
   pi->oldestRTIndex = 1;
+  vectorInsertLast(peerInformation, pi);
   MUTEX_UNLOCK(rpcLock);
 }
 

Modified: GNUnet/src/transports/tcp_helper.c
===================================================================
--- GNUnet/src/transports/tcp_helper.c  2006-10-08 20:14:29 UTC (rev 3457)
+++ GNUnet/src/transports/tcp_helper.c  2006-10-08 20:17:09 UTC (rev 3458)
@@ -243,7 +243,7 @@
   tcpSession->sender = *(coreAPI->myIdentity);
   tcpSession->expectingWelcome = YES;
   tcpSession->lock = MUTEX_CREATE(YES);
-  tcpSession->users = 1; /* us only, core has not seen this tsession! */
+  tcpSession->users = 1; /* select only, core has not seen this tsession! */
   tsession = MALLOC(sizeof(TSession));
   tsession->ttype = TCP_PROTOCOL_NUMBER;
   tsession->internal = tcpSession;
@@ -255,7 +255,8 @@
                                 struct SelectHandle * sh,
                                 struct SocketHandle * sock,
                                 void * sock_ctx) {
-  FREE(sock_ctx);
+  TSession * tsession = sock_ctx;
+  tcpDisconnect(tsession);
 }
 
 /**
@@ -352,7 +353,7 @@
   tsession->internal = tcpSession;
   tsession->ttype = protocolNumber;
   tcpSession->lock = MUTEX_CREATE(YES);
-  tcpSession->users = 1; /* caller */
+  tcpSession->users = 2; /* caller + select */
   tcpSession->sender = helo->senderIdentity;
   tcpSession->expectingWelcome = NO;
   MUTEX_LOCK(tcplock);
@@ -379,7 +380,8 @@
           "Could not sent TCP welcome message, closing connection.\n");
 #endif
     /* disconnect caller -- error! */
-    tcpDisconnect(tsession);
+    tcpDisconnect(tsession); /* for caller */
+    tcpDisconnect(tsession); /* for select */
     MUTEX_UNLOCK(tcplock);
     return SYSERR;
   } else if (stats != NULL) 

Modified: GNUnet/src/util/cron/cron.c
===================================================================
--- GNUnet/src/util/cron/cron.c 2006-10-08 20:14:29 UTC (rev 3457)
+++ GNUnet/src/util/cron/cron.c 2006-10-08 20:17:09 UTC (rev 3458)
@@ -257,9 +257,9 @@
 void cron_suspend(struct CronManager * cron,
                  int checkSelf) {
   if ( (YES == checkSelf) &&
+       (cron->cron_shutdown == NO) &&
        (NO != PTHREAD_TEST_SELF(cron->cron_handle)) )
     return;
-  GE_ASSERT(NULL, cron->cron_shutdown == NO);
   GE_ASSERT(NULL, NO == PTHREAD_TEST_SELF(cron->cron_handle));
   MUTEX_LOCK(cron->inBlockLock_);
   cron->inBlock++;
@@ -287,6 +287,7 @@
 void cron_resume_jobs(struct CronManager * cron,
                      int checkSelf) {
   if ( (YES == checkSelf) &&
+       (cron->cron_shutdown == NO) &&
        (NO != PTHREAD_TEST_SELF(cron->cron_handle)) )
     return;
   GE_ASSERT(NULL, cron->inBlock > 0);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]