Fix mixed indentation.
This file uses a mix of tab styles, which gcc6 will warn about because it sees "misleading indentation". Fix the function where this happens. Fixes #12759.
This commit is contained in:
@@ -201,17 +201,17 @@ static long long atoll( const char* str );
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
check_options( void )
|
check_options( void )
|
||||||
{
|
{
|
||||||
#if defined(TILDE_MAP_1) && defined(TILDE_MAP_2)
|
#if defined(TILDE_MAP_1) && defined(TILDE_MAP_2)
|
||||||
// syslog( LOG_CRIT, "both TILDE_MAP_1 and TILDE_MAP_2 are defined" );
|
// syslog( LOG_CRIT, "both TILDE_MAP_1 and TILDE_MAP_2 are defined" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
#endif /* both */
|
#endif /* both */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_httpd_server( httpd_server* hs )
|
free_httpd_server( httpd_server* hs )
|
||||||
{
|
{
|
||||||
if ( hs->binding_hostname != (char*) 0 )
|
if ( hs->binding_hostname != (char*) 0 )
|
||||||
free( (void*) hs->binding_hostname );
|
free( (void*) hs->binding_hostname );
|
||||||
if ( hs->cwd != (char*) 0 )
|
if ( hs->cwd != (char*) 0 )
|
||||||
@@ -227,7 +227,7 @@ free_httpd_server( httpd_server* hs )
|
|||||||
if ( hs->local_pattern != (char*) 0 )
|
if ( hs->local_pattern != (char*) 0 )
|
||||||
free( (void*) hs->local_pattern );
|
free( (void*) hs->local_pattern );
|
||||||
free( (void*) hs );
|
free( (void*) hs );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
httpd_server*
|
httpd_server*
|
||||||
@@ -237,7 +237,7 @@ httpd_initialize(
|
|||||||
char* p3p, int max_age, char* cwd, int no_log, FILE* logfp,
|
char* p3p, int max_age, char* cwd, int no_log, FILE* logfp,
|
||||||
int no_symlink_check, int vhost, int global_passwd, char* url_pattern,
|
int no_symlink_check, int vhost, int global_passwd, char* url_pattern,
|
||||||
char* local_pattern, int no_empty_referers )
|
char* local_pattern, int no_empty_referers )
|
||||||
{
|
{
|
||||||
httpd_server* hs;
|
httpd_server* hs;
|
||||||
static char ghnbuf[256];
|
static char ghnbuf[256];
|
||||||
char* cp;
|
char* cp;
|
||||||
@@ -247,7 +247,7 @@ httpd_initialize(
|
|||||||
hs = NEW( httpd_server, 1 );
|
hs = NEW( httpd_server, 1 );
|
||||||
if ( hs == (httpd_server*) 0 )
|
if ( hs == (httpd_server*) 0 )
|
||||||
{
|
{
|
||||||
// syslog( LOG_CRIT, "out of memory allocating an httpd_server" );
|
// syslog( LOG_CRIT, "out of memory allocating an httpd_server" );
|
||||||
return (httpd_server*) 0;
|
return (httpd_server*) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ httpd_initialize(
|
|||||||
hs->binding_hostname = strdup( hostname );
|
hs->binding_hostname = strdup( hostname );
|
||||||
if ( hs->binding_hostname == (char*) 0 )
|
if ( hs->binding_hostname == (char*) 0 )
|
||||||
{
|
{
|
||||||
// syslog( LOG_CRIT, "out of memory copying hostname" );
|
// syslog( LOG_CRIT, "out of memory copying hostname" );
|
||||||
return (httpd_server*) 0;
|
return (httpd_server*) 0;
|
||||||
}
|
}
|
||||||
hs->server_hostname = hs->binding_hostname;
|
hs->server_hostname = hs->binding_hostname;
|
||||||
@@ -293,7 +293,7 @@ httpd_initialize(
|
|||||||
hs->cgi_pattern = strdup( cgi_pattern );
|
hs->cgi_pattern = strdup( cgi_pattern );
|
||||||
if ( hs->cgi_pattern == (char*) 0 )
|
if ( hs->cgi_pattern == (char*) 0 )
|
||||||
{
|
{
|
||||||
// syslog( LOG_CRIT, "out of memory copying cgi_pattern" );
|
// syslog( LOG_CRIT, "out of memory copying cgi_pattern" );
|
||||||
return (httpd_server*) 0;
|
return (httpd_server*) 0;
|
||||||
}
|
}
|
||||||
/* Nuke any leading slashes in the cgi pattern. */
|
/* Nuke any leading slashes in the cgi pattern. */
|
||||||
@@ -308,7 +308,7 @@ httpd_initialize(
|
|||||||
hs->cwd = strdup( cwd );
|
hs->cwd = strdup( cwd );
|
||||||
if ( hs->cwd == (char*) 0 )
|
if ( hs->cwd == (char*) 0 )
|
||||||
{
|
{
|
||||||
// syslog( LOG_CRIT, "out of memory copying cwd" );
|
// syslog( LOG_CRIT, "out of memory copying cwd" );
|
||||||
return (httpd_server*) 0;
|
return (httpd_server*) 0;
|
||||||
}
|
}
|
||||||
if ( url_pattern == (char*) 0 )
|
if ( url_pattern == (char*) 0 )
|
||||||
@@ -318,7 +318,7 @@ httpd_initialize(
|
|||||||
hs->url_pattern = strdup( url_pattern );
|
hs->url_pattern = strdup( url_pattern );
|
||||||
if ( hs->url_pattern == (char*) 0 )
|
if ( hs->url_pattern == (char*) 0 )
|
||||||
{
|
{
|
||||||
// syslog( LOG_CRIT, "out of memory copying url_pattern" );
|
// syslog( LOG_CRIT, "out of memory copying url_pattern" );
|
||||||
return (httpd_server*) 0;
|
return (httpd_server*) 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -329,7 +329,7 @@ httpd_initialize(
|
|||||||
hs->local_pattern = strdup( local_pattern );
|
hs->local_pattern = strdup( local_pattern );
|
||||||
if ( hs->local_pattern == (char*) 0 )
|
if ( hs->local_pattern == (char*) 0 )
|
||||||
{
|
{
|
||||||
// syslog( LOG_CRIT, "out of memory copying local_pattern" );
|
// syslog( LOG_CRIT, "out of memory copying local_pattern" );
|
||||||
return (httpd_server*) 0;
|
return (httpd_server*) 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -373,19 +373,19 @@ httpd_initialize(
|
|||||||
// httpd_ntoa( hs->listen4_fd != -1 ? sa4P : sa6P ),
|
// httpd_ntoa( hs->listen4_fd != -1 ? sa4P : sa6P ),
|
||||||
// (int) hs->port );
|
// (int) hs->port );
|
||||||
return hs;
|
return hs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
httpd_initialize_listen_socket( httpd_sockaddr* saP )
|
httpd_initialize_listen_socket( httpd_sockaddr* saP )
|
||||||
{
|
{
|
||||||
int listen_fd;
|
int listen_fd;
|
||||||
int on/*, flags*/;
|
int on/*, flags*/;
|
||||||
|
|
||||||
/* Check sockaddr. */
|
/* Check sockaddr. */
|
||||||
if ( ! sockaddr_check( saP ) )
|
if ( ! sockaddr_check( saP ) )
|
||||||
{
|
{
|
||||||
// syslog( LOG_CRIT, "unknown sockaddr family on listen socket" );
|
// syslog( LOG_CRIT, "unknown sockaddr family on listen socket" );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,8 +409,8 @@ httpd_initialize_listen_socket( httpd_sockaddr* saP )
|
|||||||
/* Bind to it. */
|
/* Bind to it. */
|
||||||
if ( bind( listen_fd, &saP->sa, sockaddr_len( saP ) ) < 0 )
|
if ( bind( listen_fd, &saP->sa, sockaddr_len( saP ) ) < 0 )
|
||||||
{
|
{
|
||||||
// syslog(
|
// syslog(
|
||||||
// LOG_CRIT, "bind %.80s - %m", httpd_ntoa( saP ) );
|
// LOG_CRIT, "bind %.80s - %m", httpd_ntoa( saP ) );
|
||||||
poorman_log("can't bind to socket.\n", false, INADDR_NONE, RED);
|
poorman_log("can't bind to socket.\n", false, INADDR_NONE, RED);
|
||||||
(void) close( listen_fd );
|
(void) close( listen_fd );
|
||||||
return -1;
|
return -1;
|
||||||
@@ -419,7 +419,7 @@ httpd_initialize_listen_socket( httpd_sockaddr* saP )
|
|||||||
/* Start a listen going. */
|
/* Start a listen going. */
|
||||||
if ( listen( listen_fd, LISTEN_BACKLOG ) < 0 )
|
if ( listen( listen_fd, LISTEN_BACKLOG ) < 0 )
|
||||||
{
|
{
|
||||||
// syslog( LOG_CRIT, "listen - %m" );
|
// syslog( LOG_CRIT, "listen - %m" );
|
||||||
poorman_log("can't listen to socket.\n", false, INADDR_NONE, RED);
|
poorman_log("can't listen to socket.\n", false, INADDR_NONE, RED);
|
||||||
(void) close( listen_fd );
|
(void) close( listen_fd );
|
||||||
return -1;
|
return -1;
|
||||||
@@ -442,26 +442,26 @@ httpd_initialize_listen_socket( httpd_sockaddr* saP )
|
|||||||
#endif /* SO_ACCEPTFILTER */
|
#endif /* SO_ACCEPTFILTER */
|
||||||
|
|
||||||
return listen_fd;
|
return listen_fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
httpd_set_logfp( httpd_server* hs, FILE* logfp )
|
httpd_set_logfp( httpd_server* hs, FILE* logfp )
|
||||||
{
|
{
|
||||||
if ( hs->logfp != (FILE*) 0 )
|
if ( hs->logfp != (FILE*) 0 )
|
||||||
(void) fclose( hs->logfp );
|
(void) fclose( hs->logfp );
|
||||||
hs->logfp = logfp;
|
hs->logfp = logfp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
httpd_terminate( httpd_server* hs )
|
httpd_terminate( httpd_server* hs )
|
||||||
{
|
{
|
||||||
httpd_unlisten( hs );
|
httpd_unlisten( hs );
|
||||||
if ( hs->logfp != (FILE*) 0 )
|
if ( hs->logfp != (FILE*) 0 )
|
||||||
(void) fclose( hs->logfp );
|
(void) fclose( hs->logfp );
|
||||||
free_httpd_server( hs );
|
free_httpd_server( hs );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1437,7 +1437,7 @@ vhost_map( httpd_conn* hc )
|
|||||||
*/
|
*/
|
||||||
static char*
|
static char*
|
||||||
expand_symlinks( char* path, char** freethis, char** restP, int no_symlink_check, int tildemapped )
|
expand_symlinks( char* path, char** freethis, char** restP, int no_symlink_check, int tildemapped )
|
||||||
{
|
{
|
||||||
char* checked;
|
char* checked;
|
||||||
char* rest;
|
char* rest;
|
||||||
char link[5000];
|
char link[5000];
|
||||||
@@ -1599,7 +1599,7 @@ expand_symlinks( char* path, char** freethis, char** restP, int no_symlink_check
|
|||||||
*freethis = rest;
|
*freethis = rest;
|
||||||
return checked;
|
return checked;
|
||||||
}
|
}
|
||||||
// syslog( LOG_ERR, "readlink %.80s - %m", checked );
|
// syslog( LOG_ERR, "readlink %.80s - %m", checked );
|
||||||
free(checked);
|
free(checked);
|
||||||
free(rest);
|
free(rest);
|
||||||
*freethis = 0;
|
*freethis = 0;
|
||||||
@@ -1608,7 +1608,7 @@ expand_symlinks( char* path, char** freethis, char** restP, int no_symlink_check
|
|||||||
++nlinks;
|
++nlinks;
|
||||||
if ( nlinks > MAX_LINKS )
|
if ( nlinks > MAX_LINKS )
|
||||||
{
|
{
|
||||||
// syslog( LOG_ERR, "too many symlinks in %.80s", path );
|
// syslog( LOG_ERR, "too many symlinks in %.80s", path );
|
||||||
free(checked);
|
free(checked);
|
||||||
free(rest);
|
free(rest);
|
||||||
*freethis = 0;
|
*freethis = 0;
|
||||||
@@ -1661,7 +1661,7 @@ expand_symlinks( char* path, char** freethis, char** restP, int no_symlink_check
|
|||||||
(void) strcpy( checked, "." );
|
(void) strcpy( checked, "." );
|
||||||
*freethis = rest;
|
*freethis = rest;
|
||||||
return checked;
|
return checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
Reference in New Issue
Block a user