-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgis_map_serv.cpp
48 lines (42 loc) · 1.62 KB
/
qgis_map_serv.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/***************************************************************************
qgs_map_serv.cpp
A server application supporting WMS / WFS / WCS
-------------------
begin : July 04, 2006
copyright : (C) 2006 by Marco Hugentobler & Ionut Iosifescu Enescu
email : marco dot hugentobler at karto dot baug dot ethz dot ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
//for CMAKE_INSTALL_PREFIX
#include "qgsconfig.h"
#include "qgsserver.h"
#include <fcgi_stdio.h>
int fcgi_accept()
{
#ifdef Q_OS_WIN
if ( FCGX_IsCGI() )
return FCGI_Accept();
else
return FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ );
#else
return FCGI_Accept();
#endif
}
int main( int argc, char * argv[] )
{
QgsServer server;
server.init( argc, argv );
// Starts FCGI loop
while ( fcgi_accept() >= 0 )
{
server.handleRequest( );
}
return 0;
}