Re: [elinks-dev] [PATCH 1/2] Respect alphabetical order for the actions

2013-12-18 Thread Witold Filipczyk
Sorry, I aplied patch1 before patch0.
Could you prepare new patch with correct order of functions?
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] [PATCH] configure.in: add a missing AC_LANG_PROGRAM macro

2013-09-18 Thread Witold Filipczyk
W dniu 18.09.2013 o 12:48 Kamil Dudka kdu...@redhat.com pisze:

 On Monday 25 February 2013 15:45:32 Kamil Dudka wrote:
 ... around the first argument of AC_COMPILE_IFELSE in order to eliminate
 warnings with autoconf 2.68.
 ---
  configure.in |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

 diff --git a/configure.in b/configure.in
 index 023af06..9d992ee 100644
 --- a/configure.in
 +++ b/configure.in
 @@ -221,7 +221,7 @@ AC_STRUCT_TM
  AC_C_CONST
  AC_C_INLINE
  AC_MSG_CHECKING([[for C99-conforming inline]])
 -AC_COMPILE_IFELSE([[
 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  int add(int change);

  static int sum;
 @@ -237,7 +237,7 @@ AC_COMPILE_IFELSE([[
  sub(int change)
  {
  return add(-change);
 -}]],
 +}]])],
  [AC_MSG_RESULT([[yes]])
   AC_DEFINE([NONSTATIC_INLINE], [inline],
  [Define as inline if the compiler lets you declare a function 
 without
  inline, then define it with inline, and have that definition refer to
  identifiers with internal linkage.  This is allowed by C99 6.7.4p6 and
  6.7.4p3 together.  Otherwise define as nothing.])],

 The above patch still applies.  Any chance to get this in?  Thanks in  
 advance!

Added to the master branch. Thanks!
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] [PATCH 2/2] Add support for the CSS list-style-type property

2013-09-07 Thread Witold Filipczyk
W dniu 05.09.2013 o 16:25 Fabienne Ducroquet fabi...@gmail.com:

 Just a reminder in case one of the developers has the time to have
 a look at these patches.

Both patches committed to 0.13. Thank you!
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] [PATCH] More Chinese charsets

2013-01-20 Thread Witold Filipczyk
W dniu 20.01.2013 o 06:31 Techlive Zheng techlivezh...@gmail.com pisze:

 ---

 Elinks currently only support GB2312 as Chinese encoding, but GBK and
 GB18030 are also widely used. Codepage CP936 is amlost identical to
 GBK, so I add it as an aliase.

  src/intl/codepage.inc | 27 ++-
  1 file changed, 26 insertions(+), 1 deletion(-)

 diff --git a/src/intl/codepage.inc b/src/intl/codepage.inc
 index 6fe368a..dfc6378 100644
 --- a/src/intl/codepage.inc
 +++ b/src/intl/codepage.inc
 @@ -4935,11 +4935,34 @@ unsigned char *const aliases_euc_tw [] = {
   NULL
  };
 +/*** GBK ***/
 +
 +unsigned char *const aliases_gbk [] = {
 + gbk,
 + 936,
 + cp936,
 + windows936,
 + windows-936,
 + NULL
 +};
 +
  /*** GB2312 ***/
 unsigned char *const aliases_gb2312 [] = {
   gb2312,
   gb-2312,
 + gb_2312,
 + gb 2312,
 + NULL
 +};
 +
 +/*** GB18030 ***/
 +
 +unsigned char *const aliases_gb18030 [] = {
 + gb18030,
 + gb-18030,
 + gb_18030,
 + gb 18030,
   NULL
  };
 @@ -5021,9 +5044,11 @@ const struct codepage_desc codepages [] = {
   {EUC-JP, aliases_euc_jp, highhalf_NULL, table_NULL, 1},
   {EUC-KR, aliases_euc_kr, highhalf_NULL, table_NULL, 1},
   {EUC-TW, aliases_euc_tw, highhalf_NULL, table_NULL, 1},
 + {GBK, aliases_gbk, highhalf_NULL, table_NULL, 1},
   {GB2312, aliases_gb2312, highhalf_NULL, table_NULL, 1},
 + {GB18030, aliases_gb18030, highhalf_NULL, table_NULL, 1},
   {ISO-2022-JP, aliases_iso2022jp, highhalf_NULL, table_NULL, 1},
   {NULL, NULL, NULL, 0}
  };
 -#define N_CODEPAGES 43
 +#define N_CODEPAGES 45

Thanks, applied to 0.13.
For 0.12 someone, who knows git will apply it.
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] [PATCH] Fix double-free crash if EOF immediately follows /MAP.

2008-12-30 Thread Witold Filipczyk
On Mon, Dec 29, 2008 at 09:49:52PM +0200, Kalle Olavi Niemitalo wrote:
 look_for_link() used to return 0 both when it found the closing /MAP
 tag, and when it hit the end of the file.  In the first case, it also
 added *menu to the memory_list; in the second case, it did not.  The
 caller get_image_map() supposedly distinguished between these cases by
 checking whether pos = eof, and freed *menu separately if so.
 
 However, if the /MAP was at the very end of the HTML file, so that
 not even a newline followed it, then look_for_link() left pos == eof
 even though it had found the /MAP and added *menu to the memory_list.
 This made get_image_map() misinterpret the result and mem_free(*menu)
 even though *menu had already been freed as part of the memory_list;
 thus the crash.
 
 To fix this, make look_for_link() return -1 instead of 0 if it hits
 EOF without finding the /MAP.  Then make get_image_map() check the
 return value instead of comparing pos to eof.
 
 Alternatively, look_for_link() could have been changed to decrement
 pos between finding the /MAP and returning 0.  Then, the pos = eof
 comparison in get_image_map() would have been false.  That scheme
 would however have been a bit more difficult to understand and
 maintain, I think.

Memory leak by 1 bytes
List of blocks:
0xa287e58:1 @ alloc'd at link.c:973

Forcing core dump! Man the Lifeboats! Women and children first!

But please DO NOT report this as a segfault!!! It is an internal error, not a
normal segfault, there is a huge difference in these for us the developers.
Also, noting the EXACT error you got above is crucial for hunting the problem
down. Thanks, and please get in touch with us.
ELinks 0.13.GIT b9b2b75f73ee8bb9ab361d22d3ba3579185cdfea-dirty

This happens on the original file doom1.htm.
Select the last USEMAP, press ESC and quit.

Witek
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] Scrolling bittorrent items

2008-08-31 Thread Witold Filipczyk
Some dialog boxes dont fit on the screen.
Here are 3 concatenated patches, which fixes that issue.
When a dialog is displayed on the screen for the first
time the bottom of it is shown.
Later one can scroll using UP and DOWN keys.

Witek
commit 0f02ab5501c976c1d9b9f42894f936a403773c58
Author: Witold Filipczyk [EMAIL PROTECTED]
Date:   Sun Aug 31 18:56:23 2008 +0200

Added draw_text2 functions and others.

draw2_text checks whether text of dialogs fit on the screen.
At the start the bottom part of the dialogs is shown.
Scrolling works with bittorrent. I did not check listbox.

diff --git a/src/bfu/button.c b/src/bfu/button.c
index 0915b81..b5b0c66 100644
--- a/src/bfu/button.c
+++ b/src/bfu/button.c
@@ -212,7 +212,7 @@ display_button(struct dialog_data *dlg_data, struct 
widget_data *widget_data)
}
 
 
-   draw_text(term, pos-x, pos-y, BUTTON_LEFT, BUTTON_LEFT_LEN, 0, color);
+   draw_text2(term, dlg_data, pos-x, pos-y, BUTTON_LEFT, 
BUTTON_LEFT_LEN, 0, color);
if (len  0) {
unsigned char *text = widget_data-widget-text;
int hk_pos = widget_data-widget-info.button.hotkey_pos;
@@ -237,15 +237,15 @@ display_button(struct dialog_data *dlg_data, struct 
widget_data *widget_data)
NULL);
 
