Menu

#12 Connection::whois returns integer?

open
nobody
None
5
2006-08-26
2006-08-26
No

When I do a $conn->whois($nick) I get back a number.
Such as 10 or 12. I would expect, instead, to get back
a hostname.

Discussion

  • Phil Dibowitz

    Phil Dibowitz - 2006-08-26

    Logged In: YES
    user_id=533101

    Connection::userhost seems to also return an interger.

     
  • Phil Dibowitz

    Phil Dibowitz - 2006-08-26

    Logged In: YES
    user_id=533101

    Digging through the code a bit more I see why.

    userhost() calls sl() which calls sl_real() which eventually
    calls send(). The return value of send() is the number of
    bytes sent. sl_real() is returning the retval of send().
    sl() is returning the retval() of sl_real() and userhost()
    is returning the retval of sl().

    This userhost() returns the number of bytes sent.

    It would seem wise for Net::IRC to do the read() and return
    the hostname instead.

    The other option sets up a handler for userhost, calls
    userhost, then has to record where it was so that the
    userhost handler can pickup where it left off *if* in fact
    the userhost is for us. Yuck.

    - Phil

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.