mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Moved patches to their own directory.
This commit is contained in:
63
patches/bluecove-2.1.1-SNAPSHOT.patch
Normal file
63
patches/bluecove-2.1.1-SNAPSHOT.patch
Normal file
@@ -0,0 +1,63 @@
|
||||
diff -Bbur bluecove-2.1.1-SNAPSHOT/bluecove/pom.xml bluecove-2.1.1-SNAPSHOT-briar/bluecove/pom.xml
|
||||
--- bluecove-2.1.1-SNAPSHOT/bluecove/pom.xml 2013-01-04 00:43:17.961294408 +0000
|
||||
+++ bluecove-2.1.1-SNAPSHOT-briar/bluecove/pom.xml 2013-01-03 23:17:37.549293571 +0000
|
||||
@@ -126,8 +126,8 @@
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
- <source>1.3</source>
|
||||
- <target>1.1</target>
|
||||
+ <source>1.5</source>
|
||||
+ <target>1.5</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -355,7 +355,7 @@
|
||||
<configuration>
|
||||
<linkXref>true</linkXref>
|
||||
<minimumTokens>100</minimumTokens>
|
||||
- <targetJdk>1.4</targetJdk>
|
||||
+ <targetJdk>1.5</targetJdk>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
diff -Bbur bluecove-2.1.1-SNAPSHOT/bluecove/src/main/c/intelbth/OSXStackRFCOMMServer.mm bluecove-2.1.1-SNAPSHOT-briar/bluecove/src/main/c/intelbth/OSXStackRFCOMMServer.mm
|
||||
--- bluecove-2.1.1-SNAPSHOT/bluecove/src/main/c/intelbth/OSXStackRFCOMMServer.mm 2013-01-04 00:43:17.549293781 +0000
|
||||
+++ bluecove-2.1.1-SNAPSHOT-briar/bluecove/src/main/c/intelbth/OSXStackRFCOMMServer.mm 2013-01-03 23:19:02.269295705 +0000
|
||||
@@ -280,6 +280,10 @@
|
||||
ndebug(("fail to get IOBluetoothRFCOMMChannel"));
|
||||
return;
|
||||
}
|
||||
+ if(![rfcommChannel isIncoming]) {
|
||||
+ ndebug(("ignoring outgoing connection"));
|
||||
+ return;
|
||||
+ }
|
||||
if (comm->authenticate) {
|
||||
IOBluetoothDevice* device = [rfcommChannel getDevice];
|
||||
if (device == NULL) {
|
||||
diff -Bbur bluecove-2.1.1-SNAPSHOT/bluecove-gpl/pom.xml bluecove-2.1.1-SNAPSHOT-briar/bluecove-gpl/pom.xml
|
||||
--- bluecove-2.1.1-SNAPSHOT/bluecove-gpl/pom.xml 2013-01-04 00:43:14.509294005 +0000
|
||||
+++ bluecove-2.1.1-SNAPSHOT-briar/bluecove-gpl/pom.xml 2013-01-03 23:17:52.181293751 +0000
|
||||
@@ -81,8 +81,8 @@
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
- <source>1.3</source>
|
||||
- <target>1.1</target>
|
||||
+ <source>1.5</source>
|
||||
+ <target>1.5</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
diff -Bbur bluecove-2.1.1-SNAPSHOT/pom.xml bluecove-2.1.1-SNAPSHOT-briar/pom.xml
|
||||
--- bluecove-2.1.1-SNAPSHOT/pom.xml 2013-01-04 00:43:19.721293788 +0000
|
||||
+++ bluecove-2.1.1-SNAPSHOT-briar/pom.xml 2013-01-03 23:17:18.713293930 +0000
|
||||
@@ -436,7 +436,7 @@
|
||||
<configuration>
|
||||
<linkXref>true</linkXref>
|
||||
<minimumTokens>100</minimumTokens>
|
||||
- <targetJdk>1.4</targetJdk>
|
||||
+ <targetJdk>1.5</targetJdk>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
113
patches/jnotify-0.94.patch
Normal file
113
patches/jnotify-0.94.patch
Normal file
@@ -0,0 +1,113 @@
|
||||
briar-desktop/libs/jnotify-0.94.jar is built via:
|
||||
$ wget "http://downloads.sourceforge.net/project/jnotify/jnotify/jnotify-0.94/jnotify-lib-0.94.zip?r=&ts=$(date +%s)"
|
||||
$ unzip -d jnotify-lib-0.94 jnotify-lib-0.94.zip && cd jnotify-lib-0.94
|
||||
$ unzip -d src jnotify-0.94-src.zip
|
||||
$ wget -O build.xml "http://jnotify.cvs.sourceforge.net/viewvc/jnotify/jnotify/build.xml?revision=1.7&pathrev=HEAD"
|
||||
$ wget -O build.properties "http://jnotify.cvs.sourceforge.net/viewvc/jnotify/jnotify/build.properties?revision=1.13"
|
||||
$ patch -lp1 < /path/to/this/patch
|
||||
$ ant build_java # if this fails with invalid flag: -g:{lines,vars,source}, try removing the debug attributes from <javac>
|
||||
|
||||
diff -ru jnotify-0.94/net/contentobjects/jnotify/linux/JNotify_linux.java jnotify-0.94-briar/net/contentobjects/jnotify/linux/JNotify_linux.java
|
||||
--- jnotify-0.94/net/contentobjects/jnotify/linux/JNotify_linux.java 2012-04-25 00:03:54.000000000 +0100
|
||||
+++ jnotify-0.94-briar/net/contentobjects/jnotify/linux/JNotify_linux.java 2014-01-30 12:31:41.959082350 +0000
|
||||
@@ -37,6 +37,7 @@
|
||||
package net.contentobjects.jnotify.linux;
|
||||
|
||||
import net.contentobjects.jnotify.JNotifyException;
|
||||
+import net.contentobjects.jnotify.Util;
|
||||
|
||||
public class JNotify_linux
|
||||
{
|
||||
@@ -45,7 +46,7 @@
|
||||
|
||||
static
|
||||
{
|
||||
- System.loadLibrary("jnotify");
|
||||
+ Util.loadNative();
|
||||
int res = nativeInit();
|
||||
if (res != 0)
|
||||
{
|
||||
diff -ru jnotify-0.94/net/contentobjects/jnotify/macosx/JNotify_macosx.java jnotify-0.94-briar/net/contentobjects/jnotify/macosx/JNotify_macosx.java
|
||||
--- jnotify-0.94/net/contentobjects/jnotify/macosx/JNotify_macosx.java 2010-01-26 19:43:42.000000000 +0000
|
||||
+++ jnotify-0.94-briar/net/contentobjects/jnotify/macosx/JNotify_macosx.java 2014-01-30 12:31:41.959082350 +0000
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.contentobjects.jnotify.macosx;
|
||||
|
||||
import net.contentobjects.jnotify.JNotifyException;
|
||||
+import net.contentobjects.jnotify.Util;
|
||||
|
||||
public class JNotify_macosx
|
||||
{
|
||||
@@ -10,7 +11,7 @@
|
||||
|
||||
static
|
||||
{
|
||||
- System.loadLibrary("jnotify"); //$NON-NLS-1$
|
||||
+ Util.loadNative();
|
||||
Thread thread = new Thread("FSEvent thread") //$NON-NLS-1$
|
||||
{
|
||||
public void run()
|
||||
diff -ru jnotify-0.94/net/contentobjects/jnotify/Util.java jnotify-0.94-briar/net/contentobjects/jnotify/Util.java
|
||||
--- jnotify-0.94/net/contentobjects/jnotify/Util.java 2006-02-14 08:18:10.000000000 +0000
|
||||
+++ jnotify-0.94-briar/net/contentobjects/jnotify/Util.java 2014-01-30 12:31:41.959082350 +0000
|
||||
@@ -30,4 +30,26 @@
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
+
|
||||
+ public static void loadNative() throws UnsatisfiedLinkError {
|
||||
+ try
|
||||
+ {
|
||||
+ try
|
||||
+ {
|
||||
+ System.loadLibrary("jnotify");
|
||||
+ }
|
||||
+ catch (UnsatisfiedLinkError e) {
|
||||
+ System.loadLibrary("jnotify-" + System.getProperty("os.arch"));
|
||||
+ }
|
||||
+ }
|
||||
+ catch (UnsatisfiedLinkError e)
|
||||
+ {
|
||||
+ // add some extra debugging info
|
||||
+ String msg = "Error loading library, os.arch=" + System.getProperty("os.arch") +
|
||||
+ ", java.library.path=" + System.getProperty("java.library.path");
|
||||
+ UnsatisfiedLinkError e2 = new UnsatisfiedLinkError(msg);
|
||||
+ e2.initCause(e);
|
||||
+ throw e2;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
diff -ru jnotify-0.94/net/contentobjects/jnotify/win32/JNotify_win32.java jnotify-0.94-briar/net/contentobjects/jnotify/win32/JNotify_win32.java
|
||||
--- jnotify-0.94/net/contentobjects/jnotify/win32/JNotify_win32.java 2012-04-25 00:04:50.000000000 +0100
|
||||
+++ jnotify-0.94-briar/net/contentobjects/jnotify/win32/JNotify_win32.java 2014-01-30 12:31:41.959082350 +0000
|
||||
@@ -39,28 +39,13 @@
|
||||
package net.contentobjects.jnotify.win32;
|
||||
|
||||
import net.contentobjects.jnotify.JNotifyException;
|
||||
-
|
||||
+import net.contentobjects.jnotify.Util;
|
||||
|
||||
public class JNotify_win32
|
||||
{
|
||||
static
|
||||
{
|
||||
- try
|
||||
- {
|
||||
- if (System.getProperty("os.arch").equals("amd64"))
|
||||
- {
|
||||
- System.loadLibrary("jnotify_64bit");
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- System.loadLibrary("jnotify");
|
||||
- }
|
||||
- }
|
||||
- catch (UnsatisfiedLinkError e)
|
||||
- {
|
||||
- System.err.println("Error loading library, java.library.path=" + System.getProperty("java.library.path"));
|
||||
- throw e;
|
||||
- }
|
||||
+ Util.loadNative();
|
||||
int res = nativeInit();
|
||||
if (res != 0)
|
||||
{
|
||||
84
patches/jssc-0.9.patch
Normal file
84
patches/jssc-0.9.patch
Normal file
@@ -0,0 +1,84 @@
|
||||
diff -Bbur jSSC-0.9.0-Release/src/jssc/SerialPort.java jSSC-0.9.0-briar/src/jssc/SerialPort.java
|
||||
--- jSSC-0.9.0-Release/src/jssc/SerialPort.java 2011-12-21 13:29:10.000000000 +0000
|
||||
+++ jSSC-0.9.0-briar/src/jssc/SerialPort.java 2012-12-06 15:07:37.786033300 +0000
|
||||
@@ -30,13 +30,13 @@
|
||||
*/
|
||||
public class SerialPort {
|
||||
|
||||
- private SerialNativeInterface serialInterface;
|
||||
- private SerialPortEventListener eventListener;
|
||||
- private int portHandle;
|
||||
- private String portName;
|
||||
- private boolean portOpened = false;
|
||||
- private boolean maskAssigned = false;
|
||||
- private boolean eventListenerAdded = false;
|
||||
+ private volatile SerialNativeInterface serialInterface;
|
||||
+ private volatile SerialPortEventListener eventListener;
|
||||
+ private volatile int portHandle;
|
||||
+ private volatile String portName;
|
||||
+ private volatile boolean portOpened = false;
|
||||
+ private volatile boolean maskAssigned = false;
|
||||
+ private volatile boolean eventListenerAdded = false;
|
||||
|
||||
|
||||
public static final int BAUDRATE_110 = 110;
|
||||
@@ -915,7 +915,7 @@
|
||||
|
||||
private class EventThread extends Thread {
|
||||
|
||||
- private boolean threadTerminated = false;
|
||||
+ private volatile boolean threadTerminated = false;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
diff -Bbur jSSC-0.9.0-Release/src/jssc/SerialPortList.java jSSC-0.9.0-briar/src/jssc/SerialPortList.java
|
||||
--- jSSC-0.9.0-Release/src/jssc/SerialPortList.java 2011-12-21 13:30:30.000000000 +0000
|
||||
+++ jSSC-0.9.0-briar/src/jssc/SerialPortList.java 2012-12-06 14:31:50.142033801 +0000
|
||||
@@ -97,20 +97,15 @@
|
||||
*/
|
||||
private static String[] getLinuxPortNames() {
|
||||
String[] returnArray = new String[]{};
|
||||
- try {
|
||||
- Process dmesgProcess = Runtime.getRuntime().exec("dmesg");
|
||||
- BufferedReader reader = new BufferedReader(new InputStreamReader(dmesgProcess.getInputStream()));
|
||||
+ File dir = new File("/dev");
|
||||
+ if(dir.exists() && dir.isDirectory()){
|
||||
+ File[] files = dir.listFiles();
|
||||
+ if(files.length > 0){
|
||||
TreeSet<String> portsTree = new TreeSet<String>();
|
||||
ArrayList<String> portsList = new ArrayList<String>();
|
||||
- String buffer = "";
|
||||
- while((buffer = reader.readLine()) != null && !buffer.isEmpty()){
|
||||
- if(buffer.matches(".*(ttyS|ttyUSB)[0-9]{1,3}.*")){
|
||||
- String[] tmp = buffer.split(" ");
|
||||
- for(String value : tmp){
|
||||
- if(value.matches("(ttyS|ttyUSB)[0-9]{1,3}")){
|
||||
- portsTree.add("/dev/" + value);
|
||||
- }
|
||||
- }
|
||||
+ for(File file : files){
|
||||
+ if(!file.isDirectory() && !file.isFile() && file.getName().matches(".*(ttyS|ttyUSB|ttyACM)[0-9]{1,3}.*")){
|
||||
+ portsTree.add("/dev/" + file.getName());
|
||||
}
|
||||
}
|
||||
for(String portName : portsTree){
|
||||
@@ -130,10 +125,7 @@
|
||||
}
|
||||
}
|
||||
returnArray = portsList.toArray(returnArray);
|
||||
- reader.close();
|
||||
}
|
||||
- catch (IOException ex) {
|
||||
- //Do nothing
|
||||
}
|
||||
return returnArray;
|
||||
}
|
||||
@@ -179,7 +171,7 @@
|
||||
TreeSet<String> portsTree = new TreeSet<String>();
|
||||
ArrayList<String> portsList = new ArrayList<String>();
|
||||
for(File file : files){
|
||||
- if(!file.isDirectory() && !file.isFile() && file.getName().matches("tty.(serial.*|usbserial.*)")){
|
||||
+ if(!file.isDirectory() && !file.isFile() && file.getName().matches("tty.(modem.*|usbmodem.*|serial.*|usbserial.*)")){
|
||||
portsTree.add("/dev/" + file.getName());
|
||||
}
|
||||
}
|
||||
23
patches/jtorctl.patch
Normal file
23
patches/jtorctl.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
diff -Bbur jtorctl/net/freehaven/tor/control/TorControlConnection.java jtorctl-briar/net/freehaven/tor/control/TorControlConnection.java
|
||||
--- jtorctl/net/freehaven/tor/control/TorControlConnection.java 2014-10-03 12:21:51.883098440 +0100
|
||||
+++ jtorctl-briar/net/freehaven/tor/control/TorControlConnection.java 2014-10-06 16:28:53.516851714 +0100
|
||||
@@ -728,5 +728,19 @@
|
||||
sendAndWaitForResponse("CLOSECIRCUIT "+circID+
|
||||
(ifUnused?" IFUNUSED":"")+"\r\n", null);
|
||||
}
|
||||
+
|
||||
+ /** Tells Tor to exit when this control connection is closed. This command
|
||||
+ * was added in Tor 0.2.2.28-beta.
|
||||
+ */
|
||||
+ public void takeOwnership() throws IOException {
|
||||
+ sendAndWaitForResponse("TAKEOWNERSHIP\r\n", null);
|
||||
+ }
|
||||
+
|
||||
+ /** Tells Tor to forget any cached client state relating to the hidden
|
||||
+ * service with the given hostname (excluding the .onion extension).
|
||||
+ */
|
||||
+ public void forgetHiddenService(String hostname) throws IOException {
|
||||
+ sendAndWaitForResponse("FORGETHS " + hostname + "\r\n", null);
|
||||
+ }
|
||||
}
|
||||
|
||||
17
patches/spongy.sh
Executable file
17
patches/spongy.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
dirs=(ant core docs jce mail pg pkix prov)
|
||||
|
||||
for file in `find ${dirs[@]} -name bouncycastle`
|
||||
do
|
||||
path=`dirname $file`
|
||||
echo "Moving $file to $path/spongycastle"
|
||||
mv $file $path/spongycastle
|
||||
done
|
||||
|
||||
for file in `grep -Rl bouncycastle ${dirs[@]}`
|
||||
do
|
||||
echo "Replacing string bouncycastle in $file"
|
||||
sed -i 's/bouncycastle/spongycastle/g' $file
|
||||
done
|
||||
|
||||
194
patches/tor.patch
Normal file
194
patches/tor.patch
Normal file
@@ -0,0 +1,194 @@
|
||||
diff --git a/src/or/config.c b/src/or/config.c
|
||||
index 39b85aa..ff42d27 100644
|
||||
--- a/src/or/config.c
|
||||
+++ b/src/or/config.c
|
||||
@@ -1096,6 +1096,8 @@ options_act_reversible(const or_options_t *old_options, char **msg)
|
||||
"non-control network connections. Shutting down all existing "
|
||||
"connections.");
|
||||
connection_mark_all_noncontrol_connections();
|
||||
+ /* We can't complete circuits until the network is re-enabled. */
|
||||
+ can_complete_circuit = 0;
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/or/control.c b/src/or/control.c
|
||||
index 9378f38..17d2a46 100644
|
||||
--- a/src/or/control.c
|
||||
+++ b/src/or/control.c
|
||||
@@ -37,6 +37,8 @@
|
||||
#include "nodelist.h"
|
||||
#include "policies.h"
|
||||
#include "reasons.h"
|
||||
+#include "rendclient.h"
|
||||
+#include "rendcommon.h"
|
||||
#include "rephist.h"
|
||||
#include "router.h"
|
||||
#include "routerlist.h"
|
||||
@@ -156,6 +158,8 @@ static int handle_control_resolve(control_connection_t *conn, uint32_t len,
|
||||
static int handle_control_usefeature(control_connection_t *conn,
|
||||
uint32_t len,
|
||||
const char *body);
|
||||
+static int handle_control_forgeths(control_connection_t *conn, uint32_t len,
|
||||
+ const char *body);
|
||||
static int write_stream_target_to_buf(entry_connection_t *conn, char *buf,
|
||||
size_t len);
|
||||
static void orconn_target_get_name(char *buf, size_t len,
|
||||
@@ -3164,6 +3168,33 @@ handle_control_dropguards(control_connection_t *conn,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/** Called when we get a FORGETHS command: parse the hidden service's onion
|
||||
+ * address and purge any cached state related to the service. */
|
||||
+static int
|
||||
+handle_control_forgeths(control_connection_t *conn, uint32_t len,
|
||||
+ const char *body)
|
||||
+{
|
||||
+ smartlist_t *args;
|
||||
+ char *onion_address;
|
||||
+
|
||||
+ args = getargs_helper("FORGETHS", conn, body, 1, 1);
|
||||
+ if (!args)
|
||||
+ return -1;
|
||||
+ onion_address = smartlist_get(args, 0);
|
||||
+ smartlist_free(args);
|
||||
+
|
||||
+ if (!rend_valid_service_id(onion_address)) {
|
||||
+ connection_write_str_to_buf("513 Invalid hidden service address\r\n", conn);
|
||||
+ tor_free(onion_address);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ rend_client_purge_hidden_service(onion_address);
|
||||
+ tor_free(onion_address);
|
||||
+ send_control_done(conn);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/** Called when <b>conn</b> has no more bytes left on its outbuf. */
|
||||
int
|
||||
connection_control_finished_flushing(control_connection_t *conn)
|
||||
@@ -3461,6 +3492,9 @@ connection_control_process_inbuf(control_connection_t *conn)
|
||||
} else if (!strcasecmp(conn->incoming_cmd, "DROPGUARDS")) {
|
||||
if (handle_control_dropguards(conn, cmd_data_len, args))
|
||||
return -1;
|
||||
+ } else if (!strcasecmp(conn->incoming_cmd, "FORGETHS")) {
|
||||
+ if (handle_control_forgeths(conn, cmd_data_len, args))
|
||||
+ return -1;
|
||||
} else {
|
||||
connection_printf_to_buf(conn, "510 Unrecognized command \"%s\"\r\n",
|
||||
conn->incoming_cmd);
|
||||
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
|
||||
index 19a8cef..c17439d 100644
|
||||
--- a/src/or/rendclient.c
|
||||
+++ b/src/or/rendclient.c
|
||||
@@ -31,6 +31,8 @@
|
||||
static extend_info_t *rend_client_get_random_intro_impl(
|
||||
const rend_cache_entry_t *rend_query,
|
||||
const int strict, const int warnings);
|
||||
+static void purge_hid_serv_from_last_hid_serv_requests(
|
||||
+ const char *onion_address);
|
||||
|
||||
/** Purge all potentially remotely-detectable state held in the hidden
|
||||
* service client code. Called on SIGNAL NEWNYM. */
|
||||
@@ -42,6 +44,16 @@ rend_client_purge_state(void)
|
||||
rend_client_purge_last_hid_serv_requests();
|
||||
}
|
||||
|
||||
+/** Purge all cached state relating to the given hidden service. */
|
||||
+void
|
||||
+rend_client_purge_hidden_service(const char *onion_address)
|
||||
+{
|
||||
+ tor_assert(rend_valid_service_id(onion_address));
|
||||
+
|
||||
+ rend_cache_remove_entry(onion_address);
|
||||
+ purge_hid_serv_from_last_hid_serv_requests(onion_address);
|
||||
+}
|
||||
+
|
||||
/** Called when we've established a circuit to an introduction point:
|
||||
* send the introduction request. */
|
||||
void
|
||||
diff --git a/src/or/rendclient.h b/src/or/rendclient.h
|
||||
index 1f731d0..7084aef 100644
|
||||
--- a/src/or/rendclient.h
|
||||
+++ b/src/or/rendclient.h
|
||||
@@ -13,6 +13,7 @@
|
||||
#define TOR_RENDCLIENT_H
|
||||
|
||||
void rend_client_purge_state(void);
|
||||
+void rend_client_purge_hidden_service(const char *onion_address);
|
||||
|
||||
void rend_client_introcirc_has_opened(origin_circuit_t *circ);
|
||||
void rend_client_rendcirc_has_opened(origin_circuit_t *circ);
|
||||
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
|
||||
index a664b5d..70d7283 100644
|
||||
--- a/src/or/rendcommon.c
|
||||
+++ b/src/or/rendcommon.c
|
||||
@@ -881,6 +881,34 @@ rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **e)
|
||||
return 1;
|
||||
}
|
||||
|
||||
+/** Remove any cached descriptors for <b>service_id/b>. */
|
||||
+void
|
||||
+rend_cache_remove_entry(const char *service_id)
|
||||
+{
|
||||
+ char key[REND_SERVICE_ID_LEN_BASE32+2]; /* <version><service_id>\0 */
|
||||
+ rend_cache_entry_t *removed;
|
||||
+
|
||||
+ tor_assert(rend_valid_service_id(service_id));
|
||||
+ if (!rend_cache)
|
||||
+ return;
|
||||
+
|
||||
+ tor_snprintf(key, sizeof(key), "2%s", service_id);
|
||||
+ removed = (rend_cache_entry_t *)strmap_remove_lc(rend_cache, key);
|
||||
+ if (removed) {
|
||||
+ log_info(LD_REND, "Removed cached v2 descriptor for service %s.",
|
||||
+ safe_str_client(service_id));
|
||||
+ rend_cache_entry_free(removed);
|
||||
+ }
|
||||
+
|
||||
+ tor_snprintf(key, sizeof(key), "0%s", service_id);
|
||||
+ removed = (rend_cache_entry_t *)strmap_remove_lc(rend_cache, key);
|
||||
+ if (removed) {
|
||||
+ log_info(LD_REND, "Removed cached v0 descriptor for service %s.",
|
||||
+ safe_str_client(service_id));
|
||||
+ rend_cache_entry_free(removed);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/** Lookup the v2 service descriptor with base32-encoded <b>desc_id</b> and
|
||||
* copy the pointer to it to *<b>desc</b>. Return 1 on success, 0 on
|
||||
* well-formed-but-not-found, and -1 on failure.
|
||||
diff --git a/src/or/rendcommon.h b/src/or/rendcommon.h
|
||||
index 07a47ac..0a3160d 100644
|
||||
--- a/src/or/rendcommon.h
|
||||
+++ b/src/or/rendcommon.h
|
||||
@@ -39,6 +39,7 @@ void rend_cache_free_all(void);
|
||||
int rend_valid_service_id(const char *query);
|
||||
int rend_cache_lookup_entry(const char *query, int version,
|
||||
rend_cache_entry_t **entry_out);
|
||||
+void rend_cache_remove_entry(const char *service_id);
|
||||
int rend_cache_lookup_v2_desc_as_dir(const char *query, const char **desc);
|
||||
/** Return value from rend_cache_store_v2_desc_as_{dir,client}. */
|
||||
typedef enum {
|
||||
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
|
||||
index a7c1e32..cc9c0f8 100644
|
||||
--- a/src/or/rendservice.c
|
||||
+++ b/src/or/rendservice.c
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "circuituse.h"
|
||||
#include "config.h"
|
||||
#include "directory.h"
|
||||
+#include "main.h"
|
||||
#include "networkstatus.h"
|
||||
#include "nodelist.h"
|
||||
#include "rendclient.h"
|
||||
@@ -3033,6 +3034,9 @@ rend_services_introduce(void)
|
||||
time_t now;
|
||||
const or_options_t *options = get_options();
|
||||
|
||||
+ if (!can_complete_circuit)
|
||||
+ return;
|
||||
+
|
||||
intro_nodes = smartlist_new();
|
||||
now = time(NULL);
|
||||
|
||||
40
patches/weupnp-0.1.3-SNAPSHOT.patch
Normal file
40
patches/weupnp-0.1.3-SNAPSHOT.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
diff -Bbur weupnp-0.1.3-SNAPSHOT/src/main/java/org/bitlet/weupnp/GatewayDiscover.java weupnp-0.1.3-SNAPSHOT-briar/src/main/java/org/bitlet/weupnp/GatewayDiscover.java
|
||||
--- weupnp-0.1.3-SNAPSHOT/src/main/java/org/bitlet/weupnp/GatewayDiscover.java 2013-05-01 21:09:27.000000000 +0100
|
||||
+++ weupnp-0.1.3-SNAPSHOT-briar/src/main/java/org/bitlet/weupnp/GatewayDiscover.java 2013-12-05 20:49:00.000000000 +0000
|
||||
@@ -253,7 +253,7 @@
|
||||
while (st.hasMoreTokens()) {
|
||||
String line = st.nextToken().trim();
|
||||
|
||||
- if (line.isEmpty())
|
||||
+ if (line.equals(""))
|
||||
continue;
|
||||
|
||||
if (line.startsWith("HTTP/1.") || line.startsWith("NOTIFY *"))
|
||||
@@ -331,16 +331,6 @@
|
||||
// For every suitable network interface, get all IP addresses
|
||||
while (networkInterfaces.hasMoreElements()) {
|
||||
NetworkInterface card = networkInterfaces.nextElement();
|
||||
-
|
||||
- try {
|
||||
- // skip devices, not suitable to search gateways for
|
||||
- if (card.isLoopback() || card.isPointToPoint() ||
|
||||
- card.isVirtual() || !card.isUp())
|
||||
- continue;
|
||||
- } catch (SocketException e) {
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
Enumeration<InetAddress> addresses = card.getInetAddresses();
|
||||
|
||||
if (addresses == null)
|
||||
@@ -348,6 +338,10 @@
|
||||
|
||||
while (addresses.hasMoreElements()) {
|
||||
InetAddress inetAddress = addresses.nextElement();
|
||||
+
|
||||
+ if (inetAddress.isLoopbackAddress())
|
||||
+ continue;
|
||||
+
|
||||
int index = arrayIPAddress.size();
|
||||
|
||||
if (!getIPv4 || !getIPv6) {
|
||||
Reference in New Issue
Block a user