if (hk_pos)
-   draw_text(term, x, pos-y,
+   draw_text2(term, dlg_data, x, pos-y,
  text, hk_pos, 0, color);
 
-   draw_text(term, x + cells_to_hk, pos-y,
+   draw_text2(term, dlg_data, x + cells_to_hk, 
pos-y,
  text[hk_pos + 1], hk_bytes,
  attr, shortcut_color);
 
if (right  1)
-   draw_text(term, x+cells_to_hk+hk_cells,
+   draw_text2(term, dlg_data, 
x+cells_to_hk+hk_cells,
  pos-y,
  text[hk_pos + hk_bytes + 1],
  right - 1, 0, color);
@@ -258,11 +258,11 @@ display_button(struct dialog_data *dlg_data, struct 
widget_data *widget_data)
 len - hk_width,
 NULL);
 
-   draw_text(term, x, pos-y,
+   draw_text2(term, dlg_data, x, pos-y,
  text, hk_len,
  attr, shortcut_color);
 
-   draw_text(term, x + hk_width, pos-y,
+   draw_text2(term, dlg_data, x + hk_width, pos-y,
  text[hk_len], len_to_display,
  0, color);
}
@@ -272,18 +272,18 @@ display_button(struct dialog_data *dlg_data, struct 
widget_data *widget_data)
int right = 
widget_data-widget-info.button.truetextlen - hk_pos - 1;
 
if (hk_pos) {
-   draw_text(term, x, pos-y, text, hk_pos, 0, 
color);
+   draw_text2(term, dlg_data, x, pos-y, text, 
hk_pos, 0, color);
}
-   draw_text(term, x + hk_pos, pos-y,
+   draw_text2(term, dlg_data, x + hk_pos, pos-y,
  text[hk_pos + 1], 1, attr, shortcut_color);
if (right  1) {
-   draw_text(term, x + hk_pos + 1, pos-y,
+   draw_text2(term, dlg_data, x + hk_pos + 1, 
pos-y,
  text[hk_pos + 2], right - 1, 0, 
color);
}
 
} else {
-   draw_text(term, x, pos-y, text, 1, attr, 
shortcut_color);
-   draw_text(term, x + 1, pos-y, text[1], len - 1, 0, 
color);
+   draw_text2(term, dlg_data, x, pos-y, text, 1, attr, 
shortcut_color);
+   draw_text2(term, dlg_data, x + 1, pos-y, text[1], len 
- 1, 0, color);
}
}
 #ifdef CONFIG_UTF8
@@ -291,15 +291,15 @@ display_button(struct dialog_data *dlg_data, struct 
widget_data *widget_data)
int text_cells = utf8_ptr2cells(widget_data-widget-text, 
NULL);
int hk = (widget_data-widget-info.button.hotkey_pos = 0);
 
-   draw_text(term, x + text_cells - hk, pos-y,
+   draw_text2(term, dlg_data, x + text_cells - hk, pos-y,
  BUTTON_RIGHT, BUTTON_RIGHT_LEN, 0, color);
} else
 #endif /* CONFIG_UTF8

Re: [elinks-dev] Errors in bittorent

2008-08-30 Thread Witold Filipczyk
On Fri, Aug 29, 2008 at 10:38:20PM +0200, Witold Filipczyk wrote:
 Hi,
 I noticed a bug in the bittorent protocol code while trying to get an ISO from
 http://torrents.gentoo.org/.
 
 Here is a fix for it.
 1) Before the uri was put on the stack and the access that uri later
 may trash the stack.
 2) done_uri expects that uri-string is not NULL, so uri-string points to .
 

That patch wasn't good. I attached the second one.

Witek
commit b589f19b73c65621c0a8582199509f58dbcac09f
Author: Witold Filipczyk [EMAIL PROTECTED]
AuthorDate: Sat Aug 30 10:52:00 2008 +0200
Commit: Witold Filipczyk [EMAIL PROTECTED]
CommitDate: Sat Aug 30 10:52:00 2008 +0200

An issue with bittorrent.

It was possible that the reference to the automatic variable
uri of the make_bittorrent_peer_connection trashed the stack.
In addition done_uri crashed because uri-string was NULL.

Now uri is allocated and unlocked to avoid memleak.

diff --git a/src/protocol/bittorrent/peerconnect.c 
b/src/protocol/bittorrent/peerconnect.c
index aeafbf3..5f65e68 100644
--- a/src/protocol/bittorrent/peerconnect.c
+++ b/src/protocol/bittorrent/peerconnect.c
@@ -20,6 +20,7 @@
 #include elinks.h
 
 #include config/options.h
+#include main/object.h
 #include main/select.h
 #include main/timer.h
 #include network/connection.h
@@ -271,9 +272,12 @@ enum bittorrent_state
 make_bittorrent_peer_connection(struct bittorrent_connection *bittorrent,
struct bittorrent_peer *peer_info)
 {
-   struct uri uri;
+   struct string uri_string;
+   struct uri *uri;
struct bittorrent_peer_connection *peer;
-   unsigned char port[5];
+   unsigned char port[6];
+   int ip_start, port_start;
+   int port_length;
 
peer = init_bittorrent_peer_connection(-1);
if (!peer) return BITTORRENT_STATE_OUT_OF_MEM;
@@ -296,14 +300,32 @@ make_bittorrent_peer_connection(struct 
bittorrent_connection *bittorrent,
/* FIXME: Rather change the make_connection() interface. This is an ugly
 * hack. */
/* FIXME: Set the ipv6 flag iff ... */
-   memset(uri, 0, sizeof(uri));
-   uri.protocol = PROTOCOL_BITTORRENT;
-   uri.host = peer_info-ip;
-   uri.hostlen  = strlen(peer_info-ip);
-   uri.port = port;
-   uri.portlen  = snprintf(port, sizeof(port), %u, peer_info-port);
-
-   make_connection(peer-socket, uri, send_bittorrent_peer_handshake, 1);
+   if (!init_string(uri_string)) {
+   done_bittorrent_peer_connection(peer);
+   return BITTORRENT_STATE_OUT_OF_MEM;
+   }
+   add_to_string(uri_string, bittorrent:);
+   ip_start = uri_string.length;
+   add_to_string(uri_string, peer_info-ip);
+   add_char_to_string(uri_string, ':');
+   port_start = uri_string.length;
+
+   port_length = snprintf(port, sizeof(port), %u, peer_info-port);
+   add_bytes_to_string(uri_string, port, port_length);
+   uri = get_uri(uri_string.source, URI_BASE);
+   done_string(uri_string);
+   if (!uri) {
+   done_bittorrent_peer_connection(peer);
+   return BITTORRENT_STATE_OUT_OF_MEM;
+   }
+
+   uri-host = uri-string + ip_start;
+   uri-hostlen = port_start - ip_start - 1;
+   uri-port = uri-string + port_start;
+   uri-portlen = port_length;
+   /* Do not lock it. */
+   object_unlock(uri);
+   make_connection(peer-socket, uri, send_bittorrent_peer_handshake, 1);
 
return BITTORRENT_STATE_OK;
 }
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Errors in bittorent

2008-08-30 Thread Witold Filipczyk
On Sat, Aug 30, 2008 at 12:24:40PM +0200, Jonas Fonseca wrote:
 Some comments ...
 
 Witold Filipczyk [EMAIL PROTECTED] wrote Sat, Aug 30, 2008:
  commit b589f19b73c65621c0a8582199509f58dbcac09f
  Author: Witold Filipczyk [EMAIL PROTECTED]
  AuthorDate: Sat Aug 30 10:52:00 2008 +0200
  Commit: Witold Filipczyk [EMAIL PROTECTED]
  CommitDate: Sat Aug 30 10:52:00 2008 +0200
  
  An issue with bittorrent.
  
  It was possible that the reference to the automatic variable
  uri of the make_bittorrent_peer_connection trashed the stack.
  In addition done_uri crashed because uri-string was NULL.
  
  Now uri is allocated and unlocked to avoid memleak.
 
 
 Instead of fixing this hack, why don't you add a setup_connection() that
 make_connection() can use as a wrapper and be done with this. Or if this
 is bittorrent URI thing actually works, why do you mess with the URI struct
 yourself? Didn't parse_uri() do all that for you already? Also don't
 unluck the URI, call done_uri(uri) after the call to make_connection().

It is not so easy, because bittorrent in ELinks uses free syntax.
I'm cheating a bit here and using http instead of bittorrent.

diff --git a/src/protocol/bittorrent/peerconnect.c 
b/src/protocol/bittorrent/peerconnect.c
index aeafbf3..7a89523 100644
--- a/src/protocol/bittorrent/peerconnect.c
+++ b/src/protocol/bittorrent/peerconnect.c
@@ -271,9 +271,11 @@ enum bittorrent_state
 make_bittorrent_peer_connection(struct bittorrent_connection *bittorrent,
struct bittorrent_peer *peer_info)
 {
-   struct uri uri;
+   struct string uri_string;
+   struct uri *uri;
struct bittorrent_peer_connection *peer;
-   unsigned char port[5];
+   unsigned char port[6];
+   int port_length;
 
peer = init_bittorrent_peer_connection(-1);
if (!peer) return BITTORRENT_STATE_OUT_OF_MEM;
@@ -296,14 +298,27 @@ make_bittorrent_peer_connection(struct 
bittorrent_connection *bittorrent,
/* FIXME: Rather change the make_connection() interface. This is an ugly
 * hack. */
/* FIXME: Set the ipv6 flag iff ... */
-   memset(uri, 0, sizeof(uri));
-   uri.protocol = PROTOCOL_BITTORRENT;
-   uri.host = peer_info-ip;
-   uri.hostlen  = strlen(peer_info-ip);
-   uri.port = port;
-   uri.portlen  = snprintf(port, sizeof(port), %u, peer_info-port);
-
-   make_connection(peer-socket, uri, send_bittorrent_peer_handshake, 1);
+   if (!init_string(uri_string)) {
+   done_bittorrent_peer_connection(peer);
+   return BITTORRENT_STATE_OUT_OF_MEM;
+   }
+   /* The bittorrent protocol uses free syntax.
+* It does not set uri-port nor uri-host */
+   add_to_string(uri_string, http://;);
+   add_to_string(uri_string, peer_info-ip);
+   add_char_to_string(uri_string, ':');
+   port_length = snprintf(port, sizeof(port), %u, peer_info-port);
+   add_bytes_to_string(uri_string, port, port_length);
+
+   uri = get_uri(uri_string.source, URI_BASE);
+   done_string(uri_string);
+   if (!uri) {
+   done_bittorrent_peer_connection(peer);
+   return BITTORRENT_STATE_OUT_OF_MEM;
+   }
+   uri-protocol = PROTOCOL_BITTORRENT;
+   make_connection(peer-socket, uri, send_bittorrent_peer_handshake, 1);
+   done_uri(uri);
 
return BITTORRENT_STATE_OK;
 }
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] Errors in bittorent

2008-08-29 Thread Witold Filipczyk
Hi,
I noticed a bug in the bittorent protocol code while trying to get an ISO from
http://torrents.gentoo.org/.

Here is a fix for it.
1) Before the uri was put on the stack and the access that uri later
may trash the stack.
2) done_uri expects that uri-string is not NULL, so uri-string points to .

Witek

diff --git a/src/protocol/bittorrent/peerconnect.c 
b/src/protocol/bittorrent/peerconnect.c
index aeafbf3..3ac5baa 100644
--- a/src/protocol/bittorrent/peerconnect.c
+++ b/src/protocol/bittorrent/peerconnect.c
@@ -271,7 +271,7 @@ enum bittorrent_state
 make_bittorrent_peer_connection(struct bittorrent_connection *bittorrent,
struct bittorrent_peer *peer_info)
 {
-   struct uri uri;
+   struct uri *uri;
struct bittorrent_peer_connection *peer;
unsigned char port[5];
 
@@ -296,14 +296,15 @@ make_bittorrent_peer_connection(struct 
bittorrent_connection *bittorrent,
/* FIXME: Rather change the make_connection() interface. This is an ugly
 * hack. */
/* FIXME: Set the ipv6 flag iff ... */
-   memset(uri, 0, sizeof(uri));
-   uri.protocol = PROTOCOL_BITTORRENT;
-   uri.host = peer_info-ip;
-   uri.hostlen  = strlen(peer_info-ip);
-   uri.port = port;
-   uri.portlen  = snprintf(port, sizeof(port), %u, peer_info-port);
-
-   make_connection(peer-socket, uri, send_bittorrent_peer_handshake, 1);
+   uri = mem_calloc(1, sizeof(*uri));
+   uri-protocol = PROTOCOL_BITTORRENT;
+   uri-host = peer_info-ip;
+   uri-hostlen  = strlen(peer_info-ip);
+   uri-port = port;
+   uri-portlen  = snprintf(port, sizeof(port), %u, peer_info-port);
+   uri-string = ;
+
+   make_connection(peer-socket, uri, send_bittorrent_peer_handshake, 1);
 
return BITTORRENT_STATE_OK;
 }
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] proposed ELinks 0.12pre1 release announcement

2008-06-30 Thread Witold Filipczyk
 
 Looking back
 
 
 Of the three features hinted at in the ELinks 0.11.0 release
 announcement, Witold's improved UTF-8 support has become the main
 point of ELinks 0.12.  Miciah has extended the ECMAScript scripting

UTF-8 support was initialised by me, but the rest did Pavol Babincak
AFAIR.

-- 
Witek

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] Monthly snapshots

