Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetFeatureInfo multipart with wrong line separator #4430

Closed
aperi2007 opened this issue Aug 21, 2012 · 3 comments
Closed

GetFeatureInfo multipart with wrong line separator #4430

aperi2007 opened this issue Aug 21, 2012 · 3 comments
Assignees
Milestone

Comments

@aperi2007
Copy link

Using mapserver 6.2-dev
And asking for a GML from a getFeatureInfo request like this :

http://web.regione.toscana.it/wmsraster/com.rt.wms.RTmap/wms?map=wmscatasto&language=ita&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=1617043.371614,4810657.326353,1617576.552829,4810931.280957&CRS=EPSG:3003&WIDTH=581&HEIGHT=437&LAYERS=rt_cat.idcatbdfog.rt&STYLES=&FORMAT=image/png&QUERY_LAYERS=rt_cat.idcatbdfog.rt&FEATURE_COUNT=10&INFO_FORMAT=text/gml&I=240&J=200

The mapserver return a multipart but wronly on the two line between the two parts.
Infact seem it send a couple of LFLF instead of a couple of CRLF

As requires from specs.
http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html

So some softwares go in error and report only one part.
We are try-ing to use the apache.commons.fileupload but due to this couple LFLF they go in error with a
"malformedexception".

@ghost ghost assigned tbonfort Aug 21, 2012
tbonfort added a commit to MapServer/msautotest_DEPRECATED that referenced this issue Aug 22, 2012
@aperi2007
Copy link
Author

The patch seem to resolve only partially.
Is missing the CRLF in the headers.

I try to change directly the code to better test, and see that the changed still need are these:

In the file "mapogroutput.c"
in the line 954 apply this:


msIO_fprintf(stdout,"--%s\r\n",boundary );   <-- HERE

for( i = 0; file_list != NULL && file_list[i] != NULL; i++ ) {
  FILE *fp;
  int bytes_read;
  char buffer[1024];

  if( sendheaders )
    msIO_fprintf( stdout,
                  "Content-Disposition: attachment; filename=%s\r\n"   <-- HERE
                  "Content-Type: application/binary\r\n"   <-- HERE
                  "Content-Transfer-Encoding: binary%c%c%c%c",   <-- HERE
                  CPLGetFilename( file_list[i] ),
                  13,10,13,10 );   <-- HERE

And , still in the file "mapogroutput.c"
to the line 976

  if (file_list[i+1] == NULL)
    msIO_fprintf( stdout, "\r\n--%s--\r\n", boundary ); <-- HERE
  else
    msIO_fprintf( stdout, "\r\n--%s\r\n", boundary ); <-- HERE
}

Regards.

@tbonfort tbonfort reopened this Aug 24, 2012
@aperi2007
Copy link
Author

Hi,
I tested the changes reported and now the multipart seem to work.

I could put the new file "mapogroutput.c" in this thread, but I don't know how (if possible) to do it.

Regards.

@aperi2007
Copy link
Author

Hi,
now the response GML from GetFeatureInfo of MapServer is ok for me.
Thx.

@tbonfort tbonfort closed this as completed Sep 5, 2012
Schpidi added a commit to EOX-A/mapserver that referenced this issue Sep 26, 2012
…msIO_stripStdoutBufferContentHeaders() for new line endings (MapServer#4430).
Schpidi added a commit to EOX-A/mapserver that referenced this issue Sep 26, 2012
mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
…msIO_stripStdoutBufferContentHeaders() for new line endings (MapServer#4430).
mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants