Menu

#2 http error handling and retry

open
nobody
None
5
2007-06-13
2007-06-12
Smackware
No

I have encountered a situation in which I needed to access my calendar over ssh tunneling.
The connection was really slow and WCAP couldn't load the calendar.

This patch will add a function wrapper (for command(..)) that defaults to retry 5 time before giving up.

The main improvement is that now the code actually checks if there was an HTTP error or not (it used to just assume everything was ok even if response was empty) and acts accordingly.

I find that WCAP causes much less problems with fetching the calendar like that (maybe its just my imagination)

Also, debug output will now include the HTML error returned by the server.

* Patch file tested and source was successfully compiled
Note that the command function was renamed to wcapCommand, and that command is a wrapper function for it.

Discussion

  • Smackware

    Smackware - 2007-06-12
     
  • janua developers

    Logged In: YES
    user_id=1672252
    Originator: NO

    Thanks for the patch, I'll apply it and test it ASAP, if all goes well I'll include it into release 1.1

    Regards

     
  • janua developers

    • status: open --> pending
     
  • janua developers

    Logged In: YES
    user_id=1672252
    Originator: NO

    The patch compiles correctly, however it slows down the process.

    Nonetheless we'll keep it into the release for it is a good idea, I'll check if I can do something to avoid that problem.

    It seems that I also have several SEGV with it (or maybe with some of my code...)

    We'll keep up to date concerning it... corrections are also welcome....

    Rgds

     
  • janua developers

    • status: pending --> open
     
  • Smackware

    Smackware - 2007-06-13

    Logged In: YES
    user_id=1467652
    Originator: YES

    Hi,
    I'm not sure what causes the slowdown,
    but another good idea to go along with this patch would be to decide on which connection->error()'s to retry and which not.
    For instance: when connection->error() == 2, that means that the host is unreachable. That situation renders the retry ability useless, as its probably a routing problem.

     
  • janua developers

    Logged In: YES
    user_id=1672252
    Originator: NO

    Excellent idea, I'll go that direction (when I'll have time for that, obviously...)

    Thx

     

Log in to post a comment.