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:
Adrien Destugues
2016-08-21 16:53:45 +02:00
parent 777ff37166
commit 385ee03ba8
+26 -26
View File
@@ -201,17 +201,17 @@ static long long atoll( const char* str );
static void
check_options( void )
{
{
#if defined(TILDE_MAP_1) && defined(TILDE_MAP_2)
// syslog( LOG_CRIT, "both TILDE_MAP_1 and TILDE_MAP_2 are defined" );
exit( 1 );
#endif /* both */
}
}
static void
free_httpd_server( httpd_server* hs )
{
{
if ( hs->binding_hostname != (char*) 0 )
free( (void*) hs->binding_hostname );
if ( hs->cwd != (char*) 0 )
@@ -227,7 +227,7 @@ free_httpd_server( httpd_server* hs )
if ( hs->local_pattern != (char*) 0 )
free( (void*) hs->local_pattern );
free( (void*) hs );
}
}
httpd_server*
@@ -237,7 +237,7 @@ httpd_initialize(
char* p3p, int max_age, char* cwd, int no_log, FILE* logfp,
int no_symlink_check, int vhost, int global_passwd, char* url_pattern,
char* local_pattern, int no_empty_referers )
{
{
httpd_server* hs;
static char ghnbuf[256];
char* cp;
@@ -247,7 +247,7 @@ httpd_initialize(
hs = NEW( httpd_server, 1 );
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;
}
@@ -256,7 +256,7 @@ httpd_initialize(
hs->binding_hostname = strdup( hostname );
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;
}
hs->server_hostname = hs->binding_hostname;
@@ -293,7 +293,7 @@ httpd_initialize(
hs->cgi_pattern = strdup( cgi_pattern );
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;
}
/* Nuke any leading slashes in the cgi pattern. */
@@ -308,7 +308,7 @@ httpd_initialize(
hs->cwd = strdup( cwd );
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;
}
if ( url_pattern == (char*) 0 )
@@ -318,7 +318,7 @@ httpd_initialize(
hs->url_pattern = strdup( url_pattern );
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;
}
}
@@ -329,7 +329,7 @@ httpd_initialize(
hs->local_pattern = strdup( local_pattern );
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;
}
}
@@ -373,19 +373,19 @@ httpd_initialize(
// httpd_ntoa( hs->listen4_fd != -1 ? sa4P : sa6P ),
// (int) hs->port );
return hs;
}
}
int
httpd_initialize_listen_socket( httpd_sockaddr* saP )
{
{
int listen_fd;
int on/*, flags*/;
/* Check sockaddr. */
if ( ! sockaddr_check( saP ) )
{
// syslog( LOG_CRIT, "unknown sockaddr family on listen socket" );
// syslog( LOG_CRIT, "unknown sockaddr family on listen socket" );
return -1;
}
@@ -409,8 +409,8 @@ httpd_initialize_listen_socket( httpd_sockaddr* saP )
/* Bind to it. */
if ( bind( listen_fd, &saP->sa, sockaddr_len( saP ) ) < 0 )
{
// syslog(
// LOG_CRIT, "bind %.80s - %m", httpd_ntoa( saP ) );
// syslog(
// LOG_CRIT, "bind %.80s - %m", httpd_ntoa( saP ) );
poorman_log("can't bind to socket.\n", false, INADDR_NONE, RED);
(void) close( listen_fd );
return -1;
@@ -419,7 +419,7 @@ httpd_initialize_listen_socket( httpd_sockaddr* saP )
/* Start a listen going. */
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);
(void) close( listen_fd );
return -1;
@@ -442,26 +442,26 @@ httpd_initialize_listen_socket( httpd_sockaddr* saP )
#endif /* SO_ACCEPTFILTER */
return listen_fd;
}
}
void
httpd_set_logfp( httpd_server* hs, FILE* logfp )
{
{
if ( hs->logfp != (FILE*) 0 )
(void) fclose( hs->logfp );
hs->logfp = logfp;
}
}
void
httpd_terminate( httpd_server* hs )
{
{
httpd_unlisten( hs );
if ( hs->logfp != (FILE*) 0 )
(void) fclose( hs->logfp );
free_httpd_server( hs );
}
}
void
@@ -1437,7 +1437,7 @@ vhost_map( httpd_conn* hc )
*/
static char*
expand_symlinks( char* path, char** freethis, char** restP, int no_symlink_check, int tildemapped )
{
{
char* checked;
char* rest;
char link[5000];
@@ -1599,7 +1599,7 @@ expand_symlinks( char* path, char** freethis, char** restP, int no_symlink_check
*freethis = rest;
return checked;
}
// syslog( LOG_ERR, "readlink %.80s - %m", checked );
// syslog( LOG_ERR, "readlink %.80s - %m", checked );
free(checked);
free(rest);
*freethis = 0;
@@ -1608,7 +1608,7 @@ expand_symlinks( char* path, char** freethis, char** restP, int no_symlink_check
++nlinks;
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(rest);
*freethis = 0;
@@ -1661,7 +1661,7 @@ expand_symlinks( char* path, char** freethis, char** restP, int no_symlink_check
(void) strcpy( checked, "." );
*freethis = rest;
return checked;
}
}
int