Tor source code file analysis-control

Source: Internet
Author: User

Traditionally, the system signal is the control signal transmitted by the system to the process. For example, SIGINT and sigterm. The transmission of these signals usually indicates the relevant process to complete the corresponding operation, or suspend or terminate, or some other operations. In tor systems, there are two types of signals: traditional signals and controller signals. BelowCodeSection is a simple list of these signals:

/* These signals are defined to help handle_control_signal work. */# ifndef sighup # define sighup 1 # endif # ifndef SIGINT # define SIGINT 2 # endif # ifndef SIGUSR1 # define SIGUSR1 10 # endif # ifndef sigusr2 # define sigusr2 12 # endif # sigterm # define sigterm 15 # endif/* controller signals start at a high number so we don't * conflict with system-defined signals. */# define signewnym 129 # define sigcleardnsccache 130

These signals areProgramSignals of major concern. They all have corresponding response processing functions, all of which are process_signal functions called in the signal callback function. In the previous section, we have mentioned the signal event processing mechanism, so we will not talk about it here. However, it is worth noting that the signal event registration at that time did not register the signewnym signal and sigcleardnscache signal. That is to say, these two signals are not activated by the Signal Processing Event. Where did they appear? The answer is to control connection signal transmission.

We will temporarily put this part of content here and change the title to control. After the control connection is analyzed, the main functions and usage of the system control connection are described in detail here.

To be continued ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.