diff options
author | Werner Koch <[email protected]> | 2014-05-05 14:06:42 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-05-05 14:06:42 +0000 |
commit | ea0f5481f01eacedff264bf08144164aa989ec4d (patch) | |
tree | d6d288d4a2576ab1ab477fd686eaa6d7d8ba3631 /common/http.h | |
parent | http: Add HTTP_FLAG_FORCE_TLS and http_get_tls_info. (diff) | |
download | gnupg-ea0f5481f01eacedff264bf08144164aa989ec4d.tar.gz gnupg-ea0f5481f01eacedff264bf08144164aa989ec4d.zip |
http: Add reference counting to the session object.
* common/http.c (http_session_t): Add field "refcount".
(_my_socket_new, _my_socket_ref, _my_socket_unref): Add debug code.
(send_request, my_npth_read, my_npth_write): Use SOCK object for the
transport ptr.
(http_session_release): Factor all code out to ...
(session_unref): here. Deref SOCK.
(http_session_new): Init refcount and transport ptr.
(http_session_ref): New. Ref and unref all assignments.
--
Having the reference counted session objects makes it easier for the
application to pass around only an estream. Without that the
application would need to implement an es_onclose machinery for the
session object.
Diffstat (limited to '')
-rw-r--r-- | common/http.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/common/http.h b/common/http.h index fa73b6e59..b6471b6b8 100644 --- a/common/http.h +++ b/common/http.h @@ -95,6 +95,7 @@ void http_register_tls_ca (const char *fname); gpg_error_t http_session_new (http_session_t *r_session, const char *tls_priority); +http_session_t http_session_ref (http_session_t sess); void http_session_release (http_session_t sess); |