diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/conns.c | 16 | ||||
-rw-r--r-- | src/conns.h | 17 |
2 files changed, 29 insertions, 4 deletions
diff --git a/src/conns.c b/src/conns.c index 013b681..74590b1 100644 --- a/src/conns.c +++ b/src/conns.c @@ -1,4 +1,4 @@ -/* $Id: conns.c,v 1.13 2002-11-13 17:47:40 rjkaes Exp $ +/* $Id: conns.c,v 1.14 2003-03-13 21:27:29 rjkaes Exp $ * * Create and free the connection structure. One day there could be * other connection related tasks put here, but for now the header @@ -59,6 +59,8 @@ initialize_conn(int client_fd, const char* ipaddr, const char* string_addr) connptr->request_line = NULL; /* These store any error strings */ + connptr->error_variables = NULL; + connptr->error_variable_count = 0; connptr->error_string = NULL; connptr->error_number = -1; @@ -110,6 +112,18 @@ destroy_conn(struct conn_s *connptr) if (connptr->request_line) safefree(connptr->request_line); + if (connptr->error_variables) { + int i; + + for(i = 0; connptr->error_variables[i]; i++) { + safefree(connptr->error_variables[i]->error_key); + safefree(connptr->error_variables[i]->error_val); + safefree(connptr->error_variables[i]); + } + + safefree(connptr->error_variables); + } + if (connptr->error_string) safefree(connptr->error_string); diff --git a/src/conns.h b/src/conns.h index bea6b47..1357dc2 100644 --- a/src/conns.h +++ b/src/conns.h @@ -1,4 +1,4 @@ -/* $Id: conns.h,v 1.11 2002-12-04 17:06:13 rjkaes Exp $ +/* $Id: conns.h,v 1.12 2003-03-13 21:27:29 rjkaes Exp $ * * See 'conns.c' for a detailed description. * @@ -37,9 +37,20 @@ struct conn_s { unsigned int connect_method; unsigned int show_stats; - /* Store the error response if there is one */ - char *error_string; + /* + * Store the error response if there is one. + * This structure stores key -> value mappings for substitution + * in the error HTML files. a NULL pointer indicates the end of + * the array + */ + struct error_variable_s { + char *error_key; + char *error_val; + } **error_variables; + int error_variable_count; + int error_number; + char *error_string; /* A Content-Length value from the remote server */ long remote_content_length; |