mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
Whitespace and osx fixes on libevent2 patch.
This commit is contained in:
parent
1e709c79d1
commit
74bf885b2d
@ -36,6 +36,15 @@
|
|||||||
*/
|
*/
|
||||||
typedef uint32_t le_version_t;
|
typedef uint32_t le_version_t;
|
||||||
|
|
||||||
|
/* Macros: returns the number of a libevent version. */
|
||||||
|
#define V(major, minor, patch) \
|
||||||
|
(((major) << 24) | ((minor) << 16) | ((patch) << 8))
|
||||||
|
#define V_OLD(major, minor, patch) \
|
||||||
|
V((major), (minor), (patch)-'a'+1)
|
||||||
|
|
||||||
|
#define LE_OLD V(0,0,0)
|
||||||
|
#define LE_OTHER V(0,0,99)
|
||||||
|
|
||||||
static le_version_t tor_get_libevent_version(const char **v_out);
|
static le_version_t tor_get_libevent_version(const char **v_out);
|
||||||
|
|
||||||
#ifdef HAVE_EVENT_SET_LOG_CALLBACK
|
#ifdef HAVE_EVENT_SET_LOG_CALLBACK
|
||||||
@ -187,7 +196,6 @@ tor_libevent_get_base(void)
|
|||||||
return the_event_base;
|
return the_event_base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef HAVE_EVENT_BASE_LOOPEXIT
|
#ifndef HAVE_EVENT_BASE_LOOPEXIT
|
||||||
/* Replacement for event_base_loopexit on some very old versions of Libevent
|
/* Replacement for event_base_loopexit on some very old versions of Libevent
|
||||||
that we are not yet brave enough to deprecate. */
|
that we are not yet brave enough to deprecate. */
|
||||||
@ -212,15 +220,6 @@ tor_libevent_get_method(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Macros: returns the number of a libevent version. */
|
|
||||||
#define V(major, minor, patch) \
|
|
||||||
(((major) << 24) | ((minor) << 16) | ((patch) << 8))
|
|
||||||
#define V_OLD(major, minor, patch) \
|
|
||||||
V((major), (minor), (patch)-'a'+1)
|
|
||||||
|
|
||||||
#define LE_OLD V(0,0,0)
|
|
||||||
#define LE_OTHER V(0,0,99)
|
|
||||||
|
|
||||||
/** Return the le_version_t for the current version of libevent. If the
|
/** Return the le_version_t for the current version of libevent. If the
|
||||||
* version is very new, return LE_OTHER. If the version is so old that it
|
* version is very new, return LE_OTHER. If the version is so old that it
|
||||||
* doesn't support event_get_version(), return LE_OLD. DOCDOC */
|
* doesn't support event_get_version(), return LE_OLD. DOCDOC */
|
||||||
@ -354,12 +353,12 @@ tor_check_libevent_version(const char *m, int server,
|
|||||||
/* Libevent versions before 1.3b do very badly on operating systems with
|
/* Libevent versions before 1.3b do very badly on operating systems with
|
||||||
* user-space threading implementations. */
|
* user-space threading implementations. */
|
||||||
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||||
if (server && version < V_OLD(1,3,'b'))
|
if (server && version < V_OLD(1,3,'b')) {
|
||||||
thread_unsafe = 1;
|
thread_unsafe = 1;
|
||||||
sad_os = "BSD variants";
|
sad_os = "BSD variants";
|
||||||
}
|
}
|
||||||
#elif defined(__APPLE__) || defined(__darwin__)
|
#elif defined(__APPLE__) || defined(__darwin__)
|
||||||
if (server && version < V_OLD(1,3,'b'))
|
if (server && version < V_OLD(1,3,'b')) {
|
||||||
thread_unsafe = 1;
|
thread_unsafe = 1;
|
||||||
sad_os = "Mac OS X";
|
sad_os = "Mac OS X";
|
||||||
}
|
}
|
||||||
@ -467,3 +466,4 @@ tor_check_libevent_header_compatibility(void)
|
|||||||
/* Your libevent is ancient. */
|
/* Your libevent is ancient. */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,3 +51,4 @@ void tor_check_libevent_header_compatibility(void);
|
|||||||
const char *tor_libevent_get_version_str(void);
|
const char *tor_libevent_get_version_str(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ connection_edge_finished_connecting(edge_connection_t *edge_conn)
|
|||||||
safe_str(fmt_addr(&conn->addr)));
|
safe_str(fmt_addr(&conn->addr)));
|
||||||
|
|
||||||
conn->state = EXIT_CONN_STATE_OPEN;
|
conn->state = EXIT_CONN_STATE_OPEN;
|
||||||
connection_watch_events(conn, READ_EVENT);/* stop writing, continue reading */
|
connection_watch_events(conn, READ_EVENT); /* stop writing, keep reading */
|
||||||
if (connection_wants_to_flush(conn)) /* in case there are any queued relay
|
if (connection_wants_to_flush(conn)) /* in case there are any queued relay
|
||||||
* cells */
|
* cells */
|
||||||
connection_start_writing(conn);
|
connection_start_writing(conn);
|
||||||
|
Loading…
Reference in New Issue
Block a user