ArduinoMongoose
ArduinoMongoose copied to clipboard
HTTP API oddity
I'm not sure if this is actually a problem, but wanted to make a note to look at this before finishing up with the Mongoose 7.7 upgrade.
In the static MongooseHttpClient::eventHandler(), the requests's MongooseHttpClientRequest::_client field is used to reference back to the client associated with the request. But, that _client field is only set in the MongooseHttpClientRequest ctor, and it's not checked in MongooseHttpClient::send(). It might be possible for a request to be sent through a different client than it was originally constructed with. Not sure if that's really a problem, but it seems like a potential source of weird bugs.
One fix might be to move the public send() method over to the request, since it already has an associated client.