2008-06-18 Thread Witold Filipczyk
Me and probably not only me want to package the ELinks-0.12 or even 0.13.
If you do not want to release often, create at least monthly (or quoterly)
snapshots, eg. elinks-0.13-080630.tar.bz2 and save them on the download
site. Mark them as experimental. I think that many users are waiting
for new releases, such snapshots would be helpful for packagers.

I hope that I'm not the only one.

-- 
Witek
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Big files upload

2008-05-19 Thread Witold Filipczyk
On Mon, May 19, 2008 at 08:30:15AM +0300, Kalle Olavi Niemitalo wrote:
 Kalle Olavi Niemitalo [EMAIL PROTECTED] writes:
 
  Witold Filipczyk [EMAIL PROTECTED] writes:
 
  On Mon, May 12, 2008 at 12:14:52AM +0300, Kalle Olavi Niemitalo wrote:
  - The code is duplicated between src/protocol/file/cgi.c and
src/protocol/http/http.c.  This may be the best way but it
looks a bit annoying.
 
  I have no idea how to make it better.
 
  How about the following?  I did not test this yet.
 
 I tested file and bigtextarea POSTs with CGI, and a file upload
 at http://validator.w3.org/.
 There was a bug in http_read_post_data_inline().
 I amended the commit to fix that, and pushed.
 
 uri-post can begin with a Content-Type string and '\n'.
 http_send_header() in http.c and send_post_data() in cgi.c check
 whether this is the case.  It seems theoretically possible that
 in a POST without a Content-Type, a file name could contain '\n'
 and confuse this check.  Likewise, if a file name contains
 FILE_CHAR, it will confuse http_read_post_data_inline().  To fix
 those, I think we should either change encode_multipart() to fail
 if a file name contains one of those characters, or change the
 format of uri-post so that it can be unambiguously parsed.  I'd
 prefer changing the format because then we could also put the
 lengths of the files there and check that they match.

