From 5cffce41722c49887f7402b9f4a12f02da9b1113 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Sun, 27 Jan 2008 10:04:23 +0000 Subject: [PATCH] Cosmetic changes and vim improvements. git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@204 bc163920-b10d-0410-b2c5-a5491ca2ceef --- README | 2 +- TODO | 2 -- _copyright.inc | 2 +- base64.c | 4 ++-- base64.h | 2 +- basicauth.c | 6 +++--- basicauth.h | 2 +- cmdline.c | 32 +++++++++++++++++--------------- cmdline.h | 16 ++++++++-------- config.h | 2 +- global.h | 2 +- http.c | 2 +- io.c | 2 +- io.h | 2 +- messages.c | 2 +- ntlm.c | 2 +- ntlm.h | 2 +- proxytunnel.c | 6 +++--- proxytunnel.h | 2 +- ptstream.c | 2 +- ptstream.h | 2 +- readpassphrase.c | 2 +- setproctitle.c | 2 +- 23 files changed, 50 insertions(+), 50 deletions(-) diff --git a/README b/README index b050fcf..4ffdc55 100644 --- a/README +++ b/README @@ -23,7 +23,7 @@ option it specifies it's command-line options. $ ./proxytunnel --help Proxytunnel 1.8.0 (rev 165) -Copyright 2001-2007 Proxytunnel Project +Copyright 2001-2008 Proxytunnel Project Jos Visser (Muppet) , Mark Janssen (Maniac) Purpose: diff --git a/TODO b/TODO index a0e5189..2925ade 100644 --- a/TODO +++ b/TODO @@ -16,8 +16,6 @@ ### Code cleanup - Fix permissions in subversion tree (some files are wrongly executable) -- Adopt a style guide for C (different styles are now being used) - - Find some hardcore C experts to help us improve the code quality - Improve the error output, make it consistent throughout the program diff --git a/_copyright.inc b/_copyright.inc index 693d665..4b10b65 100644 --- a/_copyright.inc +++ b/_copyright.inc @@ -1,4 +1,4 @@ -/* Proxytunnel - (C) 2001-2006 Jos Visser / Mark Janssen */ +/* Proxytunnel - (C) 2001-2008 Jos Visser / Mark Janssen */ /* Contact: josv@osp.nl / maniac@maniac.nl */ /* diff --git a/base64.c b/base64.c index 9a67cac..12a5eab 100644 --- a/base64.c +++ b/base64.c @@ -27,7 +27,7 @@ static const char base64digits[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -#define BAD -1 +#define BAD -1 static const char base64val[] = { BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, @@ -131,4 +131,4 @@ int unbase64(unsigned char *out, const unsigned char *in, int maxlen) { return (len); } -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/base64.h b/base64.h index 0173d62..ae63b28 100644 --- a/base64.h +++ b/base64.h @@ -22,4 +22,4 @@ void base64(unsigned char *out, const unsigned char *in, int len); int unbase64(unsigned char *out, const unsigned char *in, int maxlen); -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/basicauth.c b/basicauth.c index 8c2f405..6e037ee 100644 --- a/basicauth.c +++ b/basicauth.c @@ -42,13 +42,13 @@ void make_basicauth() { * Base64 encode the clear text cookie to create the HTTP base64 * authentication cookie */ - base64( (unsigned char *)basicauth, (unsigned char *)p, strlen( p ) ); + base64( (unsigned char *)basicauth, (unsigned char *)p, strlen(p) ); // if( args_info.verbose_flag ) { -// message( "Proxy basic auth is %s\n", basicauth ); +// message( "Proxy basic auth of %s is %s\n", p, basicauth ); // } free( p ); } -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/basicauth.h b/basicauth.h index f1895c5..5ba0239 100644 --- a/basicauth.h +++ b/basicauth.h @@ -23,4 +23,4 @@ char basicauth[80]; /* Buffer to hold the proxies basic authentication data */ /* Functions */ void make_basicauth(); -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/cmdline.c b/cmdline.c index 9860f72..7751ee9 100644 --- a/cmdline.c +++ b/cmdline.c @@ -100,9 +100,11 @@ static char * gengetopt_strdup (char * s) { } int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *args_info ) { - int c; /* Character of the parsed option. */ - int r; /* Tmd retval */ - int missing_required_options = 0; + /* Character of the parsed option. */ + int c; + /* Tmd retval */ + int r; + int missing_required_options = 0; char * tmp_env_var; args_info->help_given = 0; @@ -161,27 +163,27 @@ int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *ar /* Struct option: Name, Has_arg, Flag, Value */ static struct option long_options[] = { - { "help", 0, NULL, 'h' }, + { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, - { "user", 1, NULL, 'u' }, - { "pass", 1, NULL, 's' }, - { "domain", 1, NULL, 't' }, + { "user", 1, NULL, 'u' }, + { "pass", 1, NULL, 's' }, + { "domain", 1, NULL, 't' }, { "uservar", 1, NULL, 'U' }, { "passvar", 1, NULL, 'S' }, { "passfile", 1, NULL, 'F' }, - { "proxy", 1, NULL, 'p' }, - { "dest", 1, NULL, 'd' }, + { "proxy", 1, NULL, 'p' }, + { "dest", 1, NULL, 'd' }, { "remproxy", 1, NULL, 'r' }, { "proctitle", 1, NULL, 'x' }, - { "header", 1, NULL, 'H' }, + { "header", 1, NULL, 'H' }, { "verbose", 0, NULL, 'v' }, - { "ntlm", 0, NULL, 'N' }, - { "inetd", 0, NULL, 'i' }, + { "ntlm", 0, NULL, 'N' }, + { "inetd", 0, NULL, 'i' }, { "standalone", 1, NULL, 'a' }, - { "quiet", 0, NULL, 'q' }, + { "quiet", 0, NULL, 'q' }, { "encrypt", 0, NULL, 'e' }, { "encrypt-proxy", 0, NULL, 'E' }, - { NULL, 0, NULL, 0 } + { NULL, 0, NULL, 0 } }; c = getopt_long (argc, argv, "hVia:u:s:t:U:S:F:p:r:d:H:x:nvNeEq", long_options, &option_index); @@ -470,4 +472,4 @@ static char *getCredentialsFromFile( const char* filename, char **user, char **p return strdup( "Error opening password file" ); } -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/cmdline.h b/cmdline.h index 90a0235..952f9a5 100644 --- a/cmdline.h +++ b/cmdline.h @@ -30,7 +30,7 @@ struct gengetopt_args_info { char *pass_arg; /* Password to send to HTTPS proxy for auth. */ char *domain_arg; /* NTLM Domain override */ char *proxy_arg; /* HTTPS Proxy host to connect to. */ - char *proxyhost_arg; /* HTTPS Proxy host to connect to. */ + char *proxyhost_arg; /* HTTPS Proxy host to connect to. */ int proxyport_arg; /* HTTPS Proxy host portnumber to connect to. */ char *dest_arg; /* Destination host to built the tunnel to. */ char header_arg[MAX_HEADER_SIZE]; /* Extra headers to send to proxy */ @@ -41,16 +41,16 @@ struct gengetopt_args_info { int quiet_flag; /* Turn on quiet mode (default=off). */ int standalone_arg; /* Turn on stdalone (-a) on port */ int encrypt_flag; /* Turn on SSL encryption (default=off). */ - int encryptproxy_flag; /* Turn on client to proxy SSL encryption (def=off).*/ - char *proctitle_arg; /* Override process title (default=off). */ + int encryptproxy_flag; /* Turn on client to proxy SSL encryption (def=off).*/ + char *proctitle_arg; /* Override process title (default=off). */ int help_given; /* Whether help was given. */ int version_given; /* Whether version was given. */ int user_given; /* Whether user was given. */ int pass_given; /* Whether pass was given. */ int domain_given; /* Whether domain was given. */ int proxy_given; /* Whether proxyhost was given. */ - int proxyhost_given; /* Whether proxyhost was given. */ - int proxyport_given; /* Whether proxyport was given. */ + int proxyhost_given; /* Whether proxyhost was given. */ + int proxyport_given; /* Whether proxyport was given. */ int dest_given; /* Whether dest was given. */ int remproxy_given; /* Whether remproxy was given. */ int verbose_given; /* Whether verbose was given. */ @@ -59,8 +59,8 @@ struct gengetopt_args_info { int quiet_given; /* Whether quiet mode was given. */ int header_given; /* Whether extra headers are given */ int encrypt_given; /* Whether encrypt was given */ - int encryptproxy_given; /* Whether encrypt was given */ - int proctitle_given; /* Whether to override process title */ + int encryptproxy_given; /* Whether encrypt was given */ + int proctitle_given; /* Whether to override process title */ }; int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *args_info ); @@ -70,4 +70,4 @@ void cmdline_parser_print_version( void ); #endif /* _cmdline_h */ -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/config.h b/config.h index a22c8e3..e81ad84 100644 --- a/config.h +++ b/config.h @@ -30,4 +30,4 @@ #define _PASSWORD_LEN 80 #endif -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/global.h b/global.h index a8190d6..793f39e 100644 --- a/global.h +++ b/global.h @@ -30,4 +30,4 @@ If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it #define PROTO_LIST(list) () #endif -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/http.c b/http.c index ea36984..a274d46 100644 --- a/http.c +++ b/http.c @@ -204,4 +204,4 @@ void proxy_protocol(PTSTREAM *pts) { } } -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/io.c b/io.c index 35efb9c..acbcde7 100644 --- a/io.c +++ b/io.c @@ -127,4 +127,4 @@ void cpio(PTSTREAM *stream1, PTSTREAM *stream2) { closeall(); } -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/io.h b/io.h index c85dfc7..5e78e62 100644 --- a/io.h +++ b/io.h @@ -21,4 +21,4 @@ int readline(PTSTREAM *pts); void cpio(PTSTREAM *stream1, PTSTREAM *stream2); -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/messages.c b/messages.c index 27f600b..d29381c 100644 --- a/messages.c +++ b/messages.c @@ -51,4 +51,4 @@ void my_perror( char *msg ) { } } -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/ntlm.c b/ntlm.c index 2000903..ab1bdf9 100644 --- a/ntlm.c +++ b/ntlm.c @@ -460,4 +460,4 @@ void build_ntlm2_response() { lm2digest[16 + i] = b->client_challenge[i]; } -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/ntlm.h b/ntlm.h index e259b15..2b0f7ff 100644 --- a/ntlm.h +++ b/ntlm.h @@ -105,4 +105,4 @@ typedef struct { unsigned long data_start; } blob; -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/proxytunnel.c b/proxytunnel.c index 2df0674..6234176 100644 --- a/proxytunnel.c +++ b/proxytunnel.c @@ -66,8 +66,8 @@ void signal_handler( int signal ) { * the socket that is connected to the proxy */ int tunnel_connect() { - struct sockaddr_in sa; - struct hostent *he; + struct sockaddr_in sa; + struct hostent *he; int sd; /* Create the socket */ @@ -407,4 +407,4 @@ int main( int argc, char *argv[] ) { exit( 0 ); } -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/proxytunnel.h b/proxytunnel.h index c7a50fa..2afa1e2 100644 --- a/proxytunnel.h +++ b/proxytunnel.h @@ -64,4 +64,4 @@ char buf[SIZE]; /* Data transfer buffer */ #define MAX( x, y ) ( ( (x)>(y) ) ? (x) : (y) ) #endif -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/ptstream.c b/ptstream.c index 0848aa2..4005e7a 100644 --- a/ptstream.c +++ b/ptstream.c @@ -196,4 +196,4 @@ int stream_get_outgoing_fd(PTSTREAM *pts) { #endif /* USE_SSL */ } -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/ptstream.h b/ptstream.h index fda957a..e7efd43 100644 --- a/ptstream.h +++ b/ptstream.h @@ -48,4 +48,4 @@ int stream_enable_ssl(PTSTREAM *pts); int stream_get_incoming_fd(PTSTREAM *pts); int stream_get_outgoing_fd(PTSTREAM *pts); -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/readpassphrase.c b/readpassphrase.c index 236c613..d6fbeb5 100644 --- a/readpassphrase.c +++ b/readpassphrase.c @@ -201,4 +201,4 @@ static void handler(int s) { } #endif /* HAVE_READPASSPHRASE */ -// vim:noet +// vim:noexpandtab:ts=4 diff --git a/setproctitle.c b/setproctitle.c index 3cbf2d5..32ac246 100644 --- a/setproctitle.c +++ b/setproctitle.c @@ -164,4 +164,4 @@ void setproctitle(const char *fmt, ...) { #endif /* HAVE_SETPROCTITLE */ -// vim:noet +// vim:noexpandtab:ts=4