Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: ports/tor/nacl.patch

Issue 1289343005: Added Tor (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@pepper_44
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 diff --git a/src/common/compat.c b/src/common/compat.c
2 --- a/src/common/compat.c
3 +++ b/src/common/compat.c
4 @@ -1542,6 +1542,11 @@ set_max_file_descriptors(rlim_t limit, int *max_out)
5 * http://archives.seul.org/or/talk/Aug-2006/msg00210.html
6 * For an iPhone, 9999 should work. For Windows and all other unknown
7 * systems we use 15000 as the default. */
8 +
9 +#ifdef __native_client__
10 +#undef HAVE_GETRLIMIT
11 +#endif
12 +
13 #ifndef HAVE_GETRLIMIT
14 #if defined(CYGWIN) || defined(__CYGWIN__)
15 const char *platform = "Cygwin";
16 @@ -3225,4 +3230,3 @@ tor_sleep_msec(int msec)
17 #endif
18 }
19 #endif
20 -
21 diff --git a/src/common/util.c b/src/common/util.c
22 --- a/src/common/util.c
23 +++ b/src/common/util.c
24 @@ -2191,9 +2191,9 @@ check_private_dir(const char *dirname, cpd_check_t check,
25 "%s (%d). Perhaps you are running Tor as the wrong user?",
26 dirname, process_ownername, (int)running_uid,
27 pw ? pw->pw_name : "<unknown>", (int)st.st_uid);
28 -
29 - tor_free(process_ownername);
30 - return -1;
31 + printf("\n>> nacl sometimes doesn't set UID properly, ignoring...\n");
32 + //tor_free(process_ownername);
binji 2015/08/24 22:28:01 why comment out the tor_free?
deepankar-tyagi 2015/08/25 18:14:44 I was of opinion that a structure might be keeping
33 + //return -1;
34 }
35 if ( (check & (CPD_GROUP_OK|CPD_GROUP_READ))
36 && (st.st_gid != running_gid) ) {
37 @@ -5421,4 +5421,3 @@ tor_weak_random_range(tor_weak_rng_t *rng, int32_t top)
38 } while (result >= top);
39 return result;
40 }
41 -
42 diff --git a/src/ext/csiphash.c b/src/ext/csiphash.c
43 --- a/src/ext/csiphash.c
44 +++ b/src/ext/csiphash.c
45 @@ -56,7 +56,13 @@
46 # if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
47 # include <sys/endian.h>
48 # else
49 -# include <endian.h>
50 +# ifdef _NEWLIB_VERSION // if TOOLCHAIN=newlib
51 + // newlib endian.h doesn't contain le64toh()
52 + // nacl is little endian thus le64toh is a nop
53 +# define le64toh(x) (x)
54 +# else // the usual
55 +# include <endian.h>
56 +# endif
57 # endif
58 # if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \
59 __BYTE_ORDER == __LITTLE_ENDIAN
60 diff --git a/src/or/config.c b/src/or/config.c
61 --- a/src/or/config.c
62 +++ b/src/or/config.c
63 @@ -1375,10 +1375,12 @@ options_act(const or_options_t *old_options)
64 /* Write control ports to disk as appropriate */
65 control_ports_write_to_file();
66
67 - if (running_tor && !have_lockfile()) {
68 +// nacl.io doesn't support file locking (yet)
69 +// #TODO(dt) uncomment following,once file locking is supported
70 +/* if (running_tor && !have_lockfile()) {
binji 2015/08/24 22:28:01 use #ifndef __native_client__ instead of commentin
deepankar-tyagi 2015/08/25 18:14:44 Done.
71 if (try_locking(options, 1) < 0)
72 return -1;
73 - }
74 + }*/
75
76 if (consider_adding_dir_servers(options, old_options) < 0)
77 return -1;
78 @@ -7109,4 +7111,3 @@ init_cookie_authentication(const char *fname, const char * header,
79 tor_free(cookie_file_str);
80 return retval;
81 }
82 -
83 diff --git a/src/or/main.c b/src/or/main.c
84 --- a/src/or/main.c
85 +++ b/src/or/main.c
86 @@ -2402,6 +2402,11 @@ void
87 handle_signals(int is_parent)
88 {
89 #ifndef _WIN32 /* do signal stuff only on Unix */
90 +#ifdef __native_client__
91 +// nacl doesn't support signals(no support in libevent)
92 +(void)is_parent;
93 +return;
94 +#endif
95 int i;
96 static const int signals[] = {
97 SIGINT, /* do a controlled slow shutdown */
98 @@ -3127,4 +3132,3 @@ tor_main(int argc, char *argv[])
99 tor_cleanup();
100 return result;
101 }
102 -
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698