altre destinazioni

vedi anche

ultimi post

ultimi commenti

tag principali

categorie

archivi

powered by

  • WPFrontman + WP

friends

copyright

  • © 2004-2011
    Ludovico Magnocavallo
    tutti i diritti riservati

Libevent-based HTTP/1.1 client

28 dicembre 2006

6 commenti

tag

categorie

A snapshot of my toy HTTP/1.1 client built on pyevent. It’s very much incomplete, and probably full of bugs, but it’s a start and it’s damn fast. On my clunky old PIII 1.2 laptop it is able to complete 1k requests of favicon.ico served by lighttpd in less than half a second. The source (updated from time to time as work progresses) is here.

6 commenti

  • Lawrence Oluyede
    29 dicembre 2006 #

    Seems cool :-)

  • ludo
    29 dicembre 2006 #

    1000 GET requests of /favicon.ico against a local lighttpd on a 1.8 PIV laptop

    [0.24470686912536621, 0.23644900321960449, 0.23618698120117188]

  • michael
    10 marzo 2007 #

    This piece of code is great!! Could you please post when you have any improvements?

  • ludo
    10 marzo 2007 #

    Updated, with quite a few bugfixes. There are still a few problems with persistent connections, but non-persistent connections seem to work well. The script is still littered with debug statements. :)

  • george d
    22 marzo 2007 #

    there are some requests timeout, it seems that it's too slow writing the request. When I launch a single request it works, while some servers reset the connection (100, connection reset by peer) when I try to fetch them in a large set of files. I'm trying to fix it, any hints?

  • ludo
    22 marzo 2007 #

    George, I'm rewriting it with a proper test suite. In the meantime, disable persistent connections (eg pass persistent=False to request()).