diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | dillorc | 12 | ||||
-rw-r--r-- | dpid/dpid.c | 9 | ||||
-rw-r--r-- | src/IO/about.c | 6 | ||||
-rw-r--r-- | src/IO/http.c | 10 | ||||
-rw-r--r-- | src/html.cc | 3 | ||||
-rw-r--r-- | src/png.c | 3 | ||||
-rw-r--r-- | src/prefs.c | 3 | ||||
-rw-r--r-- | src/prefs.h | 1 | ||||
-rw-r--r-- | src/prefsparser.cc | 1 | ||||
-rw-r--r-- | src/ui.cc | 17 | ||||
-rw-r--r-- | src/utf8.hh | 3 |
13 files changed, 65 insertions, 17 deletions
@@ -2,7 +2,17 @@ Dillo project ============================================================================= -dillo-2.2 [??, 2010] +dillo-2.2.1 [not released yet] ++- Configurable User-Agent HTTP header. + Patch: Alexander Voigt, corvid ++- Include Accept header in HTTP queries. + - Don't use obsolete png_check_sig(). + - Handle zero-width space. + Patches: corvid + +----------------------------------------------------------------------------- + +dillo-2.2 [Feb 11, 2010] +- Added keybindings for scrolling. - Help button and local help file. diff --git a/configure.in b/configure.in index 0fff3f5e..6703f476 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(src/dillo.cc) dnl Detect the canonical host and target build environment AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(dillo, 2.2-rc2) +AM_INIT_AUTOMAKE(dillo, 2.2) AM_CONFIG_HEADER(config.h) sysconfdir=${sysconfdir}/${PACKAGE} @@ -140,6 +140,18 @@ # path : Send the requested URI's host and path. #http_referer=host +# Set the HTTP User-Agent header. +# This can be useful for privacy and for working around servers who think +# Dillo is less capable than it really is. However, if you pretend to use a +# different browser, servers may send you pages that work with the features +# and bugs of that other browser -- or even disallow access in cases like +# wget or googlebot. Remember this before submitting bug reports. +# +# See http://zytrax.com/tech/web/browser_ids.htm for a compilation of strings. +# +# http_user_agent="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6" +# http_user_agent="Wget/1.11.4" +#The default is Dillo/(current version number) #------------------------------------------------------------------------- # COLORS SECTION diff --git a/dpid/dpid.c b/dpid/dpid.c index b66928ad..246894ae 100644 --- a/dpid/dpid.c +++ b/dpid/dpid.c @@ -100,11 +100,10 @@ void free_services_list(Dlist *s_list) } /*! Signal handler for SIGINT, SIGQUIT, and SIGTERM. Calls cleanup - * \todo what is the most portable way to ignore the signo argument of - * without generating a warning? Is "int signo __unused" gcc specific? */ -static void terminator() +static void terminator(int sig) { + (void) sig; /* suppress unused parameter warning */ cleanup(); _exit(0); } @@ -117,6 +116,7 @@ void est_dpi_terminator() sigset_t block; sigemptyset(&block); + sigaddset(&block, SIGHUP); sigaddset(&block, SIGINT); sigaddset(&block, SIGQUIT); sigaddset(&block, SIGTERM); @@ -125,7 +125,8 @@ void est_dpi_terminator() act.sa_mask = block; act.sa_flags = 0; - if (sigaction(SIGINT, &act, NULL) || + if (sigaction(SIGHUP, &act, NULL) || + sigaction(SIGINT, &act, NULL) || sigaction(SIGQUIT, &act, NULL) || sigaction(SIGTERM, &act, NULL)) { ERRMSG("est_dpi_terminator", "sigaction", errno); diff --git a/src/IO/about.c b/src/IO/about.c index 756b6c69..508bfd11 100644 --- a/src/IO/about.c +++ b/src/IO/about.c @@ -240,7 +240,7 @@ const char *const AboutSplash= "<tr>\n" " <td bgcolor='#CCCCCC'>\n" " <h4>Release overview</h4>\n" -" ??, 2010\n" +" February 11, 2010\n" "<tr>\n" " <td bgcolor='#FFFFFF'>\n" " <table border='0' cellspacing='0' cellpadding='5'>\n" @@ -327,8 +327,8 @@ const char *const AboutSplash= " and the bug meter).\n" " <li> Dillo behaves very nicely when browsing local files, images, and HTML.\n" " It's also very good for Internet searching.\n" -" <li> This release is mainly intended <strong>for developers</strong>\n" -" and <em>advanced users</em>.\n" +" <li> This release is mainly intended for <strong>developers</strong>\n" +" and <strong>advanced users</strong>.\n" " <li> Frames, Java and Javascript are not supported.\n" "</ul>\n" "<br>\n" diff --git a/src/IO/http.c b/src/IO/http.c index 8518a392..1ff7399b 100644 --- a/src/IO/http.c +++ b/src/IO/http.c @@ -305,6 +305,7 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy) query, "POST %s HTTP/1.1\r\n" "Connection: close\r\n" + "Accept: text/*,image/*,*/*;q=0.2\r\n" "Accept-Charset: utf-8,*;q=0.8\r\n" "Accept-Encoding: gzip\r\n" "%s" /* language */ @@ -312,13 +313,13 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy) "Host: %s\r\n" "%s" "%s" - "User-Agent: Dillo/" VERSION "\r\n" + "User-Agent: %s\r\n" "Content-Length: %ld\r\n" "Content-Type: %s\r\n" "%s" /* cookies */ "\r\n", full_path->str, HTTP_Language_hdr, auth ? auth : "", - URL_AUTHORITY(url), proxy_auth->str, referer, + URL_AUTHORITY(url), proxy_auth->str, referer, prefs.http_user_agent, (long)URL_DATA(url)->len, content_type->str, cookies); dStr_append_l(query, URL_DATA(url)->str, URL_DATA(url)->len); @@ -329,6 +330,7 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy) "GET %s HTTP/1.1\r\n" "%s" "Connection: close\r\n" + "Accept: text/*,image/*,*/*;q=0.2\r\n" "Accept-Charset: utf-8,*;q=0.8\r\n" "Accept-Encoding: gzip\r\n" "%s" /* language */ @@ -336,14 +338,14 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy) "Host: %s\r\n" "%s" "%s" - "User-Agent: Dillo/" VERSION "\r\n" + "User-Agent: %s\r\n" "%s" /* cookies */ "\r\n", full_path->str, (URL_FLAGS(url) & URL_E2EQuery) ? "Cache-Control: no-cache\r\nPragma: no-cache\r\n" : "", HTTP_Language_hdr, auth ? auth : "", URL_AUTHORITY(url), - proxy_auth->str, referer, cookies); + proxy_auth->str, referer, prefs.http_user_agent, cookies); } dFree(referer); dFree(cookies); diff --git a/src/html.cc b/src/html.cc index cf3e54d8..21cfe2c4 100644 --- a/src/html.cc +++ b/src/html.cc @@ -1178,6 +1178,8 @@ static void Html_process_word(DilloHtml *html, const char *word, int size) if (isspace(word2[i])) { while (word2[++i] && isspace(word2[i])) ; Html_process_space(html, word2 + start, i - start); + } else if (!strncmp(word2+i, utf8_zero_width_space, 3)) { + i += 3; } else if (a_Utf8_ideographic(word2+i, word2_end, &len)) { i += len; HT2TB(html)->addText(word2 + start, i - start, @@ -1186,6 +1188,7 @@ static void Html_process_word(DilloHtml *html, const char *word, int size) do { i += len; } while (word2[i] && !isspace(word2[i]) && + strncmp(word2+i, utf8_zero_width_space, 3) && (!a_Utf8_ideographic(word2+i, word2_end, &len))); HT2TB(html)->addText(word2 + start, i - start, html->styleEngine->wordStyle ()); @@ -345,8 +345,7 @@ static void Png_write(DilloPng *png, void *Buf, uint_t BufSize) return; /* need MORE data */ } /* check the image signature - DON'T update ipbufstart! */ - if (!png_check_sig(png->ipbuf, DATASIZE)) { - /* you lied to me about it being a PNG image */ + if (png_sig_cmp(png->ipbuf, 0, DATASIZE)) { MSG_WARN("\"%s\" is not a PNG file.\n", URL_STR(png->url)); png->state = IS_finished; break; diff --git a/src/prefs.c b/src/prefs.c index d43e33b9..464c496b 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -22,6 +22,7 @@ #define PREFS_NO_PROXY "localhost 127.0.0.1" #define PREFS_SAVE_DIR "/tmp/" #define PREFS_HTTP_REFERER "host" +#define PREFS_HTTP_USER_AGENT "Dillo/" VERSION /*----------------------------------------------------------------------------- * Global Data @@ -61,6 +62,7 @@ void a_Prefs_init(void) prefs.http_max_conns = 6; prefs.http_proxyuser = NULL; prefs.http_referer = dStrdup(PREFS_HTTP_REFERER); + prefs.http_user_agent = dStrdup(PREFS_HTTP_USER_AGENT); prefs.limit_text_width = FALSE; prefs.load_images=TRUE; prefs.load_stylesheets=TRUE; @@ -109,6 +111,7 @@ void a_Prefs_freeall(void) a_Url_free(prefs.http_proxy); dFree(prefs.http_proxyuser); dFree(prefs.http_referer); + dFree(prefs.http_user_agent); dFree(prefs.no_proxy); dFree(prefs.save_dir); dFree(prefs.search_url); diff --git a/src/prefs.h b/src/prefs.h index d7421f4d..6015f2fe 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -38,6 +38,7 @@ struct _DilloPrefs { DilloUrl *http_proxy; char *http_proxyuser; char *http_referer; + char *http_user_agent; char *no_proxy; DilloUrl *start_page; DilloUrl *home; diff --git a/src/prefsparser.cc b/src/prefsparser.cc index f2cc50ac..d31c835b 100644 --- a/src/prefsparser.cc +++ b/src/prefsparser.cc @@ -67,6 +67,7 @@ int PrefsParser::parseOption(char *name, char *value) { "http_proxy", &prefs.http_proxy, PREFS_URL }, { "http_proxyuser", &prefs.http_proxyuser, PREFS_STRING }, { "http_referer", &prefs.http_referer, PREFS_STRING }, + { "http_user_agent", &prefs.http_user_agent, PREFS_STRING }, { "limit_text_width", &prefs.limit_text_width, PREFS_BOOL }, { "load_images", &prefs.load_images, PREFS_BOOL }, { "load_stylesheets", &prefs.load_stylesheets, PREFS_BOOL }, @@ -850,8 +850,21 @@ int UI::handle(int event) if (prefs.middle_click_drags_page == 0 && event_button() == MiddleButton && !a_UIcmd_pointer_on_link(a_UIcmd_get_bw_by_widget(this))) { - paste_url(); - ret = 1; + if (Main->Rectangle::contains (event_x (), event_y ())) { + /* Offer the event to Main's children (form widgets) */ + int save_x = e_x, save_y = e_y; + + e_x -= Main->x(); + e_y -= Main->y(); + ret = ((Group *)Main)->Group::handle(event); + e_x = save_x; + e_y = save_y; + } + if (!ret) { + /* middle click was not on a link or a form widget */ + paste_url(); + ret = 1; + } } } diff --git a/src/utf8.hh b/src/utf8.hh index fd1fb87e..4ded50b8 100644 --- a/src/utf8.hh +++ b/src/utf8.hh @@ -15,6 +15,9 @@ extern "C" { */ static const char utf8_replacement_char[] = "\xEF\xBF\xBD"; +/* Unicode zero width space U+200B */ +static const char utf8_zero_width_space[] = "\xE2\x80\x8B"; + uint_t a_Utf8_end_of_char(const char *str, uint_t i); uint_t a_Utf8_decode(const char*, const char* end, int* len); int a_Utf8_encode(unsigned int ucs, char *buf); |