I doubt that one can enter the filename with a newline into the input field.

 upload_stat_timer() in src/network/connection.c assumes that
 conn-info is struct http_connection_info * whenever
 conn-upload_progress != NULL.  We could document this at the
 definition of connection.upload_progress but I think it would be
 nicer to move the upload counters into struct connection so that
 non-HTTP protocols can show upload progress too.  Just remember
 to clear the counters if the connection is reused.
 
 The progress counters should be off_t rather than size_t so that
 they can support 4GiB files on 32-bit systems.  (Or perhaps even
 longlong because off_t can be 32-bit and multiple files may be
 uploaded in one request.  That would require larger changes
 though.)

Do whatever you want. The condition is that it must work.
-- 
Witek
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Textarea doesn't get refreshed when the page is refreshed.

2007-08-30 Thread Witold Filipczyk
On Thu, Aug 30, 2007 at 10:30:55AM +0530, Ligesh wrote:
 
  Hi,
 
   Elinks behaviour when I am trying to edit a page can cause some real 
 headaches. It happens when you are trying to edit an already edited page. 
 Even if you refresh, the text area will contain the older contents and if you 
 edit the second time, the changes you made during the first edit are lost, 
 and it gets horribly confusing too.
 
   I would like to know if this can be fixed. Reproduce it like this:
 
  a) Go to a an editable page, and click on edit.
 
  b) Make some changes and save. You will be redirected to the display page 
 again.
 
  c) Come back to the edit page and refresh.
 
  e) Expected result: The refreshed page should contain the new text.
 
  f) Actual result: The text area contains the older contents--the one before 
 you made the edit.
 
  You can workaround this by, simply going back, and coming to the page again 
 after you have refreshed the page. But that's not an ideal solution.
 
  Thanks a lot.

Try this patch.
Forget forms when reloading (bug 620 ?).

---
commit 2d69e2e625bb4e673e95bc7eb7b1d8744c4f9a87
tree 9438cfe5923b1ffca02a814356c6c1045b72b2f0
parent 940196b131f13537b84e807b14481280bf5b72f1
author Witold Filipczyk [EMAIL PROTECTED] Thu, 30 Aug 2007 19:36:48 +0200
committer Witold Filipczyk [EMAIL PROTECTED] Thu, 30 Aug 2007 19:36:48 +0200

 src/session/session.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/session/session.c b/src/session/session.c
index e82141c..ae9f350 100644
--- a/src/session/session.c
+++ b/src/session/session.c
@@ -1198,11 +1198,17 @@ reload(struct session *ses, enum cache_mode cache_mode)
if (have_location(ses)) {
struct location *loc = cur_loc(ses);
struct file_to_load *ftl;
+   int i;
 
 #ifdef CONFIG_ECMASCRIPT
loc-vs.ecmascript_fragile = 1;
 #endif
-
+   /* Forget forms. */
+   for (i = 0; i  loc-vs.form_info_len; i++)
+   mem_free_if(loc-vs.form_info[i].value);
+   mem_free_set(loc-vs.form_info, NULL);
+   loc-vs.form_info_len = 0;
+   free_list(loc-vs.forms);
/* FIXME: When reloading use loading_callback and set up a
 * session task so that the reloading will work even when the
 * reloaded document contains redirects. This is needed atleast
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Sponsor development of the key motion.

2007-08-14 Thread Witold Filipczyk
Here is the patch.
Kalle, Jonas, could apply them (key motion patches) to the mainstream ELinks?
move-link-down-line, move-link-prev-line, etc.:
Change mode to NAVIGATE_LINKWISE to preserve the link position when
going back.

---
commit 14b37d0362f9963cb2803d08d2c3e6e84574cdbe
tree 062545598ae45bf519f7e825b0302542061bbf34
parent 2045574edca170a47b1e9f1e05cd210bdae8a49a
author Witold Filipczyk [EMAIL PROTECTED] Tue, 14 Aug 2007 19:56:02 +0200
committer Witold Filipczyk [EMAIL PROTECTED] Tue, 14 Aug 2007 19:56:02 +0200

 src/viewer/text/view.c |   25 -
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c
index 887f301..a0ebefa 100644
--- a/src/viewer/text/view.c
+++ b/src/viewer/text/view.c
@@ -201,8 +201,13 @@ move_link_prev_line(struct session *ses, struct 
document_view *doc_view)
if (!last) last = link;
else if (link-points[0].x  last-points[0].x) last = 
link;
}
-   if (last)
-   return move_cursor_rel(ses, doc_view, last-points[0].x 
- x1, last-points[0].y - y1);
+   if (last) {
+   enum frame_event_status status = move_cursor_rel(ses, 
doc_view,
+   last-points[0].x - x1, last-points[0].y - y1);
+
+   ses-navigate_mode = NAVIGATE_LINKWISE;
+   return status;
+   }
}
return FRAME_EVENT_OK;
 }
@@ -245,8 +250,13 @@ move_link_next_line(struct session *ses, struct 
document_view *doc_view)
if (!last) last = link;
else if (link-points[0].x  last-points[0].x) last = 
link;
}
-   if (last)
-   return move_cursor_rel(ses, doc_view, last-points[0].x 
- x1, last-points[0].y - y1);
+   if (last) {
+   enum frame_event_status status = move_cursor_rel(ses, 
doc_view,
+   last-points[0].x - x1, last-points[0].y - y1);
+
+   ses-navigate_mode = NAVIGATE_LINKWISE;
+   return status;
+   }
}
return FRAME_EVENT_OK;
 }
@@ -708,7 +718,12 @@ move_link_vertical(struct session *ses, struct 
document_view *doc_view, int dir_
if (!link) continue;
for (; link = document-lines2[y]; link++) {
if (link-points[0].y == y) {
-   return move_cursor_rel(ses, doc_view, 0, y - 
y1);
+   enum frame_event_status status = 
move_cursor_rel(ses,
+   doc_view, 0, y - y1);
+
+   if (vs-current_link != -1)
+   ses-navigate_mode = NAVIGATE_LINKWISE;
+   return status;
}
}
}
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Sponsor development of the key motion.

2007-08-12 Thread Witold Filipczyk
On Sun, Aug 12, 2007 at 07:35:37AM +0530, Ligesh wrote:
  Thanks for the patch. Works great. I have a new problem though. I updated my 
 elinks from the git and now the alt-keys does not work. If I run my old 
 elinks, all the alt-key commands work fine, but not with the new one. Also, 
 please send me your paypal billing at myself at ligesh.com. 
 
  Can you also implement a key to take the cursor to the start of line. Like 
 you have in VIM with '0'. Press 0 and the cursor moves to the start of line. 
 DOes this already exist in Elinks?

It doesn't work well with frames.
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Sponsor development of the key motion.

2007-08-12 Thread Witold Filipczyk
Here is second patch, which fixes moving in frames.
-- 
Witek
actions: Fixed moving in frames.

---
commit a68c563198afd22cf293b0c754ef1e5b73e8e9cc
tree 52fd6c553ae0c355829131b32059d80784892170
parent 7882384bce49ab8d09e4c6d7a4b7b0eb0c945797
author Witold Filipczyk [EMAIL PROTECTED] Sun, 12 Aug 2007 10:34:00 +0200
committer Witold Filipczyk [EMAIL PROTECTED] Sun, 12 Aug 2007 10:34:00 +0200

 src/viewer/text/view.c |   19 +++
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/viewer/text/view.c b/src/viewer/text/view.c
index c985c5d..887f301 100644
--- a/src/viewer/text/view.c
+++ b/src/viewer/text/view.c
@@ -169,6 +169,7 @@ move_link_prev_line(struct session *ses, struct 
document_view *doc_view)
 {
struct view_state *vs;
struct document *document;
+   struct box *box;
struct link *link, *last = NULL;
int y1, y, min_x, max_x, x1;
 
@@ -178,10 +179,10 @@ move_link_prev_line(struct session *ses, struct 
document_view *doc_view)
vs = doc_view-vs;
document = doc_view-document;
if (!document-lines1) return FRAME_EVENT_OK;
+   box = doc_view-box;
 
-   y = y1 = vs-y + ses-tab-y - ses-status.show_title_bar
-   - (ses-status.show_tabs_bar  
ses-status.show_tabs_bar_at_top);
-   x1 = vs-x + ses-tab-x;
+   y = y1 = vs-y + ses-tab-y - box-y;
+   x1 = vs-x + ses-tab-x - box-x;
 
link = get_current_link(doc_view);
if (link) {
@@ -212,6 +213,7 @@ move_link_next_line(struct session *ses, struct 
document_view *doc_view)
 {
struct view_state *vs;
struct document *document;
+   struct box *box;
struct link *link, *last = NULL;
int y1, y, min_x, max_x, x1;
 
@@ -221,10 +223,10 @@ move_link_next_line(struct session *ses, struct 
document_view *doc_view)
vs = doc_view-vs;
document = doc_view-document;
if (!document-lines1) return FRAME_EVENT_OK;
+   box = doc_view-box;
 
-   y = y1 = vs-y + ses-tab-y - ses-status.show_title_bar
-   - (ses-status.show_tabs_bar  
ses-status.show_tabs_bar_at_top);
-   x1 = vs-x + ses-tab-x;
+   y = y1 = vs-y + ses-tab-y - box-y;
+   x1 = vs-x + ses-tab-x - box-x;
 
link = get_current_link(doc_view);
if (link) {
@@ -684,6 +686,7 @@ move_link_vertical(struct session *ses, struct 
document_view *doc_view, int dir_
 {
struct document *document;
struct view_state *vs;
+   struct box *box;
int y, y1;
 
assert(ses  doc_view  doc_view-vs  doc_view-document);
@@ -692,8 +695,8 @@ move_link_vertical(struct session *ses, struct 
document_view *doc_view, int dir_
document = doc_view-document;
if (!document-lines1) return FRAME_EVENT_OK;
 
-   y1 = vs-y + ses-tab-y - ses-status.show_status_bar
-   - (ses-status.show_tabs_bar  
ses-status.show_tabs_bar_at_top);
+   box = doc_view-box;
+   y1 = vs-y + ses-tab-y - box-y;
y = y1 + dir_y;
if (dir_y  0)
int_upper_bound(y, document-height - 1);
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Sponsor development of the key motion.

2007-08-10 Thread Witold Filipczyk
Use this patch:
diff --git a/src/document/renderer.c b/src/document/renderer.c
index 90fcc80..8b80d73 100644
--- a/src/document/renderer.c
+++ b/src/document/renderer.c
@@ -499,6 +499,7 @@ render_document_frames(struct session *ses, int no_cache)
}
 }
 
+#if 0
 static int
 comp_links(struct link *l1, struct link *l2)
 {
@@ -506,6 +507,20 @@ comp_links(struct link *l1, struct link *l2)
if_assert_failed return 0;
return (l1-number - l2-number);
 }
+#endif
+
+static int
+comp_links(struct link *l1, struct link *l2)
+{
+   int res;
+
+   assert(l1  l2  l1-points  l2-points);
+   if_assert_failed return 0;
+   res = l1-points[0].y - l2-points[0].y;
+   if (res)
+   return res;
+   return l1-points[0].x - l2-points[0].x;   
+}
 
 void
 sort_links(struct document *document)


and these keybindings:

bind main up = move-link-up
bind main down = move-link-down
bind main left = move-link-prev
bind main right = move-link-next

You pay 5$ :)
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] lua50 or lua51 in 0.12?

2007-07-22 Thread Witold Filipczyk
Hi!
Which version of LUA 5.0 or 5.1 should ELinks-0.12 use?
Currently it supports only 5.0, but 5.1 is newer.
IMO now is good time to switch to 5.1.
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] Date format for directory listings

2007-06-19 Thread Witold Filipczyk
Hi!
Date formats differ among various locales.
Those used by ELinks in directory listings may not be appropriate for everyone.
IMHO there are 3 choices:
- leave them as they are
- let user to define them
- use gettext

Which choice do you prefer?
I prefer gettext myself, but I want to know your opinions.

-- 
Witek

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] CGI scripts using GET don't work

2007-06-15 Thread Witold Filipczyk
Hi!
CGI scripts using the GET method don't work in 0.11.3
and 0.12.GIT. QUERY_STRING is empty. It's a big bug.
Here is the patch for 0.11.3:
diff --git a/src/protocol/uri.c b/src/protocol/uri.c
index df22646..e9c3b39 100644
--- a/src/protocol/uri.c
+++ b/src/protocol/uri.c
@@ -149,7 +149,7 @@ static int
 check_uri_file(const unsigned char *name)
 {
/* Check POST_CHAR etc ... */
-   static const unsigned char chars[] = POST_CHAR_S #?;
+   static const unsigned char chars[] = POST_CHAR_S #;
 
return strcspn(name, chars);
 }

-- 
Witek
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Solaris build fixes

2007-06-05 Thread Witold Filipczyk
On Tue, Jun 05, 2007 at 12:29:46AM +0300, Kalle Olavi Niemitalo wrote:
 John Hawkinson [EMAIL PROTECTED] writes:
 
  Kalle Olavi Niemitalo [EMAIL PROTECTED] wrote on Sun,  3 Jun 2007
  at 10:48:09 +0300 in [EMAIL PROTECTED]:
 
  Have you tested the resulting binary, especially with slow sites
  and Transfer-Encoding: chunked?
 
  I have not...do you have a good test case?
 
 -
 #! /usr/bin/perl
 use strict;
 use IPC::Open2;
 
 print EOH;
 Content-Type: text/plain
 Content-Encoding: gzip
 
 EOH
 
 local $| = 1;
 open PLAIN, , /home/Kalle/src/elinks-0.12/COPYING or die;
 my $pid = open2(\*GZIP, PLAIN, gzip -1);
 local $/ = \4567;
 while (GZIP) { print; sleep 1 }
 -

 If I comment out the gzclearerr call in gzip_read, the output is
 truncated after that is to say, a work.  With different input
 files, ELinks can display garbage too.  No such problems in
 ELinks 0.11.3.
 
  Would it be sufficient to call clearerr() on the fd that
  gzip_open() was called with? I guess it would be hairy to save
  the fd.
 
 clearerr() needs a FILE *, not a file descriptor.  And
 gzip_open() calls fdopen() itself, so ELinks never sees
 the FILE *.  There is no function in zlib for retrieving
 the pointer, either.
 
 So then, there seem to be four options:
 
 (a) Just skip gzclearerr and ignore the resulting corruption.
 This would be a regression from 0.11.3.
 
 (b) Revert all the decompression changes from elinks-0.12,
 returning to what was in ELinks 0.11.3.

