Re: sqlcounter returning wrong value?

2008-11-13 Thread Venkatesh K
Hi Liran, here is the patch. I have done some initial testing. --- freeradius-1.1.7.orig/src/modules/rlm_sqlcounter/rlm_sqlcounter.c 2008-11-13 11:21:14.0 +0530 +++

Re: sqlcounter returning wrong value?

2008-11-12 Thread Flamur Rogova
liran tal wrote: Waiting for that traffic limitation patch, Venkatesh. Thanks. Hi, I was stuck with this problem too, and I came up with this solution, which works in my test environment. The idea is to store allowed bytes in Tmp-Integer-0, than just use unlang to compare user's allowed

Re: sqlcounter returning wrong value?

2008-11-12 Thread Venkatesh K
Hi, On Wed, Nov 12, 2008 at 2:06 AM, liran tal [EMAIL PROTECTED] wrote: Waiting for that traffic limitation patch, Venkatesh. Thanks. I am sorry. I had few busy days this week. You can expect a patch tomorrow. On Sun, Nov 9, 2008 at 6:00 AM, Venkatesh K [EMAIL PROTECTED] wrote: Hi Liran,

Re: sqlcounter returning wrong value?

2008-11-12 Thread liran tal
Hey, Thanks for the tip, though that's FR2-specific solution and I'd like to be able to get this sort out with older deployments running 1.1.7 or earlier (god forbid! :-) ) That patch for rlm_sqlcounter would be ideal I think. I think this should also be already pushed into the formal release,

Re: sqlcounter returning wrong value?

2008-11-11 Thread liran tal
Waiting for that traffic limitation patch, Venkatesh. Thanks. On Sun, Nov 9, 2008 at 6:00 AM, Venkatesh K [EMAIL PROTECTED] wrote: Hi Liran, On Sun, Nov 9, 2008 at 4:16 AM, liran tal [EMAIL PROTECTED] wrote: Hey Venkatesh, On Fri, Oct 31, 2008 at 2:26 AM, Venkatesh K [EMAIL PROTECTED]

Re: sqlcounter returning wrong value?

2008-11-09 Thread liran tal
On Sun, Nov 9, 2008 at 6:00 AM, Venkatesh K [EMAIL PROTECTED] wrote: Hi Liran, On Sun, Nov 9, 2008 at 4:16 AM, liran tal [EMAIL PROTECTED] wrote: Hey Venkatesh, On Fri, Oct 31, 2008 at 2:26 AM, Venkatesh K [EMAIL PROTECTED] wrote: rlm_sqlcounter has one more limitation. In version

Re: sqlcounter returning wrong value?

2008-11-09 Thread Anders Holm
Answers before questions? Novel idea. limited to 4GB Sent from my iPhone On 9 Nov 2008, at 14:00, liran tal [EMAIL PROTECTED] wrote: On Sun, Nov 9, 2008 at 6:00 AM, Venkatesh K [EMAIL PROTECTED] wrote: Hi Liran, On Sun, Nov 9, 2008 at 4:16 AM, liran tal [EMAIL PROTECTED] wrote: Hey

Re: sqlcounter returning wrong value?

2008-11-08 Thread liran tal
Hey Venkatesh, On Fri, Oct 31, 2008 at 2:26 AM, Venkatesh K [EMAIL PROTECTED] wrote: 2008/10/31 [EMAIL PROTECTED]: It does make sense. rlm_sqlcounterworks like this toward the time of the reset: lets say you have an hour left, your limit is 20 hours and you have signed in 15 minutes

Re: sqlcounter returning wrong value?

2008-11-08 Thread Venkatesh K
Hi Liran, On Sun, Nov 9, 2008 at 4:16 AM, liran tal [EMAIL PROTECTED] wrote: Hey Venkatesh, On Fri, Oct 31, 2008 at 2:26 AM, Venkatesh K [EMAIL PROTECTED] wrote: 2008/10/31 [EMAIL PROTECTED]: It does make sense. rlm_sqlcounterworks like this toward the time of the reset: lets say you

Re: sqlcounter returning wrong value?

