Home GnuPG
Diffusion GnuPG ea0f5481f01e

http: Add reference counting to the session object.
ea0f5481f01eUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

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.

Details

Provenance
wernerAuthored on May 5 2014, 4:06 PM
Parents
rG0e59195642eb: http: Add HTTP_FLAG_FORCE_TLS and http_get_tls_info.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rGea0f5481f01e: http: Add reference counting to the session object. (authored by Werner Koch <wk@gnupg.org>).May 5 2014, 4:06 PM