The old code doesn't work well everywhere, so gzclearerr was added
and then the decompression code was simplified (?).

 (c) Partially or completely disable gzip decompression on
 platforms that don't have gzclearerr.  Document that ELinks
 needs at least zlib 1.2.0.2 for full support.
 
 (d) Rewrite the decompression code or at least the gzip part of
 it.  I don't have an estimate on how long this would take.
 It would be too easy to slip in new bugs in this process.
 
  (e) Write ELinks's gzclearerr using internals of the zlib of Solaris 10.
  Check for gzclearerr in ./configure. If it fails use own function
  and warn the user.
  
 I think it would be best to do (c) in 0.12.GIT and (d) in 0.13.GIT.

I wonder what happens when part of the gzip header is in the first chunk
and the rest in the next one.
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Why utf8_linux_frame_seqs?

2007-05-16 Thread Witold Filipczyk
On Wed, May 16, 2007 at 09:09:02AM +0300, Kalle Olavi Niemitalo wrote:
 In ELinks 0.12.GIT (f8f99cc04ea0ff1f64c0452f5232e1b2567493c2):
 
 - If UTF-8 I/O is disabled, then src/terminal/screen.c outputs
   normal characters in the terminal charset, and frame characters
   usually in a separate frame charset.  To switch between the
   charsets, it outputs strings from screen_driver.frame_seqs[].
 
 - If UTF-8 I/O is enabled and CONFIG_UTF8 is not defined, then
   src/terminal/screen.c outputs all characters in UTF-8.  It
   converts frame characters first to some unibyte codepage that
   supports them (typically CP437), and then to UCS-4 and UTF-8.
 
 - If UTF-8 I/O is enabled and CONFIG_UTF8 is defined, then
   src/terminal/screen.c outputs normal characters in UTF-8,
   and frame characters usually in a separate frame charset.
   To switch between the charsets, it outputs strings from
   screen_driver.frame_seqs[], which may be
   utf8_linux_frame_seqs[] defined for this purpose.
 
 I would like to change src/terminal/screen.c so that UTF-8 I/O
 always outputs frame characters in UTF-8, regardless of whether
 CONFIG_UTF8 is defined.  I have already implemented this but the
 change is currently entangled with fixes for bug 914 and
 separating it will take some time.

You can remove utf8_linux_frame_seqs. It forces the UTF-8 mode on
the Linux console. Proper way is to set the UTF-8 mode before starting
the ELinks.

-- 
Witek

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] getELementById

2007-04-26 Thread Witold Filipczyk
Hello,
I want to add support for document.getELementById with minimal effort
and minimal slowdown. My idea is:
In parse_element instead of returning attr, alloc and return struct node2:
struct node2 {
LIST_HEAD(struct node2);
//  unsigned char *start; /* start of HTML element at char '' */
unsigned char *a; /* start of attributes, the value of attr */
struct list_head attrs;
} 

struct attrs {
LIST_HEAD(struct attrs);
unsigned char *name;
unsigned char *value;
}

get_attr_val_node(struct node2 *node, unsigned char *name, ...)
{
struct attrs *at;
int found = 0;
foreach (at, node-attrs) {
if (!strcasecmp(name, at-name)) {
found = 1;
break;
}
}
if (found) return stracpy(at-value);
return get_attr_val(node-a, name, ...);
}

Unfortunately for consistency nodes cannot be allocated every time.
Instead, they should be lookup in the hastable 1. Big slowdown.
Which struct should contain this hashtable?

In start_element in ELEMENT_RENDER_PROLOGUE nodes will be stored
in the hashtable 2, which will be used by getElementById.
Which struct should contain this hashtable?

innerHTML:
struct innerHTML {
unsigned char *html; /* start of new html */
unsigned char *eof; /* end of new html */
unsigned char *end; /* end of original element 
(first char after closing tag '/...') */
}
Places where the html is changed mark using special char, eg.
(char)0x05. Pointers to those chars will be keys in the hastable 3.
parse_html should parse them somehow. I don't know how yet.
Which struct should contain this hashtable?

After any change of attribute or innerHTML the whole document should be 
reparsed.
Big slowdown.

Have you got any idea how to make it better?
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] witekfl branch status

2007-03-26 Thread Witold Filipczyk
On Sun, Mar 25, 2007 at 11:23:30PM +0300, Kalle Olavi Niemitalo wrote:
 Witold Filipczyk [EMAIL PROTECTED] writes:
 
  On Sun, Mar 18, 2007 at 09:12:23PM +0200, Kalle Olavi Niemitalo wrote:
  bug620 This resets forms when I resize the window.  Not acceptable.
  It's difficult because it should be done only once when the document is
  fully loaded after reloading, but the user might type something into forms
  earlier.
  How to do that?
 
 Why must the forms be reset only after the document is fully
 loaded?  I think it would be simplest to discard all form-related
 information immediately in reload(), before even requesting the
 file from the server, and let the renderer then incrementally
 rebuild the data, as if loading the document for the first time.
 I am however not familiar with this code, and it seems I'll need
 a diagram to properly understand all of the pointers between its
 different structures.

You are right!
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] witekfl branch status

2007-03-22 Thread Witold Filipczyk
On Sun, Mar 18, 2007 at 09:12:23PM +0200, Kalle Olavi Niemitalo wrote:
 bug620This resets forms when I resize the window.  Not acceptable.
It's difficult because it should be done only once when the document is
fully loaded after reloading, but the user might type something into forms
earlier.
How to do that?

 
 bug629This gives users an incentive to enable ECMAScript support,
   which currently has bug 755, which can crash ELinks and may be
   exploitable for worse effects.  I think that should be fixed
   before any new ECMAScript features are added.

I committed delayed submitting forms. I hope this help.

 decompr This sets conn-stream_pipes_written = 0 after read_encoded
   returns  0.  But read_encoded is not guaranteed to read all
   the data from the pipe.  So the comment in struct connection
   is not accurate.

Yes, It hung with bzip2.

 
 delay delayed_goto_uri, apparently prevents some internal errors
   with copiousoutput, but I haven't yet examined why.
   More importantly, delayed_open.ses may become a dangling
   pointer if the tab is closed before the bottom half gets
   to run.  One possible fix might be to define a struct
   weak_session that has a reference count, bidirectionally link
   that with struct session, and tear down the link when the
   struct session is freed.  Furthermore, the return value from
   register_bottom_half should be checked.

I don't believe it. Show me a recipe to crash ELinks with copiousoutput.

   
   In the long term, I'd like to have the copiousoutput code
   rewritten as an encoding-like layer, so that it can stream
   data to the viewer as it comes from the network.  This is less
   important than the SGML/DOM integration though.
 
 epoll I don't think this should be merged.
 If ELinks has to keep supporting select() too, I think the
 maintenance burden outweighs any advantages epoll may have.
 It may be faster; but I don't believe the speedup is
 noticeable in practice.  It is not limited by FD_SETSIZE;
 but threads[] still has that limit.

