From 201b0be0c0611e27c4fc4954d6f738a0150ee70f Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 9 Feb 2010 21:53:56 +0100 Subject: suppress unused parameter warning This solution was pointed out by corvid and Jorge. --- dpid/dpid.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dpid/dpid.c b/dpid/dpid.c index b0ca8420..2337d5d6 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); } -- cgit v1.2.3 From 10c1a8017a92f73c0150b177c82f9b772fcfeaf1 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 10 Feb 2010 01:22:33 +0100 Subject: call dpid cleanup handler on SIGHUP Depending on the system dpid can get a SIGHUP on shutdown before it will receive SIGTERM / SIGKILL from init. Make sure we also cleanup in this case so that ~/.dillo/dpid_comm_keys is removed on reboot. --- dpid/dpid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dpid/dpid.c b/dpid/dpid.c index 2337d5d6..fd94d380 100644 --- a/dpid/dpid.c +++ b/dpid/dpid.c @@ -116,6 +116,7 @@ void est_dpi_terminator() sigset_t block; sigemptyset(&block); + sigaddset(&block, SIGHUP); sigaddset(&block, SIGINT); sigaddset(&block, SIGQUIT); sigaddset(&block, SIGTERM); @@ -124,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); -- cgit v1.2.3 From 311d48c24e3349c9410e4c3a0365d02a27fc7176 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 10 Feb 2010 12:22:47 +0100 Subject: prepare rc3 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 0fff3f5e..26eebe9d 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-rc3) AM_CONFIG_HEADER(config.h) sysconfdir=${sysconfdir}/${PACKAGE} -- cgit v1.2.3 -- cgit v1.2.3 From 4422e068282b6186c264cf52fc8b715cd99418fb Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Thu, 11 Feb 2010 11:19:49 +0100 Subject: prepare 2.2 release --- ChangeLog | 2 +- configure.in | 2 +- src/IO/about.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d0a6997..936886f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ Dillo project ============================================================================= -dillo-2.2 [??, 2010] +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 26eebe9d..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-rc3) +AM_INIT_AUTOMAKE(dillo, 2.2) AM_CONFIG_HEADER(config.h) sysconfdir=${sysconfdir}/${PACKAGE} diff --git a/src/IO/about.c b/src/IO/about.c index 756b6c69..44e5a638 100644 --- a/src/IO/about.c +++ b/src/IO/about.c @@ -240,7 +240,7 @@ const char *const AboutSplash= "\n" " \n" "

Release overview

