Issue with making second HTTP calls

Hi,

I threw together this mod last night, not sure if it will help, but it seems to work with my limited testing.

http://develephant.github.io/mod_slurp/

It may or may not be applicable in your case.

Cheers.

That looks really cool… I will give it a try.  Thanks for your help!

Hi Develephant

There is a syntax error in your mod.  Line 56.

self.network\_id = network.request( url, listener, self.options )

It should be

self.network\_id = network.request( url, "GET", listener, self.options )

Or should the method name be one of the keys in the init table.

Another thing to add.  For done function of the mod, probably need to check with the id is available before doing a cancellation.  Without that, it will cause an error when the first url is successful since breather is not required.

function SlurpQueue:\_done() if self.breather\_id then timer.cancel( self.breather\_id ) end if self.timer\_id then timer.cancel( self.timer\_id ) end self:\_debug("Done") end

Hi,

Thanks for the feedback, I pushed an update that should hopefully address the issues.

Also, to anyone, this is 100% open source so pull requests are welcome. :slight_smile:

https://github.com/develephant/mod_slurp/

Cheers.

Hi,

I rewrote the module. Should be much more stable. The first version was more of a prototype.

http://develephant.github.io/mod_slurp/

Cheers.

Great.  I will download the latest version and give it a try.  Thanks.

Just one quick feedback. It seems like for the latest version, we no longer can get the error response.  I thought that information can be quite useful.

Hi,

I can pass up that info. Previously it was passing the whole networkRequest ‘userdata’ which was causing crashes in certain cases. I can add it as an additional callback parameter.

I believe the status parameter should hold the numerical error/http status id. I’ll look again.

Thanks for the feedback.

Cheers.