Changeset dd672e2


Ignore:
Timestamp:
2012-11-11T21:52:26Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
e132b60
Parents:
2fb1262
Message:

Detect and handle streaming connection loss.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lib/http_client.c

    r2fb1262 rdd672e2  
    302302
    303303eof:
     304        req->flags |= HTTPC_EOF;
     305       
    304306        /* Maybe if the webserver is overloaded, or when there's bad SSL
    305307           support... */
  • lib/http_client.h

    r2fb1262 rdd672e2  
    4141{
    4242        HTTPC_STREAMING = 1,
     43        HTTPC_EOF = 2,
    4344} http_client_flags_t;
    4445
  • protocols/twitter/twitter_lib.c

    r2fb1262 rdd672e2  
    732732{
    733733        struct im_connection *ic = req->data;
     734        struct twitter_data *td;
    734735        json_value *parsed;
    735736        int len = 0;
     
    738739        if (!g_slist_find(twitter_connections, ic))
    739740                return;
     741       
     742        td = ic->proto_data;
     743       
     744        if ((req->flags & HTTPC_EOF) || !req->reply_body) {
     745                td->stream = NULL;
     746                imcb_error(ic, "Stream closed (%s)", req->status_string);
     747                imc_logout(ic, TRUE);
     748                return;
     749        }
    740750       
    741751        printf( "%d bytes in stream\n", req->body_size );
Note: See TracChangeset for help on using the changeset viewer.