implementing delay...

From: Andrew Azarov <equand#gmail.com>
Date: Sun, 02 Aug 2009 03:53:56 +0200


Hi,

Is there a way to delay a connection for some time?

I've done a clone of tarpit (with bindings and reqidelay), but it doesn't want to work

if (txn->flags & TX_CLDELAY) {

                /* wipe the request out so that we can drop the 
connection early
                * if the client closes first.
                */
                buffer_write_dis(req); 
                req->analysers |= AN_REQ_HTTP_DELAY;
                req->analyse_exp = tick_add_ifset(now_ms,  
s->be->timeout.delay);
                if (!req->analyse_exp)
                        req->analyse_exp = tick_add(now_ms, 0);
        }
int http_process_delay(struct session *s, struct buffer *req)
{                                                    
        struct http_txn *txn = &s->txn;              
        if ((req->flags & (BF_SHUTR|BF_READ_ERROR)) == 0 &&
            !tick_is_expired(req->analyse_exp, now_ms))
                return 0;
        if (req->flags != BF_READ_ERROR)
                buffer_write_ena(req);         
               return 1;

   return 0;
}
Upon match it doesn't delay, it just waits until 503 error... Seems like I've done it wrong somewhere with buffer_write_dis|ena(req)?

BRG,
Andrew Received on 2009/08/02 03:53

This archive was generated by hypermail 2.2.0 : 2009/08/02 04:00 CEST