gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r14886 - in gnunet/src: datacache include vpn


From: gnunet
Subject: [GNUnet-SVN] r14886 - in gnunet/src: datacache include vpn
Date: Wed, 6 Apr 2011 09:46:10 +0200

Author: grothoff
Date: 2011-04-06 09:46:10 +0200 (Wed, 06 Apr 2011)
New Revision: 14886

Modified:
   gnunet/src/datacache/plugin_datacache_sqlite.c
   gnunet/src/include/gnunet_datastore_plugin.h
   gnunet/src/vpn/gnunet-service-dns.c
   gnunet/src/vpn/gnunet-vpn-packet.h
Log:
going less bitfield crazy

Modified: gnunet/src/datacache/plugin_datacache_sqlite.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_sqlite.c      2011-04-06 07:24:51 UTC 
(rev 14885)
+++ gnunet/src/datacache/plugin_datacache_sqlite.c      2011-04-06 07:46:10 UTC 
(rev 14886)
@@ -440,6 +440,7 @@
                    "sqlite", _("Sqlite datacache running\n"));
   return api;
 }
+// explain SELECT type FROM gn090 WHERE NOT EXISTS (SELECT 1 from gn090 WHERE 
expire < 42 LIMIT 1) OR expire < 42 ORDER BY repl DESC, Random() LIMIT 1;
 
 
 /**

Modified: gnunet/src/include/gnunet_datastore_plugin.h
===================================================================
--- gnunet/src/include/gnunet_datastore_plugin.h        2011-04-06 07:24:51 UTC 
(rev 14885)
+++ gnunet/src/include/gnunet_datastore_plugin.h        2011-04-06 07:46:10 UTC 
(rev 14886)
@@ -169,7 +169,7 @@
  * in the datastore.
  *
  * @param cls closure
- * @param key maybe NULL (to match all entries)
+ * @param key key to match, never NULL
  * @param vhash hash of the value, maybe NULL (to
  *        match all values that have the right key).
  *        Note that for DBlocks there is no difference

Modified: gnunet/src/vpn/gnunet-service-dns.c
===================================================================
--- gnunet/src/vpn/gnunet-service-dns.c 2011-04-06 07:24:51 UTC (rev 14885)
+++ gnunet/src/vpn/gnunet-service-dns.c 2011-04-06 07:46:10 UTC (rev 14886)
@@ -75,7 +75,7 @@
 static struct answer_packet_list *tail;
 
 /**
- * A structure containing a mapping from network-byte-ordered DNS-id to
+ * A structure containing a mapping from network-byte-ordered DNS-id (16 bit) 
to
  * some information needed to handle this query
  *
  * It currently allocates at least
@@ -86,12 +86,12 @@
 static struct {
     unsigned valid:1;
     struct GNUNET_SERVER_Client* client;
-    unsigned local_ip:32;
-    unsigned remote_ip:32;
-    unsigned local_port:16;
+    uint32_t local_ip;
+    uint32_t remote_ip;
+    uint16_t local_port;
     char* name;
-    unsigned namelen:8;
-} query_states[65536];
+    uint8_t namelen;
+} query_states[UINT16_MAX];
 
 /**
  * A struct used to give more than one value as

Modified: gnunet/src/vpn/gnunet-vpn-packet.h
===================================================================
--- gnunet/src/vpn/gnunet-vpn-packet.h  2011-04-06 07:24:51 UTC (rev 14885)
+++ gnunet/src/vpn/gnunet-vpn-packet.h  2011-04-06 07:46:10 UTC (rev 14886)
@@ -71,7 +71,7 @@
 
 // DNS-Stuff
 struct dns_static {
-       unsigned short id GNUNET_PACKED;
+        uint16_t id GNUNET_PACKED;
 
        unsigned rd:1 GNUNET_PACKED; // recursion desired (client -> server)
        unsigned tc:1 GNUNET_PACKED; // message is truncated
@@ -88,10 +88,10 @@
        unsigned z:3 GNUNET_PACKED;  // reserved
        unsigned ra:1 GNUNET_PACKED; // recursion available (server -> client)
 
-       unsigned short qdcount GNUNET_PACKED; // number of questions
-       unsigned short ancount GNUNET_PACKED; // number of answers
-       unsigned short nscount GNUNET_PACKED; // number of authority-records
-       unsigned short arcount GNUNET_PACKED; // number of additional records
+       uint16_t qdcount GNUNET_PACKED; // number of questions
+        uint16_t ancount GNUNET_PACKED; // number of answers
+       uint16_t nscount GNUNET_PACKED; // number of authority-records
+       uint16_t arcount GNUNET_PACKED; // number of additional records
 };
 
 struct dns_pkt {




reply via email to

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