Commit Diff


commit - 329a6aa7fb5d28302b8d0ce79cbcfce5741d06ca
commit + 6490a1e911df9c4f629efb6a0c6a24ab9dc392dc
blob - 3949efc5f4e975965c68cb4d8c928551cba2602e
blob + bf6acf421f9500ff062de590c586d4fe239003e7
--- gotd/session.c
+++ gotd/session.c
@@ -65,10 +65,6 @@ static struct gotd_session {
 	struct gotd_imsgev notifier_iev;
 	struct timeval request_timeout;
 	enum gotd_procid proc_id;
-	struct got_pathlist_head *notification_refs;
-	struct got_pathlist_head *notification_ref_namespaces;
-	int summarize_notifications;
-	struct gotd_notification_targets *notification_targets;
 } gotd_session;
 
 static struct gotd_session_client {
@@ -422,6 +418,7 @@ send_notification(struct got_object_id *old_id, struct
 {
 	const struct got_error *err = NULL;
 	struct gotd_session_client *client = &gotd_session_client;
+	struct gotd_repo *repo_cfg = gotd_session.repo_cfg;
 	struct gotd_imsgev *iev = &gotd_session.notifier_iev;
 	struct got_pathlist_entry *pe;
 	struct gotd_imsg_notify inotify;
@@ -434,18 +431,18 @@ send_notification(struct got_object_id *old_id, struct
 
 	memset(&inotify, 0, sizeof(inotify));
 
-	TAILQ_FOREACH(pe, gotd_session.notification_refs, entry) {
+	TAILQ_FOREACH(pe, &repo_cfg->notification_refs, entry) {
 		const char *refname = pe->path;
 		if (strcmp(got_ref_get_name(ref), refname) == 0)
 			break;
 	}
-	if (pe == NULL && !TAILQ_EMPTY(gotd_session.notification_refs))
+	if (pe == NULL && !TAILQ_EMPTY(&repo_cfg->notification_refs))
 		return NULL;
 
 	if (gethostname(hostname, sizeof(hostname)) == -1)
 		return got_error_from_errno("gethostname");
 
-	TAILQ_FOREACH(pe, gotd_session.notification_ref_namespaces, entry) {
+	TAILQ_FOREACH(pe, &repo_cfg->notification_ref_namespaces, entry) {
 		const char *namespace = pe->path;
 
 		err = validate_namespace(namespace);
@@ -456,7 +453,7 @@ send_notification(struct got_object_id *old_id, struct
 			break;
 	}
 	if (pe == NULL &&
-	    !TAILQ_EMPTY(gotd_session.notification_ref_namespaces))
+	    !TAILQ_EMPTY(&repo_cfg->notification_ref_namespaces))
 		return NULL;
 
 	fd = got_opentempfd();