This is the only code that works fine.

 
 mergedThese have already been merged to master.
 
 revertw   These have been reverted in the witekfl branch or revert
   commits that won't be merged.
 
 spaces2   Security risk; see Debian bugs 90483 and 221717.
   If the % does not already have apostrophes around it, this
   quotes the file name with add_shell_quoted_to_string; else,
   this adds the file name as is.  In the latter case, if there
   are apostrophes in the file name too and backquotes between
   them, arbitrary programs can be executed without the user
   knowing.  If ELinks used add_shell_safe_to_string instead of
   substituting the file name directly, then it still wouldn't
   handle spaces correctly on Debian, but I think it would be
   good enough.

So?

 
 speechTest backspaces and add a charset option before merging.
   write_to_festival now recodes text to the terminal I/O
   charset.  I think it will be very common to use UTF-8 I/O with
   the terminal but an ISO-8859-based voice with Festival, and
   write_to_festival currently does not support that combination.
   Also, it should check for SCREEN_ATTR_FRAME.

Frame chars are ignored. I'm too lazy to do the rest.

 ? 2007-03-15 6605f4c471a8b2a1408552a4fdd34b2798756558 read_special: 
 s/foreachback/foreach/
add_to_list adds to the beginning of the list, so the foreach will find faster 
than the foreachback.

 ? 2007-03-14 823c26748a9b6ade0bbcfa9950e8daadb0cc9acf delayed_goto_uri: 
 Do not segfault when there is no location yet.
ELinks crashed when run with the 'copiousoutput' file from the command line.

 ? 2007-03-14 82a408da280a3e7a05975d28a9b0701e76688396 read_special: Added 
 no-cache.
Without this was the memleak and fds of popen_data weren't closed.

 ? 2007-03-14 fbc51b399113224bc0247c9ef6ea773cc06ea12a read_special: 
 reorganization of code.
 ? 2007-03-13 b9c409c3b9ea2ae01797c192f0ebda524577d7db I forgot about 
 conn-popen.
 ? 2007-03-13 7ab5b8d57ecfe0e25e6185ec85304003e5c02024 copiousoutput: 
 Allow read only registered file descriptors.
Reading from any /dev/fd/* may hang ELinks eg. from /dev/fd/0, so only fds of 
the 'copiousoutput' are used.
BTW, whether reading of /dev/zero should be allowed?

 ? 2007-03-13 a494f376f998e69e92125e8f13b9147e37b55799 copiousoutput: Use 
 current frame.
Frames are used where they appears.

 ? 2007-03-13 b6e862f539c6181dacee921ee7120aee76f83245 forms: allow submit 
 empty forms
This and delayed_submit_forms let me get to my bank account.

 bug6292007-03-13 bd0aa20c9c10c5073291a9bd99cddf883bb7857b Grammar.
 spaces2 2007-03-12 6a77f68c63497b518b07fb449984d018f02030db mime: Check 
 whether % is enclosed by apostrophes
 bug6292007-03-12 

Re: [elinks-dev] witekfl branch status

2007-03-15 Thread Witold Filipczyk
On Thu, Mar 15, 2007 at 07:09:45AM +0200, Kalle Olavi Niemitalo wrote:
 Witold Filipczyk [EMAIL PROTECTED] writes:
 
  On Sun, Feb 25, 2007 at 10:52:47AM +0200, Kalle Olavi Niemitalo wrote:
  acckey This seems to fix a bug; please advise how to reproduce the bug.
  html
  body
  a href=/ accesskey=aStart/a
  /body
  /html
 
  And ALT-A doesn't work.
 
 I saved that HTML in a file and opened it with ELinks 0.12.GIT
 (026e56d539099477043e499b1a7227c5a67e200f) running with the
 English language.  I have bound move-cursor-{down,left,right,up}
 to {j,h,l,k}.  My document.browse.accesskey.priority setting is 1.
 
 I moved the cursor down from the link and pressed Alt+a.  The
 cursor jumped back to the first character S of the link.  I
 pressed Alt+a again; this did nothing.  I moved the cursor three
 steps to the right, to the r, and pressed Alt+a once more; this
 did nothing either.  I again moved the cursor down and pressed
 Alt+A (note capital A).  This did nothing.
 
 I then tested c2d1952a082e2ed51dbfb6895f29c0869a89a8a3 from the
 witekfl branch in the same way.  The only difference I could see
 was that in this version, when the cursor was already on some
 character of the link, pressing Alt+a moved it to the beginning
 of the link, rather than left it in place as in master.  Is this
 the bug you were fixing?

Set document.browse.accesskey.auto-follow to 1 and try again.
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] dangling pointer crash in write_to_festival (was: witekfl branch status)

2007-03-07 Thread Witold Filipczyk
On Tue, Mar 06, 2007 at 11:33:44PM +0200, Kalle Olavi Niemitalo wrote:
 Witold Filipczyk [EMAIL PROTECTED] writes:
 
  This feature does not collide with screen readers.
  I just want to listen to ELinks sometimes.
 
 I tried applying the speech commits to master, but it crashes if,
 during the speech, I close the tab and thereby cause the struct
 document_view to be freed:
 
 (gdb) backtrace
 #0  0x08115569 in write_to_festival (fest=0x81938b8) at 
 /home/Kalle/src/elinks/src/viewer/text/festival.c:67
 #1  0x08115519 in read_from_festival (fest=0x81938b8) at 
 /home/Kalle/src/elinks/src/viewer/text/festival.c:45
 #2  0x080ca26b in select_loop (init=0x80c8e23 init) at 
 /home/Kalle/src/elinks/src/main/select.c:289
 #3  0x080c95af in main (argc=1, argv=0xbffc2444) at 
 /home/Kalle/src/elinks/src/main/main.c:365
 (gdb) frame
 #0  0x08115569 in write_to_festival (fest=0x81938b8) at 
 /home/Kalle/src/elinks/src/viewer/text/festival.c:67
 67  if (fest-line = doc-height)
 (gdb) print doc
 $3 = (struct document *) 0x8
 (gdb) list
 62  int len;
 63  struct document_view *doc_view = fest-doc_view;
 64  struct document *doc = doc_view-document;
 65  struct screen_char *data;
 66
 67  if (fest-line = doc-height)
 68  fest-running = 0;
 69  if (!fest-running)
 70  return;
 71
 
 This was with the following commits applied on top of
 f2fc4020934621afb9584a468bd87180059ee8c8 (in this order):
 
 4e93cbf496c82926f42c0eaf270920f126ace3f8
 9064e6323b493b5614a9bd02c25729ce2f1650bf
 f260691ac4f58e7ce0e282d7b48bddbae8f00828
 c187df9a0adcf0f9821d9b14b1dfcf43139d9bb3
 e965d07055f5dd3e046469232e4b3986fb60cbaf
 60fc3bd04fe3f85c66d1dadbc8ba4f56f576f611
 91be2ea6b89a7514b75fa31dcba6d9a5ef6c978c
 4d7c491a22c0b9a191df363504f52f8da1c639e1
 0da23da6b23d25ceb78f0229132d8efb9f3d3781
 
 I think, before the speech code is pushed to master, one should
 either
 
 - fix the bug.  A new document-view-delete event might be a
   clean way to do this.

I reset festival.doc_view in really_close_tab. Is it acceptable?

When a link is followed and the previous document was read out, the new document
is read out from the line number of the previous document.
How to handle this?

Witek
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] witekfl branch status

2007-02-26 Thread Witold Filipczyk
On Sun, Feb 25, 2007 at 12:14:35PM -0600, Kenny Hitt wrote:
 Hi.
 
 On Sun, Feb 25, 2007 at 10:52:47AM +0200, Kalle Olavi Niemitalo wrote:
  
  speech  Needs a use case and review.  Could then be merged before 
  0.12pre1.
  Is this intended to help blind people?  I believe they
  usually have screen reader programs; why is this better?
  The code may also cause compilation errors on non-POSIX
  systems but I think we can sort those out based on test
  reports if there is a 0.12pre release after the merge.
 
 I can't speak for other blind people, but I use a screen reader for access to
 elinks.  I would also like to know why this feature was added and why it is 
 better than using my screen reader.

This feature does not collide with screen readers.
I just want to listen to ELinks sometimes.

Witek
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] witekfl branch status

2007-02-26 Thread Witold Filipczyk
On Sun, Feb 25, 2007 at 10:52:47AM +0200, Kalle Olavi Niemitalo wrote:
 acckeyThis seems to fix a bug; please advise how to reproduce the bug.
html
body
a href=/ accesskey=aStart/a
/body
/html

And ALT-A doesn't work.
Start iterating from the next link:
Where there is more links with the same accesskey only the first one
was accessible via accesskey. I think starting from the next link is just.

 
 bug844Needs review and testing.
 
 bug916Needs review and testing.
 
 bug927Will merge.
 
 bug935If you test this with UTF-8 then I'll merge it.
 
 epoll I don't think this should be merged.
 If ELinks has to keep supporting select() too, I think the
 maintenance burden outweighs any advantages epoll may have.
 It may be faster; but I don't believe the speedup is
 noticeable in practice.  It is not limited by FD_SETSIZE;
 but threads[] still has that limit.
 
 fsp   Needs review and testing.
 
 gpm   Please add some documentation into gpm-wheel.patch.
   Does the patch fix a bug in GPM?
 Can it hurt compatibility with programs that use libgpm?
 
 mergedThese have already been merged to master.
 
 nonblkThis makes local CGI pipes use nonblocking I/O.  Not
   using nonblocking I/O is a bug, and local CGI was added
   in ELinks 0.9.0.  Thus, the stable releases ELinks 0.10.6
   and 0.11.2 may also have this bug.  Please add the bug to
   bugzilla.elinks.or.cz so that backports can be tracked.
 
 spaces1   ftp didn't handle filenames with spaces.
   Does it work in 0.10.6 and 0.11.2?  If not, please add
   this to bugzilla.elinks.or.cz.

Do you think that maintaining 3 versions of ELinks is reasonable?

 
 spaces2   Decode %20 in local filenames and enclose them with ''.
   This seems suspicious.  What if there is '' or '\' in the
   filename?  There is add_shell_quoted_to_string for such
   purposes.

Fixed. Thanks.
spaces2 handles mailcap entries like this:
application/x-tar; /bin/tar tvf -; print=/bin/tar tvf - | print text/plain:-; 
copiousoutput

Witek
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] FSP and passwords

2006-12-09 Thread Witold Filipczyk
Hey,
Password protected directories doesn't work with the FSP code.
get_uri_string(uri, URI_PASSWORD) simply doesn't work.
I don't know how to use branches, so I'm including the patch here:
diff --git a/src/protocol/fsp/fsp.c b/src/protocol/fsp/fsp.c
index c66848a..e8eac96 100644
--- a/src/protocol/fsp/fsp.c
+++ b/src/protocol/fsp/fsp.c
@@ -180,10 +180,19 @@ do_fsp(struct connection *conn)
struct stat sb;
struct uri *uri = conn-uri;
unsigned char *host = get_uri_string(uri, URI_HOST);
-   unsigned char *password = get_uri_string(uri, URI_PASSWORD);
unsigned char *data = get_uri_string(uri, URI_DATA);
unsigned short port = (unsigned short)get_uri_port(uri);
-   FSP_SESSION *ses = fsp_open_session(host, port, password);
+   FSP_SESSION *ses;
+
+   if (uri-password) {
+   unsigned char tmp = uri-password[uri-passwordlen];
+
+   uri-password[uri-passwordlen] = '\0';
+   ses = fsp_open_session(host, port, uri-password);
+   uri-password[uri-passwordlen] = tmp;
+   } else {
+   ses = fsp_open_session(host, port, NULL);
+   }
 
if (!ses)
fsp_error(Session initialization failed.);

Use it with fake user, eg: fsp://user:[EMAIL PROTECTED]
In directory listings, IMHO, this password should be added to base href,
otherwise it must be added by hand for every followed link.
The same case is for smb2(not applied yet).

-- 
Witek
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Re: [patch] additional functionality for Python backend

2006-10-19 Thread Witold Filipczyk
Applied. If you have any enhancements, feel free to send it here.

-- 
Witek
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


[elinks-dev] What is 'sparse' and where to get it?

2006-09-09 Thread Witold Filipczyk
Hi!
make check uses 'sparse'.
What is 'sparse', what does it do and where to get it?
-- 
Witek

___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Smarter strlcmp

2005-08-09 Thread Witold Filipczyk
On Tue, Aug 09, 2005 at 07:24:08PM +0200, Jonas Fonseca Madsen wrote:
  +   if (n1 == -1) n1 = n2; \
  +   if (n2 == -1) n2 = n1; \
  +   if (n1  n2) n1 = n2; \
 
 Here, both n1 and n2 can be -1, which means the loop below can be
 endless.

No. There is return on first difference or end of string.

--- src/util/string.c.orig  2005-08-09 16:47:01.450227816 +0200
+++ src/util/string.c   2005-08-09 19:43:27.660879176 +0200
@@ -203,17 +203,16 @@
  \
/* TODO: Don't precompute strlen()s but rather make the loop smarter.
 * --pasky */ \
