[mapserver-dev] SWIG Changes for 7.4

Andy Colson andy at squeakycode.net
Tue Apr 16 05:34:26 PDT 2019


On 4/16/19 2:03 AM, Seth G wrote:
>>
>> I can't build with C# or PHP, so I dunno, but I cant image it would
>> cause problems. Does anyone know why the #ifdef's were added in the
>> first place?  I've removed them and tested with perl just fine.
>>
>> I could add those changes to my pull request and have travis test it.  Should I?
>>
>> I'm aware of the spacing, but it was messed up a bit and I think it
>> would be great to clean it up a little.
>>
>> -Andy
>>
>>
> 
> The changes were added via the commit at https://github.com/mapserver/mapserver/commit/10fe3d78c3f3a3e2cbc64ede7c091a60f11a4e22
> 
> At the same time a typemap was added to the Python MapScript bindings:
> 
> %typemap(out) hashTableObj*
> 
> I'd guess other languages would need to implement a similar typemap mapping hashTableObj to a dictionary-type class language equivalent.
> I'd guess there is no harm in the change - and to add to Travis and see if all still builds successfully.
> 
> What happens in Perl if you run code like in the Python example in the commit?
> 
>   headers = mapscript.msIO_getAndStripStdoutBufferMimeHeaders()
> 
> 
> Seth
> 

I am.  I have.  Perl already has hasTableObj.

This is my test code, which passes:

my $h  = mapscript::msIO_getAndStripStdoutBufferMimeHeaders();
ok($h->get('Cache-Control') eq 'max-age=86400');
ok($h->get('Content-Type') eq 'image/png');

I was copying some of the python tests, which is how I found out about it in the first place.  msIO_getAndStripStdoutBufferMimeHeaders isnt documented (from what I can find), but seems to be more correct.

"ows_http_max_age" "86400"
Adds a Cache-Control header, but the old msIO_stripStdoutBufferContentType (which I currently use), wont find it, and wont properly strip the headers off the image because Cache-Control is first and the procedure only checks for Content-Type.

I think maybe msIO_stripStdoutBufferContentType should be deprecated and msIO_getAndStripStdoutBufferMimeHeaders becomes the "one true way".

Cool.  I'll check it all in.

-Andy


More information about the mapserver-dev mailing list