2008-10-30 Thread liran tal
Well, taking this issue back to the begining - it all started with my report that using the attribute Chilli-Max-Total-Octets in the sqlcounter provided as follows yields wrong results for all of the reset times (daily/weekly/monthly): sqlcounter counterChilliSpotMaxDailyOctets {

Re: sqlcounter returning wrong value?

2008-10-30 Thread tnt
It does make sense. rlm_sqlcounterworks like this toward the time of the reset: lets say you have an hour left, your limit is 20 hours and you have signed in 15 minutes before counter reset time. When code calculates that you can be online at reset time it doesn't return your allowance (1 hour)

Re: sqlcounter returning wrong value?

2008-10-30 Thread Venkatesh K
2008/10/31 [EMAIL PROTECTED]: It does make sense. rlm_sqlcounterworks like this toward the time of the reset: lets say you have an hour left, your limit is 20 hours and you have signed in 15 minutes before counter reset time. When code calculates that you can be online at reset time it

Re: sqlcounter returning wrong value?

2008-10-29 Thread liran tal
Thanks for the patch, I have not checked it yet. What is the status on this issue though? A patch is nice but I'd like to see support for data counters to find it's place in the newer version as well as the old one (well, a backport would be nice. Many of us still have production systems running

Re: sqlcounter returning wrong value?

2008-10-29 Thread Venkatesh K
The patch I posted was out of the hat just to skip the routine which adds additional quota. We have stopped using rlm_sqlcounter long back as we moved from radius schema to our own custom schema and patched the rlm_sql to work with our custom schema. If you or someone list out what one would

Re: sqlcounter returning wrong value?

2008-10-25 Thread tnt
OK. This where the problem comes from: /* * If we are near a reset then add the next * limit, so that the user will not need to * login again */ if (data-reset_time

Re: sqlcounter returning wrong value?

2008-10-25 Thread liran tal
I've actually tested the sqlcounter for a data counter for both weekly and monthly resets and that doesn't work well either... This is odd because people have reported this working so... it is either something in the configuration that I'm missing or I really don't know what's going on but the

Re: sqlcounter returning wrong value?

2008-10-25 Thread tnt
And they won't. It's nothing to do with the settings - it's this peace of the code. Let's take your example. Limit was 26MB and about 2MB was left. 2,000,000 seconds is about 23 days. So this part of the code will kick in (there are 6 days left in this month) and returned value will be 26MB +

Re: sqlcounter returning wrong value?

2008-10-25 Thread Venkatesh K
I have had hard time using sqlcounter for data. It has (at least had) limitations for counting data like 2GB limit. I ended up writing my own code for counting data. Here is a small patch which will skip adding additional quota if counter-type=time in sqlcounter.conf file.

RE: sqlcounter returning wrong value?

2008-10-24 Thread mulianto
PROTECTED] Behalf Of liran tal Sent: Friday, October 24, 2008 1:07 AM To: FreeRadius users mailing list Subject: sqlcounter returning wrong value? Hey, I'm experimenting with some sqlcounter directives in radiusd.conf and chilli as the NAS. I've defined the following sqlcounter stanza

RE: sqlcounter returning wrong value?

2008-10-24 Thread tnt
http://www.indohotspot.net Your Hotspot solution -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of liran tal Sent: Friday, October 24, 2008 1:07 AM To: FreeRadius users mailing list Subject: sqlcounter returning wrong value? Hey, I'm

Re: sqlcounter returning wrong value?

2008-10-24 Thread liran tal
] [mailto:freeradius-users-bounces+muliantofreeradius-users-bounces%2Bmulianto [EMAIL PROTECTED] Behalf Of liran tal Sent: Friday, October 24, 2008 1:07 AM To: FreeRadius users mailing list Subject: sqlcounter returning wrong value? Hey, I'm experimenting with some sqlcounter

Re: sqlcounter returning wrong value?

2008-10-24 Thread tnt
: sqlcounter returning wrong value? Hey, I'm experimenting with some sqlcounter directives in radiusd.conf and chilli as the NAS. I've defined the following sqlcounter stanza for a daily traffic limit: sqlcounter defined in radiusd.conf: (the query was corrected as suggested

Re: sqlcounter returning wrong value?

2008-10-24 Thread liran tal
: Friday, October 24, 2008 1:07 AM To: FreeRadius users mailing list Subject: sqlcounter returning wrong value? Hey, I'm experimenting with some sqlcounter directives in radiusd.conf and chilli as the NAS. I've defined the following sqlcounter stanza for a daily

sqlcounter returning wrong value?

2008-10-23 Thread liran tal
Hey, I'm experimenting with some sqlcounter directives in radiusd.conf and chilli as the NAS. I've defined the following sqlcounter stanza for a daily traffic limit: sqlcounter defined in radiusd.conf: (the query was corrected as suggested by tnt on a previous thread on the list, correct me if