~sircmpwn/gmni-discuss

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] notify clients about malformed requests

Julian Maingot <julianmaingot@gmail.com>
Details
Message ID
<20220731002435.80866-1-julianmaingot@gmail.com>
DKIM signature
pass
Download raw message
Patch: +4 -1
I think this has been broken for a while and I came across it while
implementing my own client. The server should notify the client that the
request is malformed but wasn't sending the response when SSL_read
returned SSL_ERROR_WANT_READ.
---
 src/server.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/server.c b/src/server.c
index e199f6f..56e11c9 100644
--- a/src/server.c
+++ b/src/server.c
@@ -345,7 +345,10 @@ client_readable(struct gmnisrv_server *server, struct gmnisrv_client *client)
		switch (e) {
		case SSL_ERROR_WANT_READ:
		case SSL_ERROR_WANT_WRITE:
			goto queue_ssl_write;
                        if (client->bufln == 0) {
                                goto queue_ssl_write;
                        }
                        // intentional fallthrough
		default:
			client_submit_response(client,
				GEMINI_STATUS_BAD_REQUEST, error, NULL);
-- 
2.37.1
Details
Message ID
<CM6NG1A7RTU3.1FMN4P4SQU643@taiga>
In-Reply-To
<20220731002435.80866-1-julianmaingot@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/gmnisrv
   1925bc3..132f2ec  master -> master
Reply to thread Export thread (mbox)