mirror of
https://github.com/proxytunnel/proxytunnel.git
synced 2026-01-23 02:34:59 +00:00
Cleanup setproctitle, changed return-type of readline()
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@111 bc163920-b10d-0410-b2c5-a5491ca2ceef
This commit is contained in:
parent
84e4e827bf
commit
860e177e53
6 changed files with 16 additions and 10 deletions
4
Makefile
4
Makefile
|
|
@ -3,9 +3,9 @@
|
|||
# Please uncomment the appropriate settings
|
||||
|
||||
CC ?= gcc
|
||||
CFLAGS ?= -Wall -O2
|
||||
CFLAGS ?= -Wall -O2 -g
|
||||
CFLAGS += -DHAVE_GETOPT_LONG -DUSE_SSL
|
||||
#CFLAGS += -DSETPROCTITLE
|
||||
CFLAGS += -DSETPROCTITLE -DSPT_TYPE=1
|
||||
LDFLAGS += -lssl
|
||||
|
||||
PREFIX =/usr/local
|
||||
|
|
|
|||
9
http.c
9
http.c
|
|
@ -45,8 +45,13 @@ void analyze_HTTP()
|
|||
*/
|
||||
while (strncmp( p, "HTTP/", 5) != 0 )
|
||||
{
|
||||
readline();
|
||||
p = strtok( buf, " ");
|
||||
if ( readline() )
|
||||
p = strtok( buf, " ");
|
||||
else
|
||||
{
|
||||
message( "analyze_HTTP: borken\n" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp( p, "HTTP/1.0" ) != 0 && strcmp( p, "HTTP/1.1" ) != 0)
|
||||
|
|
|
|||
3
io.c
3
io.c
|
|
@ -41,7 +41,7 @@
|
|||
* Read one line of data from the tunnel. Line is terminated by a
|
||||
* newline character. Result is stored in buf.
|
||||
*/
|
||||
void readline()
|
||||
int readline()
|
||||
{
|
||||
char *p = buf;
|
||||
char c = 0;
|
||||
|
|
@ -68,6 +68,7 @@ void readline()
|
|||
|
||||
if( args_info.verbose_flag )
|
||||
message( "DEBUG: recv: '%s'", buf );
|
||||
return strlen( buf );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
2
io.h
2
io.h
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
/* io.h */
|
||||
void readline();
|
||||
int readline();
|
||||
int copy(int from, int to);
|
||||
void cpio();
|
||||
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ int main( int argc, char *argv[], char *envp[] )
|
|||
#endif
|
||||
#ifdef SETPROCTITLE
|
||||
if( args_info.proctitle_given )
|
||||
setproctitle( args_info.proctitle_arg );
|
||||
setproctitle( "%s\0", args_info.proctitle_arg );
|
||||
#else
|
||||
if( args_info.proctitle_given )
|
||||
message( "Setting process-title is not supported in this build\n");
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@
|
|||
#define SPT_SCO 6 /* write kernel u. area */
|
||||
#define SPT_CHANGEARGV 7 /* write our own strings into argv[] */
|
||||
|
||||
# define MAXLINE 2048 /* max line length */
|
||||
#define MAXLINE 2048 /* max line length */
|
||||
|
||||
#ifndef SPT_TYPE
|
||||
# define SPT_TYPE SPT_REUSEARGV
|
||||
# define SPT_TYPE SPT_NONE
|
||||
#endif
|
||||
|
||||
#if SPT_TYPE != SPT_NONE && SPT_TYPE != SPT_BUILTIN
|
||||
|
|
@ -121,7 +121,7 @@ typedef unsigned int *pt_entry_t;
|
|||
# endif
|
||||
|
||||
# ifndef SPT_PADCHAR
|
||||
# define SPT_PADCHAR ' '
|
||||
# define SPT_PADCHAR '\0'
|
||||
# endif
|
||||
|
||||
# ifndef SPT_BUFSIZE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue