Opened 23 months ago

Closed 22 months ago

Last modified 17 months ago

#26947 closed enhancement (implemented)

Add function for reporting the tor version in tor_api.h

Reported by: hellais Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.5.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords:
Cc: ahf, nickm Actual Points: .1
Parent ID: #25510 Points:
Reviewer: ahf Sponsor: Sponsor8

Description (last modified by hellais)

As a user of libtor_api it would be useful for me to be able to obtain the version of tor without having to call it's main function.

The function could look something like:

const char * tor_version()
    return tor_version_string;

This would be very useful for a user of the library that wishes to check if they have linked to the right tor version (or implement some sanity checks) without having to start tor and then speak to it on the control port (therefore paying some significant overhead).

Child Tickets

Change History (10)

comment:1 Changed 23 months ago by hellais

Description: modified (diff)

comment:2 Changed 22 months ago by nickm

We talked about this, and decided that the right subtlety here is not to return the version of tor, but the version and identity of "whatever is implementing the tor_api". (The existence of libtorrunner makes this complicated but IMO worthwhile.)

comment:3 Changed 22 months ago by nickm

Owner: set to nickm
Status: newaccepted

comment:4 Changed 22 months ago by nickm

Status: acceptedneeds_review

See branch ticket26947, with PR at .

comment:5 Changed 22 months ago by nickm

Milestone: Tor: 0.3.5.x-final
Sponsor: Sponsor8

comment:6 Changed 22 months ago by hellais

I tested this and wrote some comments in the PR. For me this is good to be merged.

comment:7 Changed 22 months ago by asn

Reviewer: ahf

comment:8 Changed 22 months ago by ahf

Status: needs_reviewmerge_ready

I think this looks good to get merged. I think having an example of the format in the docstring as Hellais writes would be a good idea :-)

comment:9 Changed 22 months ago by nickm

Resolution: implemented
Status: merge_readyclosed

Merged, with a paragraph full of examples and warnings

comment:10 Changed 17 months ago by nickm

Actual Points: .1
Note: See TracTickets for help on using tickets.