Rev 4364 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4364 | Rev 5043 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | #include "curl/curl.h" |
33 | #include "curl/curl.h" |
34 | #include "utils/config.h" |
34 | #include "utils/config.h" |
35 | #include "utils/log.h" |
35 | #include "utils/log.h" |
36 | #include "utils/url.h" |
36 | #include "utils/url.h" |
37 | #include "utils/utils.h" |
37 | #include "utils/utils.h" |
- | 38 | #include "content/fetchers/http_msg.h" |
|
- | 39 | #include "content/fetchers/http.h" |
|
- | 40 | ||
Line 38... | Line 41... | ||
38 | 41 | ||
39 | struct url_components_internal { |
42 | struct url_components_internal { |
40 | char *buffer; /* buffer used for all the following data */ |
43 | char *buffer; /* buffer used for all the following data */ |
41 | char *scheme; |
44 | char *scheme; |
Line 785... | Line 788... | ||
785 | */ |
788 | */ |
786 | url_func_result url_unescape(const char *str, char **result) |
789 | url_func_result url_unescape(const char *str, char **result) |
787 | { |
790 | { |
788 | char *curlstr; |
791 | char *curlstr; |
789 | char *retstr; |
792 | char *retstr; |
- | 793 | /* curlstr = curl_unescape(str, 0); */ |
|
- | 794 | LOG(("Address of str is : %x\n", str)); |
|
- | 795 | LOG(("url is %s\n", str)); |
|
- | 796 | ||
- | 797 | LOG(("Calling http_unescape_url in url.c\n")); |
|
- | 798 | curlstr = http_unescape_url(str); |
|
- | 799 | LOG(("http_unescape_url returned.\n")); |
|
- | 800 | __menuet__debug_out("http_unescape_url returned\n"); |
|
Line 790... | Line -... | ||
790 | - | ||
791 | curlstr = curl_unescape(str, 0); |
801 | |
792 | if (curlstr == NULL) { |
802 | if (curlstr == NULL) { |
793 | return URL_FUNC_NOMEM; |
803 | return URL_FUNC_NOMEM; |
- | 804 | } |
|
- | 805 | __menuet__debug_out("Calling strdup in url.c with : "); |
|
- | 806 | __menuet__debug_out(curlstr); |
|
Line 794... | Line 807... | ||
794 | } |
807 | __menuet__debug_out("\n"); |
- | 808 | ||
795 | 809 | retstr = strdup(curlstr); |
|
- | 810 | /* free(curlstr); */ /* Doesn't work because mem not allocated with malloc/calloc/realloc*/ |
|
- | 811 | /* TODO: Use mem_free here*/ |
|
Line 796... | Line 812... | ||
796 | retstr = strdup(curlstr); |
812 | |
- | 813 | __menuet__debug_out("After strdup in url.c\n"); |
|
797 | curl_free(curlstr); |
814 | |
798 | 815 | if (retstr == NULL) { |
|
Line 799... | Line 816... | ||
799 | if (retstr == NULL) { |
816 | __menuet__debug_out("retstr is NULL in url.c\n"); |
- | 817 | return URL_FUNC_NOMEM; |
|
800 | return URL_FUNC_NOMEM; |
818 | } |
- | 819 | ||
801 | } |
820 | *result = retstr; |
Line 802... | Line 821... | ||
802 | 821 | __menuet__debug_out("returning from url_unescape in url.c\n"); |
|
803 | *result = retstr; |
822 | return URL_FUNC_OK; |
804 | return URL_FUNC_OK; |
823 |