version 0.3.11
authorSomeDude <SomeDude@NuBL7aaJ6Cn4fB7GXFb9Zfi8w1FhPyW3oKgU9TweZMw>
Sat, 19 Jul 2008 08:57:00 +0000 (10:57 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sat, 19 Jul 2008 08:57:00 +0000 (10:57 +0200)
include/global.h
src/freenet/trustlistrequester.cpp

index 094d3f2..55d8857 100644 (file)
@@ -7,7 +7,7 @@
 \r
 #define VERSION_MAJOR          "0"\r
 #define VERSION_MINOR          "3"\r
-#define VERSION_RELEASE                "10"\r
+#define VERSION_RELEASE                "11"\r
 #define FMS_VERSION                    VERSION_MAJOR"."VERSION_MINOR"."VERSION_RELEASE\r
 \r
 typedef Poco::ScopedLock<Poco::FastMutex> Guard;\r
index d7dc27b..f22b25a 100644 (file)
@@ -106,7 +106,7 @@ const bool TrustListRequester::HandleAllData(FCPMessage &message)
                // loop through all trust entries in xml and add to database if we don't already know them\r
                for(long i=0; i<xml.TrustCount(); i++)\r
                {\r
-                       int id;\r
+                       int id=-1;\r
                        std::string identity;\r
                        std::string messagetrustcomment="";\r
                        std::string trustlisttrustcomment="";\r
@@ -135,41 +135,44 @@ const bool TrustListRequester::HandleAllData(FCPMessage &message)
                        st.Reset();\r
 \r
                        //insert trust for this identity\r
-                       trustst.Bind(0,identityid);\r
-                       trustst.Bind(1,id);\r
-                       if(xml.GetMessageTrust(i)==-1)\r
+                       if(id!=-1)\r
                        {\r
-                               trustst.Bind(2);\r
-                       }\r
-                       else\r
-                       {\r
-                               trustst.Bind(2,xml.GetMessageTrust(i));\r
-                       }\r
-                       if(xml.GetTrustListTrust(i)==-1)\r
-                       {\r
-                               trustst.Bind(3);\r
-                       }\r
-                       else\r
-                       {\r
-                               trustst.Bind(3,xml.GetTrustListTrust(i));\r
-                       }\r
-                       messagetrustcomment=xml.GetMessageTrustComment(i);\r
-                       trustlisttrustcomment=xml.GetTrustListTrustComment(i);\r
-                       // limit comments to 50 characters each\r
-                       if(messagetrustcomment.size()>50)\r
-                       {\r
-                               messagetrustcomment.erase(50);\r
-                       }\r
-                       if(trustlisttrustcomment.size()>50)\r
-                       {\r
-                               trustlisttrustcomment.erase(50);\r
+                               trustst.Bind(0,identityid);\r
+                               trustst.Bind(1,id);\r
+                               if(xml.GetMessageTrust(i)==-1)\r
+                               {\r
+                                       trustst.Bind(2);\r
+                               }\r
+                               else\r
+                               {\r
+                                       trustst.Bind(2,xml.GetMessageTrust(i));\r
+                               }\r
+                               if(xml.GetTrustListTrust(i)==-1)\r
+                               {\r
+                                       trustst.Bind(3);\r
+                               }\r
+                               else\r
+                               {\r
+                                       trustst.Bind(3,xml.GetTrustListTrust(i));\r
+                               }\r
+                               messagetrustcomment=xml.GetMessageTrustComment(i);\r
+                               trustlisttrustcomment=xml.GetTrustListTrustComment(i);\r
+                               // limit comments to 50 characters each\r
+                               if(messagetrustcomment.size()>50)\r
+                               {\r
+                                       messagetrustcomment.erase(50);\r
+                               }\r
+                               if(trustlisttrustcomment.size()>50)\r
+                               {\r
+                                       trustlisttrustcomment.erase(50);\r
+                               }\r
+                               trustst.Bind(4,messagetrustcomment);\r
+                               trustst.Bind(5,trustlisttrustcomment);\r
+                               trustst.Step();\r
+                               trustst.Reset();\r
                        }\r
-                       trustst.Bind(4,messagetrustcomment);\r
-                       trustst.Bind(5,trustlisttrustcomment);\r
-                       trustst.Step();\r
-                       trustst.Reset();\r
-\r
                }\r
+\r
                trustst.Finalize();\r
                st.Finalize();\r
 \r