\n" -" ??, 2010\n" +" February 11, 2010\n" "\n" " \n" " \n" -- cgit v1.2.3 -- cgit v1.2.3 From 0ab3ead077237d86b8944fba5fe269435114ca5c Mon Sep 17 00:00:00 2001 From: corvid Date: Thu, 11 Feb 2010 20:11:03 +0000 Subject: allow pasting into form widgets when middle_click_drags_page=NO http://lists.auriga.wearlab.de/pipermail/dillo-dev/2010-February/007281.html --- src/ui.cc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ui.cc b/src/ui.cc index 1561d5ac..fd0639ba 100644 --- a/src/ui.cc +++ b/src/ui.cc @@ -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; + } } } -- cgit v1.2.3 From 41406289c99e0cd17c608ed730b6c75007e9a127 Mon Sep 17 00:00:00 2001 From: "Alexander Voigt, corvid" Date: Thu, 11 Feb 2010 22:17:57 +0000 Subject: add http_user_agent preference thread: http://lists.auriga.wearlab.de/pipermail/dillo-dev/2010-February/007267.html --- ChangeLog | 6 ++++++ dillorc | 12 ++++++++++++ src/IO/http.c | 8 ++++---- src/prefs.c | 3 +++ src/prefs.h | 1 + src/prefsparser.cc | 1 + 6 files changed, 27 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 936886f1..e0b41ab4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,12 @@ Dillo project ============================================================================= +dillo-2.2.1 [not released yet] ++- Configurable User-Agent HTTP header. + Patch: Alexander Voigt, corvid + +----------------------------------------------------------------------------- + dillo-2.2 [Feb 11, 2010] +- Added keybindings for scrolling. diff --git a/dillorc b/dillorc index f7d48bdd..7045c269 100644 --- a/dillorc +++ b/dillorc @@ -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/src/IO/http.c b/src/IO/http.c index 8518a392..67d552c8 100644 --- a/src/IO/http.c +++ b/src/IO/http.c @@ -312,13 +312,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); @@ -336,14 +336,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/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 }, -- cgit v1.2.3 From 9ee77838fa74dcb5628ed428d7b61c909b89124e Mon Sep 17 00:00:00 2001 From: corvid Date: Thu, 11 Feb 2010 22:48:38 +0000 Subject: send Accept header I would be more specific than image/* if servers were more likely to pay attention. The purpose for adding this is to go along with the User-Agent change, since I've seen server code disallow queries that are supposedly from Firefox but have no Accept header. --- ChangeLog | 2 ++ src/IO/http.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index e0b41ab4..0e846755 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ Dillo project dillo-2.2.1 [not released yet] +- Configurable User-Agent HTTP header. Patch: Alexander Voigt, corvid ++- Include Accept header in HTTP queries. + Patch: corvid ----------------------------------------------------------------------------- diff --git a/src/IO/http.c b/src/IO/http.c index 67d552c8..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 */ @@ -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 */ -- cgit v1.2.3 From dfa63edac837b22672bbb309790c2892cb55c53e Mon Sep 17 00:00:00 2001 From: corvid Date: Fri, 12 Feb 2010 23:12:26 +0000 Subject: splash page tiny cosmetic change --- src/IO/about.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IO/about.c b/src/IO/about.c index 44e5a638..508bfd11 100644 --- a/src/IO/about.c +++ b/src/IO/about.c @@ -327,8 +327,8 @@ const char *const AboutSplash= " and the bug meter).\n" "
  • Dillo behaves very nicely when browsing local files, images, and HTML.\n" " It's also very good for Internet searching.\n" -"
  • This release is mainly intended for developers\n" -" and advanced users.\n" +"
  • This release is mainly intended for developers\n" +" and advanced users.\n" "
  • Frames, Java and Javascript are not supported.\n" "\n" "
    \n" -- cgit v1.2.3 From 3dc8ad3068f5e740e78930c79e8fdadc0619d801 Mon Sep 17 00:00:00 2001 From: corvid Date: Sun, 14 Feb 2010 02:21:51 +0000 Subject: use png_sig_cmp() It seems that libpng 1.4 got rid of png_check_sig() (http://www.libpng.org/pub/png/src/libpng-1.2.x-to-1.4.x-summary.txt) The CHANGES doc that came with my libpng says that it was already obsolete by at least January 1999 (v. 1.0.2a). I checked 1.0.0 from March 98, and it has png_sig_cmp. I checked ummm... 0.89c, I think it was (it was from May 96, in any case), and it did not have it yet. I imagine we can ignore pre-1.0 from more than twelve years ago... --- ChangeLog | 3 ++- src/png.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0e846755..13848071 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,8 @@ dillo-2.2.1 [not released yet] +- Configurable User-Agent HTTP header. Patch: Alexander Voigt, corvid +- Include Accept header in HTTP queries. - Patch: corvid + - Don't use obsolete png_check_sig(). + Patches: corvid ----------------------------------------------------------------------------- diff --git a/src/png.c b/src/png.c index 353ebaa3..6a5f4422 100644 --- a/src/png.c +++ b/src/png.c @@ -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; -- cgit v1.2.3 From ceb4a77cb81853fb7e7ca6f3c10f8e625f585496 Mon Sep 17 00:00:00 2001 From: corvid Date: Tue, 16 Feb 2010 03:32:17 +0000 Subject: handle zero-width space. http://lists.auriga.wearlab.de/pipermail/dillo-dev/2009-September/006894.html has the thread. Jorge expressed no opinion. Johannes approved, but wasn't sure that adding zero-width spaces to the page was necessary. I wasn't sure that it was necessary, either, so this version doesn't do that. --- ChangeLog | 1 + src/html.cc | 3 +++ src/utf8.hh | 3 +++ 3 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 13848071..06ce7443 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ dillo-2.2.1 [not released yet] Patch: Alexander Voigt, corvid +- Include Accept header in HTTP queries. - Don't use obsolete png_check_sig(). + - Handle zero-width space. Patches: corvid ----------------------------------------------------------------------------- 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 ()); 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); -- cgit v1.2.3