summaryrefslogtreecommitdiff
path: root/src/ne_request.h
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2008-02-08 14:47:40 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2008-02-08 14:47:40 +0000
commit395ff40c214c0f9de46833d0319d4d9393dfbd41 (patch)
tree615120031481f925a7c131b521a8aee0514426b6 /src/ne_request.h
parent3aaa5ccd6d2d6853c085f6ec405744aca205e261 (diff)
downloadneon-395ff40c214c0f9de46833d0319d4d9393dfbd41.tar.gz
Add a close-connection hook (thanks to Robert J. van der Boon):
* src/ne_private.h (struct ne_session_s): Add close_conn_hooks. * src/ne_session.c (ne_hook_close_conn, ne_unhook_close_conn): New functions. (ne_close_connection): Run close_conn hooks. * src/ne_request.h (ne_hook_close_conn, ne_unhook_close_conn): New prototypes. * test/request.c (hook_close_conn, hooks): Add tests. git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@1344 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'src/ne_request.h')
-rw-r--r--src/ne_request.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ne_request.h b/src/ne_request.h
index b057869..bfe5cdc 100644
--- a/src/ne_request.h
+++ b/src/ne_request.h
@@ -1,6 +1,6 @@
/*
HTTP Request Handling
- Copyright (C) 1999-2006, Joe Orton <joe@manyfish.co.uk>
+ Copyright (C) 1999-2006, 2008, Joe Orton <joe@manyfish.co.uk>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -278,10 +278,15 @@ void ne_hook_destroy_request(ne_session *sess,
ne_destroy_req_fn fn, void *userdata);
typedef void (*ne_destroy_sess_fn)(void *userdata);
-/* Hook called when the session is destroyed. */
+/* Hook called when the session is about to be destroyed. */
void ne_hook_destroy_session(ne_session *sess,
ne_destroy_sess_fn fn, void *userdata);
+typedef void (*ne_close_conn_fn)(void *userdata);
+/* Hook called when the connection is closed; note that this hook
+ * may be called *AFTER* the destroy_session hook. */
+void ne_hook_close_conn(ne_session *sess, ne_close_conn_fn fn, void *userdata);
+
/* The ne_unhook_* functions remove a hook registered with the given
* session. If a hook is found which was registered with a given
* function 'fn', and userdata pointer 'userdata', then it will be
@@ -298,6 +303,8 @@ void ne_unhook_destroy_request(ne_session *sess,
ne_destroy_req_fn fn, void *userdata);
void ne_unhook_destroy_session(ne_session *sess,
ne_destroy_sess_fn fn, void *userdata);
+void ne_unhook_close_conn(ne_session *sess,
+ ne_close_conn_fn fn, void *userdata);
/* Store an opaque context for the request, 'priv' is returned by a
* call to ne_request_get_private with the same ID. */