Menu

#85 Lircd unable to connect to multiple hosts

0.9.3
closed
nobody
lircd (8)
fixed,
2015-01-22
2014-12-28
No

Version 0.9 of lircd is the last version which is able to connect to multiple other lircd instances. A short look at the code shows that lircd passed the arguments in a while loop for version <=0.9. After 0.9.1 it gets option strings, but only one connect string.

This is a major regression for me, as I need to combine three dev/input devices.

If someone give me a concrete hint what to do I'll could look into it myself.

Discussion

  • Alec Leamas

    Alec Leamas - 2014-12-29

    Ack. This is indeed a major regression. Odd that it isn't reported until now.

    If you want to make a stab at it, I think one way is to redefine the --connect parameter to a comma-separated list of clients, and change the code in lircd: main() to invoke add_peer_connection() as needed. Don't forget to patch also the manpage in that case.

    Parsing a list is too much work and state for the main() function, you will need a separate helper for that.

    When testing, please don't forget to test also setting the parameter in lirc_options.conf.

     
  • Hendrik Borghorst

    Ok, I've made a patch which works for me. I've no idea how stress resistant this solution is as I'm not the biggest expert in standard-c string manipulation.

     
  • Alec Leamas

    Alec Leamas - 2014-12-29

    Looks reasonable, nice job! Hpwever, as I stated in the first comment you need to use a separate helper function for this, it's too much state to be in the main function.

    Also, you might look into strtok(3). It does the job for you here. The possible downside is that it destroys the string, but it's no problem in this context. There are plenty of strtok examples in the code...

     
  • Hendrik Borghorst

    Funny, this is also much easier. Thanks. This should work.

     
  • Alec Leamas

    Alec Leamas - 2014-12-30

    hm.. there is one problem (const-ness compilation warning) and a few style issues (unnecessary global variable, formatting, return-is-an-operator) with the v2 patch. I have rewritten it (attached), can you check & test since you have the test setup (and four eyes are always better that two...)

     
  • Alec Leamas

    Alec Leamas - 2015-01-15

    Ping?

     
  • Hendrik Borghorst

    Ah sorry, I forgot it. I'll test it today right after I get home from work

     
  • Alec Leamas

    Alec Leamas - 2015-01-22

    Pong? :)

     
  • Hendrik Borghorst

    Upps, I'm really sorry. Forgot it again. But i've tested it right now and it works like a charm.

     
  • Alec Leamas

    Alec Leamas - 2015-01-22

    NP, I really appreciate the help. Will merge Real Soon (TM).

     
  • Alec Leamas

    Alec Leamas - 2015-01-22
    • status: open --> closed
    • Resolution: na, --> fixed,
    • Milestone: Future --> 0.9.3
     
  • Alec Leamas

    Alec Leamas - 2015-01-22

    Fixed in [d5474f], closing. Thanks for reporting, coding and testing!

     

    Related

    Commit: [d5474f]


Log in to post a comment.