Menu

#183 t_optmgmt: Incorrect options format

fixed
None
2025-11-15
2025-11-04
No

Every time, every dt program gives that error on its start. t_optmgmt() is called once in _tt_tli_set_nodelay(), as the name says, to set TCP_NODELAY option for ToolTalk connections. The fix could be as follows:

int
tli_setopt(int fd, int level, int name, int value)
{
    struct t_optmgmt req, resp;
    struct {
        struct opthdr opt;
        int value;
    } reqbuf;

    reqbuf.opt.level = level;
    reqbuf.opt.name = name;
    reqbuf.opt.len = sizeof (int);

    reqbuf.value = value;

    req.flags = T_NEGOTIATE;
    req.opt.len = sizeof (reqbuf);
    req.opt.buf = (char *)&reqbuf;

    resp.flags = 0;
    resp.opt.buf = (char *)&reqbuf;
    resp.opt.maxlen = sizeof (reqbuf);

    if (t_optmgmt(fd, &req, &resp) < 0 || resp.flags != T_SUCCESS) {
        t_error("t_optmgmt");
        return (0);
    }
        return (1);
}

extern "C" 
int
_tt_tli_set_nodelay(int fd)
{
    return (tli_setopt(fd, IPPROTO_TCP, TCP_NODELAY, 1));
}

Related

Tickets: #183

Discussion

  • Mariusz Zynel

    Mariusz Zynel - 2025-11-04

    The function _tt_tli_set_nodelay() is implementd in: lib/tt/lib/mp/mp_rpc_fns.C

     
    • Jon Trulson

      Jon Trulson - 2025-11-11

      Hi,

      Can you send a patch I can easily apply or submit an MR?

      -jon

      On 11/4/25 13:45, Mariusz Zynel wrote:

      The function |_tt_tli_set_nodelay()| is implementd in:
      |lib/tt/lib/mp/mp_rpc_fns.C|


      [tickets:#183] https://sourceforge.net/p/cdesktopenv/tickets/183/
      t_optmgmt: Incorrect options format

      Status: open
      Created: Tue Nov 04, 2025 08:42 PM UTC by Mariusz Zynel
      Last Updated: Tue Nov 04, 2025 08:42 PM UTC
      Owner: nobody

      Every time, every dt program gives that error on its start.
      t_optmgmt() is called once in _tt_tli_set_nodelay(), as the name says,
      to set TCP_NODELAY option for ToolTalk connections. The fix could be
      as follows:

      |int tli_setopt(int fd, int level, int name, int value) { struct
      t_optmgmt req, resp; struct { struct opthdr opt; int value; } reqbuf;
      reqbuf.opt.level = level; reqbuf.opt.name = name; reqbuf.opt.len =
      sizeof (int); reqbuf.value = value; req.flags = T_NEGOTIATE;
      req.opt.len = sizeof (reqbuf); req.opt.buf = (char )&reqbuf;
      resp.flags = 0; resp.opt.buf = (char
      )&reqbuf; resp.opt.maxlen =
      sizeof (reqbuf); if (t_optmgmt(fd, &req, &resp) < 0 || resp.flags !=
      T_SUCCESS) { t_error("t_optmgmt"); return (0); } return (1); } extern
      "C" int _tt_tli_set_nodelay(int fd) { return (tli_setopt(fd,
      IPPROTO_TCP, TCP_NODELAY, 1)); } |


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/cdesktopenv/tickets/183/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      Jon Trulson

      "The less you know, the more you believe."
      -- Bono

       

      Related

      Tickets: #183

      • Mariusz Zynel

        Mariusz Zynel - 2025-11-11

        Hi,
        here is the patch attached.

        Hope it helps
        Mariusz

         
        • Jon Trulson

          Jon Trulson - 2025-11-14

          Thanks. I'll apply it to master this weekend.

           
          • Jon Trulson

            Jon Trulson - 2025-11-15

            Merged to master. Thanks!

             
  • Mariusz Zynel

    Mariusz Zynel - 2025-11-14

    It would be my first contribution to CDE that I use for over 30 years now. It was Sun's fork on Solaris and recently the Open Source on OpenIndiana. It has some oddities that I'm not used to but the environment is stable and let me get my work done and to play. I've made a lat of fixes which should probably find their way into repo. I'll try to prepare patches.

     
    • Jon Trulson

      Jon Trulson - 2025-11-15

      Oh, please do... If you do, please either make them MR's, or 'git format-patch' patches. That way you also get credit since those can be merged as-is and will include your commit message.

      With just diff format (like the one you posted above), I have to do more work, and the patch will appear to come from me, since I am the one that has to prepare and commit it myself.

      https://sourceforge.net/p/cdesktopenv/wiki/Contributing%20to%20CDE/

       
  • Jon Trulson

    Jon Trulson - 2025-11-15
    • status: open --> fixed
    • assigned_to: Jon Trulson
     

Log in to post a comment.