cgmnlm

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/cgmnlm.git
Log | Files | Refs | README | LICENSE

commit 73f5a5bc2b97fb36ded8feb36828d598d6e9fed3
parent 37396a375a68868490342e16140e67287445be17
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun, 20 Sep 2020 15:10:45 -0400

client.h: clarify some constraints

Diffstat:
Minclude/client.h | 14+++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/include/client.h b/include/client.h @@ -39,11 +39,8 @@ enum gemini_result { GEMINI_OK, GEMINI_ERR_OOM, GEMINI_ERR_INVALID_URL, - // status is set to the return value from getaddrinfo GEMINI_ERR_RESOLVE, - // status is set to errno GEMINI_ERR_CONNECT, - // use SSL_get_error(resp->ssl, resp->status) to get details GEMINI_ERR_SSL, GEMINI_ERR_IO, GEMINI_ERR_PROTOCOL, @@ -52,17 +49,16 @@ enum gemini_result { // Requests the specified URL via the gemini protocol. If options is non-NULL, // it may specify some additional configuration to adjust client behavior. // -// Returns a value indicating the success of the request. If GEMINI_OK is -// returned, the response details shall be written to the gemini_response -// argument. +// Returns a value indicating the success of the request. +// +// Caller must call gemini_response_finish afterwards to clean up resources +// before exiting or re-using it for another request. enum gemini_result gemini_request(const char *url, struct gemini_options *options, struct gemini_response *resp); // Must be called after gemini_request in order to free up the resources -// 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. +// allocated during the request. void gemini_response_finish(struct gemini_response *resp); // Returns a user-friendly string describing an error.