Nixes / iotHubLib

a library for the esp8266 arduino platform that allows easy writing of sensor node programs for the iotHub platform
0 stars 1 forks source link

http responses are being sent one byte at a time #16

Open Nixes opened 7 years ago

Nixes commented 7 years ago

server.setNoDelay(); makes no difference

Nixes commented 7 years ago

It seems to be a bug in how aWot response objects write non const byte arrays to the wifi-client.

Nixes commented 7 years ago

tried using res.write like so:

    uint8_t buffer[200];
    json_obj.printTo((char *)buffer, sizeof(buffer));// this is great except it seems to be adding quotation marks around what it  is sending

    res.success("application/json");
    res.write(buffer, sizeof(buffer));

which still resulted in single byte packets

Nixes commented 7 years ago

Tried Both:

client->flush();

and

response.flush();

with no improvements

Nixes commented 7 years ago

Another potential lead:

Advanced REST Client Thinks all responses including get/post from all endpoints of iotHubLib are empty. Does this mean that the http output is malformed in some way? But this might just be a symptom rather than a cause of course.

Nixes commented 7 years ago

This actually becomes a problem now, as this limits the time it takes for an actor to process a request.