GeoIP on Azure #3

Closed
tiggris opened this Issue Feb 26, 2013 · 3 comments

Projects

None yet

3 participants

@tiggris
tiggris commented Feb 26, 2013

Hi,

Recently I have been working on project that uses GeoIP library and is hosted on Windows Azure. My first approach was to use local storage and pass database path to LookupService constructor. But it turned out that this approach is a little bit inconvenient, because with each deployment I have to copy GeoIP databse file to all Azure instances. That's why I figured out it would be much easier to use blobs to store database file and share it among instances and deployments. But for now it is impossible as the only way to create LookupService is to pass path to the database file.

Best regards,
tiggris.

@vineus
vineus commented Feb 26, 2013

Hi,

I got the same kind of issue, so I just added a new constructor:

        public LookupService(Stream databaseStream, int options)
        {
            if (databaseStream == null)
                throw new ArgumentException(String.Empty, @"databaseStream");
            if (!databaseStream.CanRead || !databaseStream.CanSeek)
                throw new ArgumentException(@"input stream must support reading and seeking", "databaseStream");
            this.file = databaseStream;
            dboptions = options;
            init();
        }

I'll probably submit a patch soon with this and other enhancements (such as throwing exceptions instead of writing to the console when an error occurs).

@tiggris
tiggris commented Feb 26, 2013

Thank you for your effort and I'm looking forward to your patch.

Regards,
tiggris.

@vineus
vineus commented Jun 19, 2013

Hey! Sorry for the delay... pull requests are apparently never taken into account here, so we did a fork here: https://github.com/criteo/geoip-api-csharp2

It's synced with the maxmind code, but bugx are fixed, namespaces are right and you have some optims as a bonus.

@oschwald oschwald closed this Jan 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment