Change in osmo-pcap[master]: Use osmo_fd_*_{disable,enable}

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Oct 19 11:07:24 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcap/+/20783 )


Change subject: Use osmo_fd_*_{disable,enable}
......................................................................

Use osmo_fd_*_{disable,enable}

Change-Id: I97e100b34e9d26cf5acaa57be12879787d4d2d2b
Depends: libosmocore.git Idb89ba7bc7c129a6304a76900d17f47daf54d17d
---
M src/osmo_tls.c
1 file changed, 4 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/83/20783/1

diff --git a/src/osmo_tls.c b/src/osmo_tls.c
index f1671e9..f1f08ca 100644
--- a/src/osmo_tls.c
+++ b/src/osmo_tls.c
@@ -191,10 +191,9 @@
 	if (rc == 0) {
 		/* handshake is done. start writing if we are allowed to */
 		LOGP(DTLS, LOGL_NOTICE, "TLS handshake done.\n");
+		osmo_fd_read_enable(&tls_session->wqueue->bfd);
 		if (!llist_empty(&tls_session->wqueue->msg_queue))
-			tls_session->wqueue->bfd.when = OSMO_FD_WRITE | OSMO_FD_READ;
-		else
-			tls_session->wqueue->bfd.when = OSMO_FD_READ;
+			osmo_fd_write_enable(&tls_session->wqueue->bfd);
 		tls_session->need_handshake = false;
 		release_keys(tls_session);
 		if (tls_session->handshake_done)
@@ -227,7 +226,7 @@
 static int tls_write(struct osmo_tls_session *sess)
 {
 	int rc;
-	sess->wqueue->bfd.when &= ~OSMO_FD_WRITE;
+	osmo_fd_write_disable(&sess->wqueue->bfd);
 
 	if (llist_empty(&sess->wqueue->msg_queue))
 		return 0;
@@ -252,7 +251,7 @@
 	}
 
 	if (sess->need_resend || !llist_empty(&sess->wqueue->msg_queue))
-		sess->wqueue->bfd.when |= OSMO_FD_WRITE;
+		osmo_fd_write_enable(&sess->wqueue->bfd);
 	return rc;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/20783
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I97e100b34e9d26cf5acaa57be12879787d4d2d2b
Gerrit-Change-Number: 20783
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201019/80b0682f/attachment.htm>


More information about the gerrit-log mailing list