And I have another question about multi_process_io_udp lost event. Is there some problem if we change if{} else if{} to if {} if {}. e.g.:
diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c index a604d217..18dc009d 100644 --- a/src/openvpn/mudp.c +++ b/src/openvpn/mudp.c @@ -220,12 +220,12 @@ multi_process_io_udp(struct multi_context *m) multi_process_outgoing_link(m, mpp_flags); } /* TUN device ready to accept write */ - else if (status & TUN_WRITE) + if (status & TUN_WRITE) { multi_process_outgoing_tun(m, mpp_flags); } /* Incoming data on UDP port */ - else if (status & SOCKET_READ) + if (status & SOCKET_READ) { read_incoming_link(&m->top); if (!IS_SIG(&m->top)) @@ -234,7 +234,7 @@ multi_process_io_udp(struct multi_context *m) } } /* Incoming data on TUN device */ - else if (status & TUN_READ) + if (status & TUN_READ) { read_incoming_tun(&m->top); if (!IS_SIG(&m->top)) @@ -244,7 +244,7 @@ multi_process_io_udp(struct multi_context *m) } #ifdef ENABLE_ASYNC_PUSH /* INOTIFY callback */ - else if (status & FILE_CLOSED) + if (status & FILE_CLOSED) { multi_process_file_closed(m, mpp_flags); } wei wang <lny...@gmail.com> 于2019年4月22日周一 下午5:26写道: > > 1. When client-connect tests whether the user has written the > configuration, we should check to see if the file size is 0, not > whether the file exists. > Because the configuration file is created by openvpn itself. > 2. multi_client_connect_early_setup should be called for the first time. > > diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c > index 697994b8..27c6e935 100644 > --- a/src/openvpn/multi.c > +++ b/src/openvpn/multi.c > @@ -1641,9 +1641,13 @@ multi_client_connect_post(struct multi_context *m, > const char *dc_file, > unsigned int *option_types_found) > { > - /* Did script generate a dynamic config file? */ > - if (platform_test_file(dc_file)) > - { > + /* Did script write config to dynamic config file? */ > + platform_stat_t dc_stat = {0}; > + if (platform_stat(dc_file, &dc_stat) < 0) { > + return; > + } > + > + if (dc_stat.st_size > 0) { > options_server_import(&mi->context.options, > dc_file, > D_IMPORT_ERRORS|M_OPTERR, > @@ -2474,13 +2478,13 @@ multi_connection_established(struct > multi_context *m, struct multi_instance *mi) > /* Initially we have no handler that has returned a result */ > mi->client_connect_status = CC_STATUS_DEFERRED_NO_RESULT; > from_deferred = false; > + multi_client_connect_early_setup(m, mi); > } > else > { > from_deferred = true; > } > > - multi_client_connect_early_setup(m, mi); > > bool cc_succeeded = true; > > Gert Doering <g...@greenie.muc.de> 于2019年4月20日周六 下午11:07写道: > > > > Hi, > > > > On Sat, Apr 20, 2019 at 04:37:03PM +0800, wei wang wrote: > > > I have found that the patch set > > > "https://patchwork.openvpn.net/project/openvpn2/list/?series=413" has > > > implement it. > > > But it has not been updated for several months. Is there someone still > > > work on it? We test with it for client-connect script, and find some > > > bug. > > > I am very happy to provide if needed. > > > > We're working on reviewing, fixing and merging it. > > > > So if you have feedback or even found a bug, please send it in (preferrably > > in reply to the original mail, so patchwork can pick it up, but just here > > in the thread is good enough). > > > > gert > > -- > > "If was one thing all people took for granted, was conviction that if you > > feed honest figures into a computer, honest figures come out. Never doubted > > it myself till I met a computer with a sense of humor." > > Robert A. Heinlein, The Moon is a Harsh > > Mistress > > > > Gert Doering - Munich, Germany > > g...@greenie.muc.de > > > > -- > Regards, > Wang Wei -- Regards, Wang Wei _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel