Skip to content

Commit

Permalink
Cosmetic changes and vim improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Jan 27, 2008
1 parent 4ab2eb5 commit 5cffce4
Show file tree
Hide file tree
Showing 23 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -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) <josv@osp.nl>, Mark Janssen (Maniac) <maniac@maniac.nl>

Purpose:
Expand Down
2 changes: 0 additions & 2 deletions TODO
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion _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 */

/*
Expand Down
4 changes: 2 additions & 2 deletions base64.c
Expand Up @@ -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,
Expand Down Expand Up @@ -131,4 +131,4 @@ int unbase64(unsigned char *out, const unsigned char *in, int maxlen) {
return (len);
}

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion base64.h
Expand Up @@ -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
6 changes: 3 additions & 3 deletions basicauth.c
Expand Up @@ -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
2 changes: 1 addition & 1 deletion basicauth.h
Expand Up @@ -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
32 changes: 17 additions & 15 deletions cmdline.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
16 changes: 8 additions & 8 deletions cmdline.h
Expand Up @@ -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 */
Expand All @@ -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. */
Expand All @@ -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 );
Expand All @@ -70,4 +70,4 @@ void cmdline_parser_print_version( void );

#endif /* _cmdline_h */

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion config.h
Expand Up @@ -30,4 +30,4 @@
#define _PASSWORD_LEN 80
#endif

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion global.h
Expand Up @@ -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
2 changes: 1 addition & 1 deletion http.c
Expand Up @@ -204,4 +204,4 @@ void proxy_protocol(PTSTREAM *pts) {
}
}

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion io.c
Expand Up @@ -127,4 +127,4 @@ void cpio(PTSTREAM *stream1, PTSTREAM *stream2) {
closeall();
}

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion io.h
Expand Up @@ -21,4 +21,4 @@
int readline(PTSTREAM *pts);
void cpio(PTSTREAM *stream1, PTSTREAM *stream2);

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion messages.c
Expand Up @@ -51,4 +51,4 @@ void my_perror( char *msg ) {
}
}

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion ntlm.c
Expand Up @@ -460,4 +460,4 @@ void build_ntlm2_response() {
lm2digest[16 + i] = b->client_challenge[i];
}

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion ntlm.h
Expand Up @@ -105,4 +105,4 @@ typedef struct {
unsigned long data_start;
} blob;

// vim:noet
// vim:noexpandtab:ts=4
6 changes: 3 additions & 3 deletions proxytunnel.c
Expand Up @@ -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 */
Expand Down Expand Up @@ -407,4 +407,4 @@ int main( int argc, char *argv[] ) {
exit( 0 );
}

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion proxytunnel.h
Expand Up @@ -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
2 changes: 1 addition & 1 deletion ptstream.c
Expand Up @@ -196,4 +196,4 @@ int stream_get_outgoing_fd(PTSTREAM *pts) {
#endif /* USE_SSL */
}

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion ptstream.h
Expand Up @@ -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
2 changes: 1 addition & 1 deletion readpassphrase.c
Expand Up @@ -201,4 +201,4 @@ static void handler(int s) {
}
#endif /* HAVE_READPASSPHRASE */

// vim:noet
// vim:noexpandtab:ts=4
2 changes: 1 addition & 1 deletion setproctitle.c
Expand Up @@ -164,4 +164,4 @@ void setproctitle(const char *fmt, ...) {

#endif /* HAVE_SETPROCTITLE */

// vim:noet
// vim:noexpandtab:ts=4

0 comments on commit 5cffce4

Please sign in to comment.