[TinyOWS-users] two or more connections type

Marc-André Trottier marcandre_trottier at hotmail.com
Fri Nov 4 07:25:21 EST 2011


In my case, i'm using the same mapfile to publish with Mapserver and
to parameterize
TinyOWS
So i got more than one type of connection.
in Fact, it's two : WMS and POSTGIS

so i did this in mapfile.c :
 static void layer_properties(char * yytext, bool quotes)
{
        char *p;
        char WMS[] = "\"http:";
        /* remove surrounding quotes */
        if (quotes) {
                for (p = yytext; *p ; p++); *(--p) = 0; yytext++;
        }

        switch(map_layer_prop_state) {
        case MAP_LAYER_NAME:
                map_l->name = buffer_init();
                buffer_add_str(map_l->name, yytext);
                return;
        case MAP_LAYER_CONNECTION:
                /* TODO: Having a Layer connection notion in TinyOWS*/
                if(strncmp(WMS, yytext,6)==0)
                        return;
                else if (map_o->pg_dsn->use && strcmp(map_o->pg_dsn->buf,
yytext))
                        ows_error(map_o, OWS_ERROR_CONFIG_FILE,
                                /*"MapFile have more than one single
PostGIS db connection.",*/
                                        yytext,
                                "parse_config_file");
                else if (!map_o->pg_dsn->use) buffer_add_str(map_o->pg_dsn,
yytext);

                return;
        }
}

after some test, it's seems to work
could it be problematic ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/tinyows-users/attachments/20111104/21b6966c/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: modif2.patch
Type: application/octet-stream
Size: 3000 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/tinyows-users/attachments/20111104/21b6966c/attachment.obj 


More information about the TinyOWS-users mailing list