-   if (n1 == -1) n1 = strlen(s1); \
-   if (n2 == -1) n2 = strlen(s2); \
  \
-   string_assert(errfile, errline, n1 = 0  n2 = 0, c); \
+   if (n1 == -1) n1 = n2; \
+   if (n2 == -1) n2 = n1; \
+   if (n1 != n2) return 1; \
  \
-   d = n1 - n2; \
-   if (d) return d; \
  \
-   for (p = 0; p  n1  s1[p]  s2[p]; p++) { \
+   for (p = 0; p != n1; p++) { \
d = t1 - t2; \
if (d) return d; \
+   if (!s1[p]) return 0; \
} \
return 0; \
 }
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Python detection error in configure

2005-07-13 Thread Witold Filipczyk
On Tue, Jul 12, 2005 at 10:18:26PM -0500, Stephen Stocker wrote:
 
 Where do you have libpython.so ?
 
 --
 witekfl at poczta.gazeta.pl
 
   Sorry, I think I have mail delivery turned off on this list. :(
 
   Anyway, to answer the question, I don't have libpython.so, only the
   static libpython2.2.a under /usr/lib/python2.2/config/. This is the
   first time I ever noticed that! Does ELinks require the shared lib?
 
   Thanks,
   Steve
 

Currently, only shared library is checked.
You don't miss anything, because Python hooks do nothing.


-- 
[EMAIL PROTECTED]
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev


Re: [elinks-dev] Python detection error in configure

2005-06-19 Thread Witold Filipczyk
On Sun, Jun 12, 2005 at 09:09:47PM -0500, Stephen Stocker wrote:
   Hi,
 
   I can't figure this one out, but I've never been able to get Elinks to 
 compile with Python support. Configure gives the error ld was unable to 
 find -lpython (working from memory, but that's close).
 
   Python version is 2.2.3 on Slackware, compiled from source, and the 
 python libs and headers are in /usr/lib/python2.2 and 
 /usr/include/python2.2, with the interpreter in /usr/bin. Any help is 
 appreciated!
 
   Take care,
   Steve
 

Where do you have libpython.so ?

-- 
[EMAIL PROTECTED]
___
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev