NationalAssociationOfRealtors / libRETS

libRETS is RETS client library written in C++ that allows rapid development of RETS client applications. By saving the developer from dealing with the RETS protocol details, the application writer can concentrate on their application, saving them time and money in the process
Other
107 stars 59 forks source link

Missing first photoObject for MRIS #75

Closed abidCharlotte49er closed 5 years ago

abidCharlotte49er commented 5 years ago

Anyone seen this issue before. We are are not able to get first image from MRIS it always starts from index 2. Never seen this issue before. Issue is seen in RetsConnector as well. Added sample code for reference.

As a workaround I'm thinking about accessing missing image by the index (0 or 1) Is there a document that shows how we can pull Photo objects by their index?

Thanks in advance.

image

bwolven commented 5 years ago

There used to be a flag to ignore malformed headers. GetObjectRequest::SetIgnoreMalformedHeaders(bool ignore) You can try that.

abidCharlotte49er commented 5 years ago

Hey Bruce, Thanks You I will try this early next week and write my comments. Thank You so much for taking time and suggesting this.

bwolven commented 5 years ago

I've been through this before myself. It has something to do with the leading CR missing in the mime content being returned or something like that. And that effects the parsing of the first image in the set.

jazzklein commented 5 years ago

Some servers apparently don't follow the proper spec for MIME/Multipart. The spec says that each header must include the leading CRLF meaning that there needs to be CRCRLF between the optional leading content and the boundary header.

Here's what the ignore malformed headers flag does:

  if (ignoreMalformedHeaders && !(content.substr(0,2) == "\r\n"))
    {
        content = "\r\n" + content;
    }
abidCharlotte49er commented 5 years ago

Bruce, Mark

I can confirm setting that flag did the trick. I can now get that missing image. Thank you all for looking into this and helping us resolve this. I have to see if this option impacts other MLS integration. I see in the document it is advised not to use this option.

image

bwolven commented 5 years ago

If at all possible, you should make it a site level configuration and only use it for sites with the actual issue.