Skip to content

Commit

Permalink
Port wmsserver changes to service
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarteau committed Jan 10, 2017
1 parent d8a05cc commit 4a76929
Show file tree
Hide file tree
Showing 6 changed files with 193 additions and 195 deletions.
30 changes: 15 additions & 15 deletions src/server/qgsfcgiserverresponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,38 +180,38 @@ QgsFcgiServerRequest::QgsFcgiServerRequest()
QString uri = getenv( "REQUEST_URI" );
if ( uri.isEmpty() )
{
uri = getenv( "SCRIPT_NAME");
uri = getenv( "SCRIPT_NAME" );
}

url.setUrl( uri );

// Check if host is defined
if( url.host().isEmpty() )
if ( url.host().isEmpty() )
{
url.setHost( getenv( "SERVER_NAME" ) );
url.setHost( getenv( "SERVER_NAME" ) );
}

// Port ?
if( url.port(-1) == -1 )
if ( url.port( -1 ) == -1 )
{
QString portString = getenv( "SERVER_PORT" );
if ( !portString.isEmpty() )
QString portString = getenv( "SERVER_PORT" );
if ( !portString.isEmpty() )
{
bool portOk;
int portNumber = portString.toInt( &portOk );
if ( portOk && portNumber != 80 )
{
bool portOk;
int portNumber = portString.toInt( &portOk );
if ( portOk && portNumber != 80 )
{
url.setPort( portNumber );
}
url.setPort( portNumber );
}
}
}

// scheme
if( url.scheme().isEmpty() )
if ( url.scheme().isEmpty() )
{
QString( getenv( "HTTPS" ) ).compare( QLatin1String( "on" ), Qt::CaseInsensitive ) == 0
? url.setScheme( QStringLiteral( "https" ) )
: url.setScheme( QStringLiteral( "http" ) );
? url.setScheme( QStringLiteral( "https" ) )
: url.setScheme( QStringLiteral( "http" ) );
}

// XXX OGC paremetrs are passed with the query string
Expand Down
4 changes: 2 additions & 2 deletions src/server/qgsfilterresponsedecorator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "qgsfilterresponsedecorator.h"

QgsFilterResponseDecorator::QgsFilterResponseDecorator( QgsServerFiltersMap filters, QgsServerResponse& response )
: mFilters(filters)
, mResponse(response)
: mFilters( filters )
, mResponse( response )
{
}

Expand Down
8 changes: 4 additions & 4 deletions src/server/qgsfilterresponsedecorator.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class QgsFilterResponseDecorator: public QgsServerResponse

// QgsServerResponse overrides

void setHeader( const QString& key, const QString& value ) override { mResponse.setHeader(key, value); }
void setHeader( const QString& key, const QString& value ) override { mResponse.setHeader( key, value ); }

void clearHeader( const QString& key ) override { mResponse.clearHeader( key ); }

Expand All @@ -51,7 +51,7 @@ class QgsFilterResponseDecorator: public QgsServerResponse

bool headersWritten() const override { return mResponse.headersWritten(); }

void setReturnCode( int code ) override { mResponse.setReturnCode( code ); }
void setReturnCode( int code ) override { mResponse.setReturnCode( code ); }

void sendError( int code, const QString& message ) override { mResponse.sendError( code, message ); }

Expand All @@ -62,8 +62,8 @@ class QgsFilterResponseDecorator: public QgsServerResponse
void flush() override;

void clear() override { mResponse.clear(); }



private:
QgsServerFiltersMap mFilters;
Expand Down
Loading

0 comments on commit 4a76929

Please sign in to comment.