toitlang / pkg-http

Package: Implement your REST server or client in Toit and run it on your ESP32.
MIT License
1 stars 1 forks source link

Connection closed #101

Closed floitsch closed 1 year ago

floitsch commented 1 year ago

With v2.3.0 I'm still getting http requests that don't work:

EXCEPTION error. 
Connection closed
  0: tcp_read_                 <sdk>/net/modules/tcp.toit:202:3
  1: TcpSocket.read            <sdk>/net/modules/tcp.toit:157:17
  2: BufferedReader.more_      <sdk>/reader.toit:82:22
  3: BufferedReader.ensure_    <sdk>/reader.toit:69:14
  4: BufferedReader.can_ensure <sdk>/reader.toit:109:5
  5: SymmetricSession_.read_   <sdk>/tls/session.toit:985:22
  6: SymmetricSession_.read.<block> <sdk>/tls/session.toit:972:14
  7: SymmetricSession_.read    <sdk>/tls/session.toit:970:3
  8: Session.read              <sdk>/tls/session.toit:385:54
  9: Socket.read               <sdk>/tls/socket.toit:99:21
 10: BufferedReader.more_      <sdk>/reader.toit:82:22
 11: BufferedReader.index_of   <sdk>/reader.toit:247:14
 12: BufferedReader.index_of_or_throw <sdk>/reader.toit:225:14
...
 22: Client.try_to_reuse_      <pkg:pkg-http>/client.toit:610:3
 23: Client.post_.<block>      <pkg:pkg-http>/client.toit:472:7
 24: SmallInteger_.repeat      <sdk>/core/numbers.toit:1194:3
 25: Client.post_              <pkg:pkg-http>/client.toit:470:19
 26: Client.post_json          <pkg:pkg-http>/client.toit:535:12
floitsch commented 1 year ago

Another one:

******************************************************************************
Decoding by `jag`, device has version <2.0.0-alpha.90>
******************************************************************************
EXCEPTION error. 
ALREADY_CLOSED
  0: Session.handshake         <sdk>/tls/session.toit:207:7
  1: Session.ensure_handshaken_ <sdk>/tls/session.toit:433:5
  2: Session.write             <sdk>/tls/session.toit:369:5
  3: Socket.write              <sdk>/tls/socket.toit:102:21
  4: Writer.write              <sdk>/writer.toit:39:23
  5: Connection.send_headers   <pkg:pkg-http>/connection.toit:119:13
  6: RequestOutgoing.send      <pkg:pkg-http>/request.toit:48:32

This is on a client that was never closed. However, the initial handshake failed (due to OOM).

floitsch commented 1 year ago

The first should be solved. I will close the issue, even if the second might still happen. Will open a new issue if I see it again.