[JDEV] Cleanup Of Karma Code Completed
Harold E. Gottschalk Jr.
heg at sirlabs.com
Thu May 10 18:38:15 CDT 2001
All,
I have spent the last week working on cleaning up the karma implementation
in the source release for 1.4.1. I was unable to find some of the CVS
sources therefore I made my changes based on 1.4.1 and not the latest dev
source, so whoever does the merge please forgive me.
I believe it can now work as intended. It also allows for the inheritance
of the default values set in <io> for karma in other services that would
like to set their own karma values for their connections.
I made a few changes to the karma struct so if you have your own service
that wants to set karma please review the changes I have made in client.c or
dialback.c. Please review your code for compatibility with the new struct
and methods. karma_check is deprecated now.
As I went through the code I found several problems associated with karma
and have corrected them.
I have added a new karma tag <resetmeter>, the default value is false for
now. What it does is, when your karma is restored your byte count is reset
to zero. I prefer total absolution, but you must turn this on otherwise it
works as before forcing your karma down faster once you have transgressed.
<resetmeter>1</resetmeter> # makes it true
The <init> tag now does what it was meant to do initialize a new connection
with a certain karma value at the start. This never worked because it was
ignored.
Setting the <dec> tag value to 0 disables karma processing for that
connection. Karma and rating are not the same and I have note investigated
rating to explain the difference.
I have made a good attempt of cleaning up karma and I think I have made the
processing at the core server loop more efficient.
I have a tar posted with the changed files and diffs at
http://sirlabs.com/karma1.4.1patches.tgz .
Files changed:
client.c
dialback.c
jabberd.h
karma.c
lib.h
mio.c
Please try my changes and provide any feedback and let me know if I broke
anything I was unaware of. I did test the changes and believe it to be with
out any obvious issues.
Do you think that karma should be applied to writing sockets?
heg
"If at first the idea is not absurd, then there is no hope for it." - Albert
Einstein
More information about the JDev
mailing list