Skip to content

Commit 0dbdcb2

Browse files
committed
Cosmetic changes and vim improvements.
1 parent 73541b9 commit 0dbdcb2

23 files changed

+50
-50
lines changed

README

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ option it specifies it's command-line options.
2323

2424
$ ./proxytunnel --help
2525
Proxytunnel 1.8.0 (rev 165)
26-
Copyright 2001-2007 Proxytunnel Project
26+
Copyright 2001-2008 Proxytunnel Project
2727
Jos Visser (Muppet) <[email protected]>, Mark Janssen (Maniac) <[email protected]>
2828

2929
Purpose:

TODO

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
### Code cleanup
1717
- Fix permissions in subversion tree (some files are wrongly executable)
1818

19-
- Adopt a style guide for C (different styles are now being used)
20-
2119
- Find some hardcore C experts to help us improve the code quality
2220

2321
- Improve the error output, make it consistent throughout the program

_copyright.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Proxytunnel - (C) 2001-2006 Jos Visser / Mark Janssen */
1+
/* Proxytunnel - (C) 2001-2008 Jos Visser / Mark Janssen */
22
33

44
/*

base64.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
static const char base64digits[] =
2828
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
2929

30-
#define BAD -1
30+
#define BAD -1
3131
static const char base64val[] = {
3232
BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD, BAD,BAD,BAD,BAD,
3333
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) {
131131
return (len);
132132
}
133133

134-
// vim:noet
134+
// vim:noexpandtab:ts=4

base64.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
void base64(unsigned char *out, const unsigned char *in, int len);
2323
int unbase64(unsigned char *out, const unsigned char *in, int maxlen);
2424

25-
// vim:noet
25+
// vim:noexpandtab:ts=4

basicauth.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ void make_basicauth() {
4242
* Base64 encode the clear text cookie to create the HTTP base64
4343
* authentication cookie
4444
*/
45-
base64( (unsigned char *)basicauth, (unsigned char *)p, strlen( p ) );
45+
base64( (unsigned char *)basicauth, (unsigned char *)p, strlen(p) );
4646

4747
// if( args_info.verbose_flag ) {
48-
// message( "Proxy basic auth is %s\n", basicauth );
48+
// message( "Proxy basic auth of %s is %s\n", p, basicauth );
4949
// }
5050

5151
free( p );
5252
}
5353

54-
// vim:noet
54+
// vim:noexpandtab:ts=4

basicauth.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ char basicauth[80]; /* Buffer to hold the proxies basic authentication data */
2323
/* Functions */
2424
void make_basicauth();
2525

26-
// vim:noet
26+
// vim:noexpandtab:ts=4

cmdline.c

+17-15
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,11 @@ static char * gengetopt_strdup (char * s) {
100100
}
101101

102102
int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *args_info ) {
103-
int c; /* Character of the parsed option. */
104-
int r; /* Tmd retval */
105-
int missing_required_options = 0;
103+
/* Character of the parsed option. */
104+
int c;
105+
/* Tmd retval */
106+
int r;
107+
int missing_required_options = 0;
106108
char * tmp_env_var;
107109

108110
args_info->help_given = 0;
@@ -161,27 +163,27 @@ int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *ar
161163

162164
/* Struct option: Name, Has_arg, Flag, Value */
163165
static struct option long_options[] = {
164-
{ "help", 0, NULL, 'h' },
166+
{ "help", 0, NULL, 'h' },
165167
{ "version", 0, NULL, 'V' },
166-
{ "user", 1, NULL, 'u' },
167-
{ "pass", 1, NULL, 's' },
168-
{ "domain", 1, NULL, 't' },
168+
{ "user", 1, NULL, 'u' },
169+
{ "pass", 1, NULL, 's' },
170+
{ "domain", 1, NULL, 't' },
169171
{ "uservar", 1, NULL, 'U' },
170172
{ "passvar", 1, NULL, 'S' },
171173
{ "passfile", 1, NULL, 'F' },
172-
{ "proxy", 1, NULL, 'p' },
173-
{ "dest", 1, NULL, 'd' },
174+
{ "proxy", 1, NULL, 'p' },
175+
{ "dest", 1, NULL, 'd' },
174176
{ "remproxy", 1, NULL, 'r' },
175177
{ "proctitle", 1, NULL, 'x' },
176-
{ "header", 1, NULL, 'H' },
178+
{ "header", 1, NULL, 'H' },
177179
{ "verbose", 0, NULL, 'v' },
178-
{ "ntlm", 0, NULL, 'N' },
179-
{ "inetd", 0, NULL, 'i' },
180+
{ "ntlm", 0, NULL, 'N' },
181+
{ "inetd", 0, NULL, 'i' },
180182
{ "standalone", 1, NULL, 'a' },
181-
{ "quiet", 0, NULL, 'q' },
183+
{ "quiet", 0, NULL, 'q' },
182184
{ "encrypt", 0, NULL, 'e' },
183185
{ "encrypt-proxy", 0, NULL, 'E' },
184-
{ NULL, 0, NULL, 0 }
186+
{ NULL, 0, NULL, 0 }
185187
};
186188

187189
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
470472
return strdup( "Error opening password file" );
471473
}
472474

473-
// vim:noet
475+
// vim:noexpandtab:ts=4

