@@ -132,12 +132,14 @@ class HttpRequest : public BaseStream {
132132 }
133133
134134 size_t readBytesUntil (char terminator, char *buffer, size_t length) {
135+ TRACED ();
135136 return client_ptr->readBytesUntil (terminator, buffer, length);
136137 }
137138
138139 // read the reply data up to the next new line. For Chunked data we provide
139140 // the full chunk!
140141 virtual int readln (uint8_t *str, int len, bool incl_nl = true ) {
142+ TRACED ();
141143 if (reply_header.isChunked ()) {
142144 return chunk_reader.readln (*client_ptr, str, len);
143145 } else {
@@ -278,13 +280,14 @@ class HttpRequest : public BaseStream {
278280 // / Write data to the client: can be used to post data after calling
279281 // / processBegin
280282 size_t write (const uint8_t *data, size_t len) override {
283+ TRACED ();
281284 size_t result = 0 ;
282285 if (isChunked ()) {
283- client_ptr->println (len);
284286 if (len > 0 ) {
287+ client_ptr->println (len, HEX);
285288 result = client_ptr->write (data, len);
289+ client_ptr->println ();
286290 }
287- client_ptr->println ();
288291 } else {
289292 result = client_ptr->write (data, len);
290293 }
@@ -293,6 +296,7 @@ class HttpRequest : public BaseStream {
293296
294297 // / Ends the http request processing and returns the status code
295298 virtual int processEnd () {
299+ TRACED ();
296300 // if sending is chunked we terminate with an empty chunk
297301 if (isChunked ()) {
298302 write (nullptr , 0 );
@@ -342,6 +346,7 @@ class HttpRequest : public BaseStream {
342346
343347 // opens a connection to the indicated host
344348 virtual int connect (const char *ip, uint16_t port, int32_t timeout) {
349+ TRACED ();
345350 client_ptr->setTimeout (timeout / 1000 ); // client timeout is in seconds!
346351 request_header.setTimeout (timeout);
347352 reply_header.setTimeout (timeout);
0 commit comments