MCPcopy Index your code
hub / github.com/MapServer/MapServer / msWCSDispatch20

Function msWCSDispatch20

mapwcs20.c:4106–4255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4104/************************************************************************/
4105
4106int msWCSDispatch20(mapObj *map, cgiRequestObj *request, owsRequestObj *ows_request)
4107{
4108 wcs20ParamsObjPtr params = NULL;
4109 int returnValue = MS_FAILURE, status;
4110
4111 params = msWCSCreateParamsObj20();
4112 status = msWCSParseRequest20(request, params);
4113
4114#if defined(USE_LIBXML2)
4115 if(status == MS_FAILURE)
4116 {
4117 msDebug("msWCSDispatch20(): Parse error occurred.\n");
4118 msWCSException20(map, "InvalidParameterValue", "request", "2.0.0" );
4119 msWCSFreeParamsObj20(params);
4120 return MS_FAILURE;
4121 }
4122 else if(status == MS_DONE)
4123 {
4124 /* could not be parsed, but no error */
4125 /* continue for now... */
4126 }
4127
4128 /* first check if Service is WCS */
4129 if (params->service == NULL
4130 || !EQUAL(params->service, "WCS"))
4131 {
4132 /* The service is not WCS, exit with MS_DONE */
4133 msDebug("msWCSDispatch20(): wrong service (%s)\n",
4134 (params->service != NULL) ? params->service : "none");
4135 msWCSFreeParamsObj20(params);
4136 msResetErrorList();
4137 return MS_DONE;
4138 }
4139
4140 /* check if request is set */
4141 if(params->request == NULL)
4142 {
4143 /* If service is WCS, a request must be set. */
4144 /* Therefore, exit with a failure. */
4145 msSetError(MS_WCSERR, "Missing REQUEST parameter",
4146 "msWCSDispatch20()");
4147 msWCSException20(map, "MissingParameterValue", "request",
4148 params->version );
4149 msWCSFreeParamsObj20(params); /* clean up */
4150 return MS_FAILURE;
4151 }
4152
4153 /* Handle version negotiation for GetCapabilities. */
4154 /* Only if accepted versions are given, and not a */
4155 /* predefined version. */
4156 if (EQUAL(params->request, "GetCapabilities")
4157 && params->accept_versions != NULL
4158 && params->version == NULL)
4159 {
4160 int i, highest_version = 0;
4161 char version_string[OWS_VERSION_MAXLEN];
4162 for(i = 0; params->accept_versions[i] != NULL; ++i)
4163 {

Callers 1

msWCSDispatchFunction · 0.85

Calls 15

msWCSCreateParamsObj20Function · 0.85
msWCSParseRequest20Function · 0.85
msDebugFunction · 0.85
msWCSException20Function · 0.85
msWCSFreeParamsObj20Function · 0.85
msResetErrorListFunction · 0.85
msSetErrorFunction · 0.85
msOWSParseVersionStringFunction · 0.85
msOWSGetVersionStringFunction · 0.85
msStrdupFunction · 0.85
msWCSIsLayerSupportedFunction · 0.85

Tested by

no test coverage detected