[tor-commits] [tor/master] Add guards to ext_orport.h, rename get_file to get_file_name
nickm at torproject.org
nickm at torproject.org
Thu Aug 15 16:16:46 UTC 2013
commit e4a241af11dce61d8722b74ad41d6ea0bec44ef1
Author: Nick Mathewson <nickm at torproject.org>
Date: Tue Jul 16 13:42:25 2013 -0400
Add guards to ext_orport.h, rename get_file to get_file_name
---
src/or/ext_orport.c | 4 ++--
src/or/ext_orport.h | 13 ++++++++++++-
src/or/transports.c | 2 +-
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/or/ext_orport.c b/src/or/ext_orport.c
index 8fd9b77..cd8ab2d 100644
--- a/src/or/ext_orport.c
+++ b/src/or/ext_orport.c
@@ -113,7 +113,7 @@ static char ext_or_auth_cookie[EXT_OR_PORT_AUTH_COOKIE_LEN] = {0};
/** Helper: Return a newly allocated string containing a path to the
* file where we store our authentication cookie. */
char *
-get_ext_or_auth_cookie_file(void)
+get_ext_or_auth_cookie_file_name(void)
{
const or_options_t *options = get_options();
if (options->ExtORPortCookieAuthFile &&
@@ -153,7 +153,7 @@ init_ext_or_cookie_authentication(int is_enabled)
memcpy(cookie_file_string+EXT_OR_PORT_AUTH_COOKIE_HEADER_LEN,
ext_or_auth_cookie, EXT_OR_PORT_AUTH_COOKIE_LEN);
- fname = get_ext_or_auth_cookie_file();
+ fname = get_ext_or_auth_cookie_file_name();
if (write_bytes_to_file(fname, cookie_file_string,
EXT_OR_PORT_AUTH_COOKIE_FILE_LEN, 1)) {
log_warn(LD_FS,"Error writing authentication cookie to %s.",
diff --git a/src/or/ext_orport.h b/src/or/ext_orport.h
index a7038b9..89c3032 100644
--- a/src/or/ext_orport.h
+++ b/src/or/ext_orport.h
@@ -1,3 +1,12 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2013, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#ifndef EXT_ORPORT_H
+#define EXT_ORPORT_H
+
int connection_ext_or_start_auth(or_connection_t *or_conn);
ext_or_cmd_t *ext_or_cmd_new(uint16_t len);
@@ -10,5 +19,7 @@ int connection_ext_or_finished_flushing(or_connection_t *conn);
int connection_ext_or_process_inbuf(or_connection_t *or_conn);
int init_ext_or_cookie_authentication(int is_enabled);
-char *get_ext_or_auth_cookie_file(void);
+char *get_ext_or_auth_cookie_file_name(void);
+
+#endif
diff --git a/src/or/transports.c b/src/or/transports.c
index 196e18b..01a490f 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -1265,7 +1265,7 @@ create_managed_proxy_environment(const managed_proxy_t *mp)
if (options->ExtORPort_lines) {
char *ext_or_addrport_tmp =
get_first_listener_addrport_string(CONN_TYPE_EXT_OR_LISTENER);
- char *cookie_file_loc = get_ext_or_auth_cookie_file();
+ char *cookie_file_loc = get_ext_or_auth_cookie_file_name();
smartlist_add_asprintf(envs, "TOR_PT_EXTENDED_SERVER_PORT=%s",
ext_or_addrport_tmp);
More information about the tor-commits
mailing list