eggheads / eggdrop

The Eggdrop IRC Bot
GNU General Public License v2.0
506 stars 84 forks source link

traffic counting bug #1405

Open michaelortmann opened 1 year ago

michaelortmann commented 1 year ago

when connected via console and not telnet, input and output traffic are not counted likewise:

.traffic
[...]
Partyline:
  out: 0 Bytes (0 Bytes today)
   in: 9 Bytes (9 Bytes today)
[...]
.traffic
[...]
Partyline:
  out: 0 Bytes (0 Bytes today)
   in: 18 Bytes (18 Bytes today)
[...]

output traffic counting is ausgesteuert under certain conditions:

https://github.com/eggheads/eggdrop/blob/2a6a36888f5aa2204d84a9e6282d35e5421c2c8a/src/net.c#L1285-L1288

vanosg commented 1 year ago

Can you provide more detail on what is or isn't happening here?

michaelortmann commented 1 year ago

i exptect partyline traffic counting to count input and output traffic regarding partyline. and doing so likewise. so, when i connect to partyline via console, and i issue .traffic command, then i did generate input and eggdrop will generate output. then, if i do .traffic again, i expect it to show values for in: and out: higher than ZERO OR both zero, if console-connect is not counted.

the code snipped i referenced is suppressing counting of outgoing bytes for console-"connects" to partyline i expect eggdrop to suppress BOTH input and output OR not suppress at all. but its makes no sense, to only suppress one side.

vanosg commented 1 year ago

Reason for why it is: input is counting traffic as it is received at the socket via main.c. Output traffic is counted per idx in net.c. So that explains why the commands you are typing show up in the traffic count (you entered it on an idx) and the received data is not being counted (it is not being sent to the socket to be counted).

Do what you will with this information