diff --git a/include/client.h b/include/client.h

index dbd73234311331ea52650d59dbd9cf535b73298b..f711eea91c3842ac29a884b38e0d7a0ab99cb7fb 100644

--- a/include/client.h

+++ b/include/client.h

@@ -46,6 +46,7 @@ GEMINI_ERR_CONNECT,

// use SSL_get_error(resp->ssl, resp->status) to get details

GEMINI_ERR_SSL,

GEMINI_ERR_IO,

};

// Requests the specified URL via the gemini protocol. If options is non-NULL,

@@ -63,5 +64,8 @@ // allocated during the request. If you intend to re-use the SSL_CTX provided by

// gemini_options, set the ctx pointer to NULL before calling

// gemini_response_finish.

void gemini_response_finish(struct gemini_response *resp);

+// Returns a user-friendly string describing an error.

+const char *gemini_strerr(enum gemini_result r, struct gemini_response *resp);

#endif

diff --git a/src/client.c b/src/client.c

index 5f2debb52c310f88e82ad83ca2251ba233d6a704..67671ccca2a25a460681bdffacb981c7f26c1407 100644

--- a/src/client.c

+++ b/src/client.c

@@ -2,6 +2,7 @@ #include <assert.h>

#include <errno.h>

#include <netdb.h>

#include <openssl/bio.h>

+#include <openssl/err.h>

#include <openssl/ssl.h>

#include <stdlib.h>

#include <string.h>

@@ -168,6 +169,21 @@ res = GEMINI_ERR_IO;

	goto cleanup;

}

cleanup:

curl_url_cleanup(uri);

return res;

@@ -188,3 +204,29 @@ SSL_free(resp->ssl);

SSL_CTX_free(resp->ssl_ctx);

free(resp->meta);

}

+const char *

+gemini_strerr(enum gemini_result r, struct gemini_response *resp)

+{

+}

diff --git a/src/gmnic.c b/src/gmnic.c

index 7b2eb183ebfe67dce0aaf8c6010bf6785b503df6..014211dc3784ba3eadcf1885ef7bcf6fe84d8462 100644

--- a/src/gmnic.c

+++ b/src/gmnic.c

@@ -1,9 +1,13 @@

#include <assert.h>

+#include <errno.h>

#include <getopt.h>

+#include <openssl/bio.h>

#include <openssl/err.h>

#include <stdbool.h>

#include <stdio.h>

#include <stdlib.h>

+#include <string.h>

+#include <unistd.h>

#include "client.h"

static void

@@ -17,11 +21,15 @@

int

main(int argc, char *argv[])

{

int c;

	switch (c) {

	case '4':

		assert(0); // TODO

@@ -30,25 +38,29 @@ case '6':

		assert(0); // TODO

		break;

	case 'C':

		break;

	case 'd':

		break;

	case 'h':

		usage(argv[0]);

		return 0;

	case 'L':

		break;

	case 'I':

		break;

	default:

		fprintf(stderr, "fatal: unknown flag %c", c);

		return 1;

	}

}

if (optind != argc - 1) {

	usage(argv[0]);

	return 1;

@@ -59,33 +71,41 @@ ERR_load_crypto_strings();

struct gemini_response resp;

enum gemini_result r = gemini_request(argv[optind], NULL, &resp);

	break;

	break;

}

gemini_response_finish(&resp);

return 0;

}

Proxy Information
Original URL
gemini://gmn.clttr.info:1965/sources/cgmnlm.git/commits/9b1a618b4211a029c352c72f6d273e3085c8457d.patch
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
140.772728 milliseconds
Gemini-to-HTML Time
1.948561 milliseconds

This content has been proxied by September (ba2dc).