Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Remove redundant connIncrRefs/connDecrRefs In socket.c, the reference counter is incremented before calling callHandler, but the same reference counter is also incremented inside callHandler before calling the actual callback. static inline int callHandler(connection *conn, ConnectionCallbackFunc handler) { connIncrRefs(conn); if (handler) handler(conn); connDecrRefs(conn); ... } This commit removes the redundant incr/decr calls in socket.c 2. Correct return value of connRead for TLS when peer closed According to comments in connection.h, connRead returns 0 when the peer has closed the connection. This patch corrects the return value for TLS connections. (Without this patch, it returns -1 which means error.) There is an observable difference in what is logged in the verbose level: "Client closed connection" vs "Reading from client: (null)". --------- Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
- Loading branch information