dart_postgresql icon indicating copy to clipboard operation
dart_postgresql copied to clipboard

Bug in conn.close()

Open xxgreg opened this issue 11 years ago • 0 comments

Will throw null error, if sending terminate message throws.

Future flushing;
try {
  var msg = new MessageBuffer();
  msg.addByte(_MSG_TERMINATE);
  msg.addInt32(0);
  msg.setLength();
  _socket.add(msg.buffer);
  flushing = _socket.flush();
} on Exception catch (e, st) {
  _messages.add(new ClientMessageImpl(
      severity: 'WARNING',
      message: 'Exception while closing connection. Closed without sending '
        'terminate message.',
      connectionName: _getDebugName(),
      exception: e,
      stackTrace: st));
}

// Wait for socket flush to succeed or fail before closing the connection.
flushing.whenComplete(_destroy);

Null exception at "flushing.".

xxgreg avatar Dec 16 '14 08:12 xxgreg