Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c26769de3 |
No files matched your search
@@ -1,22 +1,3 @@
|
|||||||
2001-08-27 Robert James Kaes <rjkaes@flarenet.com>
|
|
||||||
|
|
||||||
* src/log.c (log_message): Fixed a problem where the connect
|
|
||||||
messages were not getting through if the log level was set to
|
|
||||||
INFO.
|
|
||||||
|
|
||||||
* src/tinyproxy.h: Moved some of the includes around so that
|
|
||||||
tinyproxy can compile correctly on FreeBSD systems.
|
|
||||||
|
|
||||||
* src/thread.c: Added the pthread_attr_t structure since we're
|
|
||||||
going to be using a non-default sized stack because some OS's have
|
|
||||||
a stack size which is too small.
|
|
||||||
|
|
||||||
* configure.in: Added a test for detecting FreeBSD's -pthread
|
|
||||||
mechanism for telling GCC to use POSIX threading.
|
|
||||||
|
|
||||||
* src/utils.c (httperr): Fixed the MIME type. Should be be
|
|
||||||
text/html, not text/mime. Fix one bug, add two new ones. Sigh.
|
|
||||||
|
|
||||||
2001-08-26 Robert James Kaes <rjkaes@flarenet.com>
|
2001-08-26 Robert James Kaes <rjkaes@flarenet.com>
|
||||||
|
|
||||||
* src/utils.c (httperr): Split the headers from the actual message
|
* src/utils.c (httperr): Split the headers from the actual message
|
||||||
|
|||||||
@@ -23,12 +23,3 @@ connections, so I will be including it in the next release.
|
|||||||
|
|
||||||
So, the above bugs are fixed, hopefully there are no other ones. The
|
So, the above bugs are fixed, hopefully there are no other ones. The
|
||||||
new features will be worked into the next few releases.
|
new features will be worked into the next few releases.
|
||||||
|
|
||||||
Update
|
|
||||||
------
|
|
||||||
2001-08-27 - Fix one bug and two more crop up. The MIME type was
|
|
||||||
incorrect in the httperr() function; this has been fixed.
|
|
||||||
Jeffrey D. Wheelhouse included a patch to increase the stack size on
|
|
||||||
some machine (notably FreeBSD) and also included a patch to allow
|
|
||||||
tinyproxy to compile on FreeBSD. I really hope that _this_ is that
|
|
||||||
last minor-minor version for a while.
|
|
||||||
+2
-7
@@ -1,4 +1,4 @@
|
|||||||
dnl $Id: configure.in,v 1.19 2001-08-27 17:47:25 rjkaes Exp $
|
dnl $Id: configure.in,v 1.18 2001-08-27 03:47:47 rjkaes Exp $
|
||||||
|
|
||||||
dnl Devlopers, please strive to achieve this order:
|
dnl Devlopers, please strive to achieve this order:
|
||||||
dnl
|
dnl
|
||||||
@@ -19,7 +19,7 @@ AC_INIT()
|
|||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
AC_DEFINE_UNQUOTED(TARGET_SYSTEM, "$target")
|
AC_DEFINE_UNQUOTED(TARGET_SYSTEM, "$target")
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE(tinyproxy,1.4.1.4)
|
AM_INIT_AUTOMAKE(tinyproxy,1.4.1.3)
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
@@ -105,15 +105,10 @@ else
|
|||||||
AC_CHECK_LIB(pthreads, pthread_create)
|
AC_CHECK_LIB(pthreads, pthread_create)
|
||||||
if test "$ac_cv_lib_pthreads_pthread_create" = "yes"; then
|
if test "$ac_cv_lib_pthreads_pthread_create" = "yes"; then
|
||||||
CFLAGS="-D_REENTRANT $CFLAGS"
|
CFLAGS="-D_REENTRANT $CFLAGS"
|
||||||
else
|
|
||||||
AC_CHECK_LIB(c_r, pthread_create)
|
|
||||||
if test "$ac_cv_c_r_pthread_create" = "yes"; then
|
|
||||||
CFLAGS="-pthread -D_REENTRANT $CFLAGS"
|
|
||||||
else
|
else
|
||||||
AC_MSG_ERROR(You must have a POSIX compliant threading library installed)
|
AC_MSG_ERROR(You must have a POSIX compliant threading library installed)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
AC_CHECK_LIB(socket, socket, , AC_CHECK_LIB(socket, htonl))
|
AC_CHECK_LIB(socket, socket, , AC_CHECK_LIB(socket, htonl))
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: log.c,v 1.11 2001-08-27 17:44:55 rjkaes Exp $
|
/* $Id: log.c,v 1.10 2001-08-26 23:37:26 rjkaes Exp $
|
||||||
*
|
*
|
||||||
* Logs the various messages which tinyproxy produces to either a log file or
|
* Logs the various messages which tinyproxy produces to either a log file or
|
||||||
* the syslog daemon. Not much to it...
|
* the syslog daemon. Not much to it...
|
||||||
@@ -78,7 +78,8 @@ void log_message(short int level, char *fmt, ...)
|
|||||||
*/
|
*/
|
||||||
if (level == LOG_INFO && log_level == LOG_CONN)
|
if (level == LOG_INFO && log_level == LOG_CONN)
|
||||||
return;
|
return;
|
||||||
else if (level > log_level && level != LOG_CONN && log_level != LOG_INFO)
|
|
||||||
|
if (level > log_level)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef HAVE_SYSLOG_H
|
#ifdef HAVE_SYSLOG_H
|
||||||
|
|||||||
+3
-13
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: thread.c,v 1.7 2001-08-27 17:45:50 rjkaes Exp $
|
/* $Id: thread.c,v 1.6 2001-08-26 21:14:30 rjkaes Exp $
|
||||||
*
|
*
|
||||||
* Handles the creation/destruction of the various threads required for
|
* Handles the creation/destruction of the various threads required for
|
||||||
* processing incoming connections.
|
* processing incoming connections.
|
||||||
@@ -42,9 +42,6 @@ struct thread_s {
|
|||||||
static struct thread_s *thread_ptr;
|
static struct thread_s *thread_ptr;
|
||||||
static pthread_mutex_t mlock = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t mlock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
/* Used to override the default statck size. */
|
|
||||||
static pthread_attr_t thread_attr;
|
|
||||||
|
|
||||||
static struct thread_config_s {
|
static struct thread_config_s {
|
||||||
unsigned int maxclients, maxrequestsperchild;
|
unsigned int maxclients, maxrequestsperchild;
|
||||||
unsigned int maxspareservers, minspareservers, startservers;
|
unsigned int maxspareservers, minspareservers, startservers;
|
||||||
@@ -149,13 +146,6 @@ int thread_pool_create(void)
|
|||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
/*
|
|
||||||
* Initialize thread_attr to contain a non-default stack size
|
|
||||||
* because the default on some OS's is too small.
|
|
||||||
*/
|
|
||||||
pthread_attr_init(&thread_attr);
|
|
||||||
pthread_attr_setstacksize(&thread_attr, (1024 * 1024));
|
|
||||||
|
|
||||||
if (thread_config.maxclients == 0) {
|
if (thread_config.maxclients == 0) {
|
||||||
log_message(LOG_ERR, "You must set MaxClients to a value greater than 0");
|
log_message(LOG_ERR, "You must set MaxClients to a value greater than 0");
|
||||||
return -1;
|
return -1;
|
||||||
@@ -177,7 +167,7 @@ int thread_pool_create(void)
|
|||||||
for (i = 0; i < thread_config.startservers; i++) {
|
for (i = 0; i < thread_config.startservers; i++) {
|
||||||
thread_ptr[i].status = T_WAITING;
|
thread_ptr[i].status = T_WAITING;
|
||||||
servers_waiting++;
|
servers_waiting++;
|
||||||
pthread_create(&thread_ptr[i].tid, &thread_attr, &thread_main, &thread_ptr[i]);
|
pthread_create(&thread_ptr[i].tid, NULL, &thread_main, &thread_ptr[i]);
|
||||||
}
|
}
|
||||||
for (i = thread_config.startservers; i < thread_config.maxclients; i++) {
|
for (i = thread_config.startservers; i < thread_config.maxclients; i++) {
|
||||||
thread_ptr[i].status = T_EMPTY;
|
thread_ptr[i].status = T_EMPTY;
|
||||||
@@ -199,7 +189,7 @@ int thread_main_loop(void)
|
|||||||
if (servers_waiting < thread_config.minspareservers) {
|
if (servers_waiting < thread_config.minspareservers) {
|
||||||
for (i = 0; i < thread_config.maxclients; i++) {
|
for (i = 0; i < thread_config.maxclients; i++) {
|
||||||
if (thread_ptr[i].status == T_EMPTY) {
|
if (thread_ptr[i].status == T_EMPTY) {
|
||||||
pthread_create(&thread_ptr[i].tid, &thread_attr, &thread_main, &thread_ptr[i]);
|
pthread_create(&thread_ptr[i].tid, NULL, &thread_main, &thread_ptr[i]);
|
||||||
thread_ptr[i].status = T_WAITING;
|
thread_ptr[i].status = T_WAITING;
|
||||||
thread_ptr[i].connects = 0;
|
thread_ptr[i].connects = 0;
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: tinyproxy.h,v 1.12 2001-08-27 17:46:20 rjkaes Exp $
|
/* $Id: tinyproxy.h,v 1.11 2001-08-26 21:18:04 rjkaes Exp $
|
||||||
*
|
*
|
||||||
* See 'tinyproxy.c' for a detailed description.
|
* See 'tinyproxy.c' for a detailed description.
|
||||||
*
|
*
|
||||||
@@ -26,7 +26,6 @@
|
|||||||
/*
|
/*
|
||||||
* Include standard headers which are used through-out tinyproxy
|
* Include standard headers which are used through-out tinyproxy
|
||||||
*/
|
*/
|
||||||
#include <sys/types.h>
|
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
#ifdef HAVE_SYS_SELECT_H
|
||||||
# include <sys/select.h>
|
# include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -42,9 +41,10 @@
|
|||||||
# include <time.h>
|
# include <time.h>
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#include <sys/types.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: utils.c,v 1.6 2001-08-27 17:46:50 rjkaes Exp $
|
/* $Id: utils.c,v 1.5 2001-08-27 03:45:34 rjkaes Exp $
|
||||||
*
|
*
|
||||||
* Misc. routines which are used by the various functions to handle strings
|
* Misc. routines which are used by the various functions to handle strings
|
||||||
* and memory allocation and pretty much anything else we can think of. Also,
|
* and memory allocation and pretty much anything else we can think of. Also,
|
||||||
@@ -68,7 +68,7 @@ int httperr(struct conn_s *connptr, int err, const char *msg)
|
|||||||
"HTTP/1.0 %d %s\r\n" \
|
"HTTP/1.0 %d %s\r\n" \
|
||||||
"Server: %s/%s\r\n" \
|
"Server: %s/%s\r\n" \
|
||||||
"Date: %s\r\n" \
|
"Date: %s\r\n" \
|
||||||
"Content-Type: text/html\r\n" \
|
"Content-Type: text/mime\r\n" \
|
||||||
"Content-Length: %d\r\n" \
|
"Content-Length: %d\r\n" \
|
||||||
"Connection: close\r\n" \
|
"Connection: close\r\n" \
|
||||||
"\r\n";
|
"\r\n";
|
||||||
|
|||||||
Reference in new issue
Block a user