HTTP retries and queue delay

Juan Ignacio Germano <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi everyone. I've been testing kannel for a couple of weeks with SMS
and I've found a couple of things I would like to ask about. First, in
smsbox.c, the function obey_request returns 0 if is dealing with a
HTTP request, as stated in the comments:

/*
 * Perform the service requested by the user: translate the request into
 * a pattern, if it is an URL, start its fetch and return 0, otherwise
 * return the string in `*result' and return 1. Return -1 for errors.
  * If we are translating url for ppg dlr, we do not use trans data
  * structure defined for sms services. This is indicated by trans = NULL.
 */
static int obey_request(Octstr **result, URLTranslation *trans, Msg *msg)
{

obey_request is called from obey_request_thread for each sms retrieved
from the smsbox_requests queue, and acknowledge. In the case of HTTP
request, the smss are acknowledged but not immediately processed. This
means bearbox will discard the original sms from its queue, even
though the sms might not have been processed by smsbox. Now, at any
time there could be any number of HTTP requests waiting to being
processed: waiting the response from the HTTP server; or queued to
retry (in the smsbox_http_requests queue). If smsbox is stopped, those
request are lost.
I moved the acknowledge for such cases so it would happen when the sms
have been processed, by having received a HTTP_OK or HTTP_ACCEPTED or
if the retries numbers is greater than max_http_retries. This way the
smss are kept in the sent queue for the connection in bearerbox until
this acknowledge comes, and if the smsbox dies the smss are moved to
incoming for rerouting.
Now, is there a reason for the original behaviour I haven't seen?
Would something break by my change?
Thanks,

--
Juan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.