Changeset 4730 for gaycko


Ignore:
Timestamp:
Feb 1, 2011, 6:07:07 PM (10 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Don't crash on unknow/weird/hippy tags
Location:
gaycko/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • gaycko/trunk/src/dom/dom.c

    r4727 r4730  
    3333        e->attributes      = NULL;
    3434
     35        if(!node->name) {
     36                e->name = strdup("UNKNOW");
     37                e->type = ELEM_UNKNOW;
     38                return e;       
     39        }
     40       
    3541        e->name = (char*)strdup((const char*)node->name);
    36 
    3742        if(!strncmp(e->name, "html", 4)) {
    3843                e->type = ELEM_HTML;
  • gaycko/trunk/src/gaycko.cpp

    r4728 r4730  
    2929        }
    3030
    31         gDOM *dom = gaycko_parse(gaycko_get_data(stream), gaycko_get_size(stream));
     31        char *data = gaycko_get_data(stream);
     32        int   size = gaycko_get_size(stream);
     33
     34        gDOM *dom = gaycko_parse(data, size);
    3235        gaycko_close(stream);
    3336
  • gaycko/trunk/src/io/http.c

    r4719 r4730  
    4444           field, so we provide one */
    4545        curl_easy_setopt(ret->curl_handle, CURLOPT_USERAGENT, "Gaycko/0.1");
     46        curl_easy_setopt(ret->curl_handle, CURLOPT_AUTOREFERER, 1);
     47        curl_easy_setopt(ret->curl_handle, CURLOPT_FOLLOWLOCATION, 1);
     48
    4649
    4750        /* get it! */
Note: See TracChangeset for help on using the changeset viewer.