cmdline.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct gengetopt_args_info {
3030
char *pass_arg; /* Password to send to HTTPS proxy for auth. */
3131
char *domain_arg; /* NTLM Domain override */
3232
char *proxy_arg; /* HTTPS Proxy host to connect to. */
33-
char *proxyhost_arg; /* HTTPS Proxy host to connect to. */
33+
char *proxyhost_arg; /* HTTPS Proxy host to connect to. */
3434
int proxyport_arg; /* HTTPS Proxy host portnumber to connect to. */
3535
char *dest_arg; /* Destination host to built the tunnel to. */
3636
char header_arg[MAX_HEADER_SIZE]; /* Extra headers to send to proxy */
@@ -41,16 +41,16 @@ struct gengetopt_args_info {
4141
int quiet_flag; /* Turn on quiet mode (default=off). */
4242
int standalone_arg; /* Turn on stdalone (-a) on port */
4343
int encrypt_flag; /* Turn on SSL encryption (default=off). */
44-
int encryptproxy_flag; /* Turn on client to proxy SSL encryption (def=off).*/
45-
char *proctitle_arg; /* Override process title (default=off). */
44+
int encryptproxy_flag; /* Turn on client to proxy SSL encryption (def=off).*/
45+
char *proctitle_arg; /* Override process title (default=off). */
4646
int help_given; /* Whether help was given. */
4747
int version_given; /* Whether version was given. */
4848
int user_given; /* Whether user was given. */
4949
int pass_given; /* Whether pass was given. */
5050
int domain_given; /* Whether domain was given. */
5151
int proxy_given; /* Whether proxyhost was given. */
52-
int proxyhost_given; /* Whether proxyhost was given. */
53-
int proxyport_given; /* Whether proxyport was given. */
52+
int proxyhost_given; /* Whether proxyhost was given. */
53+
int proxyport_given; /* Whether proxyport was given. */
5454
int dest_given; /* Whether dest was given. */
5555
int remproxy_given; /* Whether remproxy was given. */
5656
int verbose_given; /* Whether verbose was given. */
@@ -59,8 +59,8 @@ struct gengetopt_args_info {
5959
int quiet_given; /* Whether quiet mode was given. */
6060
int header_given; /* Whether extra headers are given */
6161
int encrypt_given; /* Whether encrypt was given */
62-
int encryptproxy_given; /* Whether encrypt was given */
63-
int proctitle_given; /* Whether to override process title */
62+
int encryptproxy_given; /* Whether encrypt was given */
63+
int proctitle_given; /* Whether to override process title */
6464
};
6565

6666
int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *args_info );
@@ -70,4 +70,4 @@ void cmdline_parser_print_version( void );
7070

7171
#endif /* _cmdline_h */
7272

73-
// vim:noet
73+
// vim:noexpandtab:ts=4

config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
#define _PASSWORD_LEN 80
3131
#endif
3232

33-
// vim:noet
33+
// vim:noexpandtab:ts=4

global.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
3030
#define PROTO_LIST(list) ()
3131
#endif
3232

33-
// vim:noet
33+
// vim:noexpandtab:ts=4

http.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,4 @@ void proxy_protocol(PTSTREAM *pts) {
204204
}
205205
}
206206

207-
// vim:noet
207+
// vim:noexpandtab:ts=4

io.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,4 @@ void cpio(PTSTREAM *stream1, PTSTREAM *stream2) {
127127
closeall();
128128
}
129129

130-
// vim:noet
130+
// vim:noexpandtab:ts=4

io.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
int readline(PTSTREAM *pts);
2222
void cpio(PTSTREAM *stream1, PTSTREAM *stream2);
2323

24-
// vim:noet
24+
// vim:noexpandtab:ts=4

messages.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ void my_perror( char *msg ) {
5151
}
5252
}
5353

54-
// vim:noet
54+
// vim:noexpandtab:ts=4

ntlm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -460,4 +460,4 @@ void build_ntlm2_response() {
460460
lm2digest[16 + i] = b->client_challenge[i];
461461
}
462462

463-
// vim:noet
463+
// vim:noexpandtab:ts=4

ntlm.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ typedef struct {
105105
unsigned long data_start;
106106
} blob;
107107

108-
// vim:noet
108+
// vim:noexpandtab:ts=4

proxytunnel.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ void signal_handler( int signal ) {
6666
* the socket that is connected to the proxy
6767
*/
6868
int tunnel_connect() {
69-
struct sockaddr_in sa;
70-
struct hostent *he;
69+
struct sockaddr_in sa;
70+
struct hostent *he;
7171
int sd;
7272

7373
/* Create the socket */
@@ -407,4 +407,4 @@ int main( int argc, char *argv[] ) {
407407
exit( 0 );
408408
}
409409

410-
// vim:noet
410+
// vim:noexpandtab:ts=4

proxytunnel.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ char buf[SIZE]; /* Data transfer buffer */
6464
#define MAX( x, y ) ( ( (x)>(y) ) ? (x) : (y) )
6565
#endif
6666

67-
// vim:noet
67+
// vim:noexpandtab:ts=4

ptstream.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,4 @@ int stream_get_outgoing_fd(PTSTREAM *pts) {
196196
#endif /* USE_SSL */
197197
}
198198

199-
// vim:noet
199+
// vim:noexpandtab:ts=4

ptstream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ int stream_enable_ssl(PTSTREAM *pts);
4848
int stream_get_incoming_fd(PTSTREAM *pts);
4949
int stream_get_outgoing_fd(PTSTREAM *pts);
5050

51-
// vim:noet
51+
// vim:noexpandtab:ts=4

readpassphrase.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,4 @@ static void handler(int s) {
201201
}
202202
#endif /* HAVE_READPASSPHRASE */
203203

204-
// vim:noet
204+
// vim:noexpandtab:ts=4

setproctitle.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,4 @@ void setproctitle(const char *fmt, ...) {
164164

165165
#endif /* HAVE_SETPROCTITLE */
166166

167-
// vim:noet
167+
// vim:noexpandtab:ts=4

0 commit comments

Comments
 (0)