@@ -132,12 +132,14 @@ class HttpRequest : public BaseStream {
132
132
}
133
133
134
134
size_t readBytesUntil (char terminator, char *buffer, size_t length) {
135
+ TRACED ();
135
136
return client_ptr->readBytesUntil (terminator, buffer, length);
136
137
}
137
138
138
139
// read the reply data up to the next new line. For Chunked data we provide
139
140
// the full chunk!
140
141
virtual int readln (uint8_t *str, int len, bool incl_nl = true ) {
142
+ TRACED ();
141
143
if (reply_header.isChunked ()) {
142
144
return chunk_reader.readln (*client_ptr, str, len);
143
145
} else {
@@ -278,13 +280,14 @@ class HttpRequest : public BaseStream {
278
280
// / Write data to the client: can be used to post data after calling
279
281
// / processBegin
280
282
size_t write (const uint8_t *data, size_t len) override {
283
+ TRACED ();
281
284
size_t result = 0 ;
282
285
if (isChunked ()) {
283
- client_ptr->println (len);
284
286
if (len > 0 ) {
287
+ client_ptr->println (len, HEX);
285
288
result = client_ptr->write (data, len);
289
+ client_ptr->println ();
286
290
}
287
- client_ptr->println ();
288
291
} else {
289
292
result = client_ptr->write (data, len);
290
293
}
@@ -293,6 +296,7 @@ class HttpRequest : public BaseStream {
293
296
294
297
// / Ends the http request processing and returns the status code
295
298
virtual int processEnd () {
299
+ TRACED ();
296
300
// if sending is chunked we terminate with an empty chunk
297
301
if (isChunked ()) {
298
302
write (nullptr , 0 );
@@ -342,6 +346,7 @@ class HttpRequest : public BaseStream {
342
346
343
347
// opens a connection to the indicated host
344
348
virtual int connect (const char *ip, uint16_t port, int32_t timeout) {
349
+ TRACED ();
345
350
client_ptr->setTimeout (timeout / 1000 ); // client timeout is in seconds!
346
351
request_header.setTimeout (timeout);
347
352
reply_header.setTimeout (timeout);
0 commit comments