From: "ordex (Code Review)" Date: Wed, 25 Sep 2024 11:47:12 +0000 In-Reply-To: References: Reply-To: a@...2181..., arne-openvpn@...1227..., gianmarco@...2726..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="0+YPC8IVU1o="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: event/multi: add event_arg object to make event handling more generic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: its_Giaan Cc: flichtenheld , plaisthos , openvpn-devel --0+YPC8IVU1o= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, its_Giaan, plaisthos. ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/757?usp=3Demail ) Change subject: event/multi: add event_arg object to make event handling mo= re generic ...................................................................... Patch Set 1: (5 comments) Commit Message: http://gerrit.openvpn.net/c/openvpn/+/757/comment/aa46d7bd_e7e189df : PS1, Line 11: distinguish which of these sockets have been pocked by an inc= oming > poked? Acknowledged http://gerrit.openvpn.net/c/openvpn/+/757/comment/adc64174_bd2c6985 : PS1, Line 15: event handler argument, from a "partly integer evaluated vari= able" > "integer-evaluated" would be easier to parse I think. Acknowledged http://gerrit.openvpn.net/c/openvpn/+/757/comment/7946288e_fc23bcb7 : PS1, Line 22: use only one socket to handle all clients i/o. > Sounds clunky, "I/O of all clients" maybe? Or just "all clients. [=E2=80= =A6] 'all clients' sounds good File src/openvpn/multi.h: http://gerrit.openvpn.net/c/openvpn/+/757/comment/a9e5c953_3086edb7 : PS1, Line 105: struct event_arg ev_arg; > Please add documentation [=E2=80=A6] With the current approach we pass &mi as data to the event engine, because = if data is an address we know for sure that it must be a mi. Now we want to put ourselves in the position to pass either a multi_instanc= e or a link_socket object. For this reason we can't simply pass their address as we would not have a w= ay to understand what object that is. Therefore the idea is to use a new struct (ev_arg) which internally will gi= ve me the pointer of the mi or ls, depending on the event type. Since we need this new struct to live somewhere, it was easier to locate it= within the same struct that it points to (hence link_socket and multi_inst= ance). To some extends, you may take it as a "event base class", which is then int= erpreted as mi or ls. Does it help understanding what is going on? File src/openvpn/socket.h: http://gerrit.openvpn.net/c/openvpn/+/757/comment/b8214964_f33cc340 : PS1, Line 169: struct event_arg ev_arg; > Please add documentation explained in previous reply. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/757?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Icd7f6a2ad350cdc2312b3e80fa0dbdd7e4311d2e Gerrit-Change-Number: 757 Gerrit-PatchSet: 1 Gerrit-Owner: its_Giaan Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: its_Giaan Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Wed, 25 Sep 2024 11:47:12 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: flichtenheld Gerrit-MessageType: comment --0+YPC8IVU1o= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, its_Giaan, plaistho= s.

View C= hange

5 comments:

    =
  • Commit Message:

    • <= p style=3D"margin-bottom: 4px;">Patch Set #1, Line 11: distinguish which of these sockets hav= e been pocked by an incoming

      poked?

      <= p style=3D"white-space: pre-wrap; word-wrap: break-word;">Acknowledged

      <= /li>
    • Patch Set #1, Line 15: event handler argument, from a "partly integer evaluated = variable"

      "integer-evaluated" would be= easier to parse I think.

      Acknowledged

    • Patch Set #1, Line = 22: use only one socket= to handle all clients i/o.

      Sounds clunky, "I/O = of all clients" maybe? Or just "all clients. [=E2=80=A6]

      'all= clients' sounds good

  • File src/openvpn/multi.h:

    • Patch Set #1, Line 105: struct event_arg ev_arg;

      Please = add documentation [=E2=80=A6]

      With the current approach we pass &mi as = data to the event engine, because if data is an address we know for sure th= at it must be a mi.
      Now we want to put ourselves in the position to pass= either a multi_instance or a link_socket object.
      For this reason we can= 't simply pass their address as we would not have a way to understand w= hat object that is.
      Therefore the idea is to use a new struct (ev_arg) w= hich internally will give me the pointer of the mi or ls, depending on the = event type.
      Since we need this new struct to live somewhere, it was easi= er to locate it within the same struct that it points to (hence link_socket= and multi_instance).

      To some extends, you may take it as a "event base class"= , which is then interpreted as mi or ls.

      Does it help understanding what is going on?

  • File src/openvpn/so= cket.h:

To view, visit change 757. To unsu= bscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Icd7f6a2ad350cdc2312b3e80fa0= dbdd7e4311d2e
Gerrit-Change-Number: 757
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan <gianmarco@...2786...= ..>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: ordex <a@...2181...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: its_Giaan <gianmarco@...1665...= 726...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Comment-Date: Wed, 25 Sep 2024 11:47:12= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <frank@...1186...= .2641...>
Gerrit-MessageType: comment
--0+YPC8IVU1o=--