maxmind / geoipupdate-legacy

GeoIP update client code
GNU General Public License v2.0
258 stars 63 forks source link

Improve error reporting when non-HTTP 200 response #56

Closed horgh closed 7 years ago

horgh commented 7 years ago

Currently in non-HTTP 200 responses we report by saying only that there is an unexpected HTTP status. The body contains a message. We write it out to stderr now.

This also updates geoipupdate to no longer inspect the body to determine whether it contains a message. In the case of no updates being available, we still receive HTTP 200, but we now check for this by examining the X-Database-MD5 header. This simplifies the handling of the response body as we can now expect it to always be gzip data.

This also includes some small cleanups.

horgh commented 7 years ago

I just rebased after the OSX merge.