From per@REDACTED Thu Apr 2 10:55:50 2009 From: per@REDACTED (Per Hedeland) Date: Thu, 2 Apr 2009 10:55:50 +0200 (CEST) Subject: [erlang-patches] [erlang-questions] IPv6 In-Reply-To: <20090401092419.GA11196@erix.ericsson.se> Message-ID: <200904020855.n328toGE005421@pluto.hedeland.org> Raimo Niskanen wrote: > >On Fri, Mar 27, 2009 at 05:22:25PM +0100, Per Hedeland wrote: >> Hi, >> >> Is there some good reason for gen_tcp/gen_udp not auto-recognizing an > >Not really. But as you see for gen_tcp:connect below, the inet6 >option is currently required there even for an IPv6 address tuple. >These are corners we have not smoothed yet. Thanks, that's good enough for me - I was mainly contemplating whether I should (again) modify the OTP code or sprinkle 'size(Addr) == 8' guards over our own (and the "old" ssh, which doesn't seem to honour an 'inet6' option) - I'll go for the former then. >It can be argued that the tuple size alone is not >sufficient to determine the address class. After all >a 4-tuple can be interpreted as a IPv4-compatible >IPv6 address if you really want. Good point I guess - so, 4-tuple + 'inet' or no option would mean IPv4 (as today), 4-tuple + 'inet6' could mean v4-in-v6, and you could even have 8-tuple + 'inet' set up a tunnel if you want:-) - I'm really only interested in the 8-tuple + no option case, which I think is just plain broken today. For Your Inspiration:-), below is a modified version of the patches I sent earlier, which now fix only this case, and in addition don't override a user-set inet_db module (for "all" the people that use that feature:-) (actually I thought about using it to fix my problem, but since it would mean having to use a bunch of undocumented prim_inet functions, it's really the worst option). Thanks! --Per --------------- --- otp_src_R13A/lib/kernel/src/gen_tcp.erl.ORIG 2009-03-12 13:19:00.000000000 +0100 +++ otp_src_R13A/lib/kernel/src/gen_tcp.erl 2009-04-02 10:03:34.000000000 +0200 @@ -46,7 +46,7 @@ end. connect1(Address,Port,Opts,Timer) -> - Mod = mod(Opts), + Mod = mod(Opts, Address), case Mod:getaddrs(Address,Timer) of {ok,IPs} -> case Mod:getserv(Port) of @@ -73,7 +73,7 @@ %% Listen on a tcp port %% listen(Port, Opts) -> - Mod = mod(Opts), + Mod = mod(Opts, undefined), case Mod:getserv(Port) of {ok,TP} -> Mod:listen(TP, Opts); @@ -173,20 +173,28 @@ %% Create a port/socket from a file descriptor %% fdopen(Fd, Opts) -> - Mod = mod(Opts), + Mod = mod(Opts, undefined), Mod:fdopen(Fd, Opts). -%% Get the tcp_module -mod() -> inet_db:tcp_module(). +%% Get the tcp_module, but IPv6 address overrides default IPv4 +mod(Address) -> + case inet_db:tcp_module() of + inet_tcp when is_tuple(Address), size(Address) =:= 8 -> + inet6_tcp; + Mod -> + Mod + end. %% Get the tcp_module, but option tcp_module|inet|inet6 overrides -mod([{tcp_module,Mod}|_]) -> +mod([{tcp_module,Mod}|_], _Address) -> Mod; -mod([inet|_]) -> +mod([inet|_], _Address) -> inet_tcp; -mod([inet6|_]) -> +mod([inet6|_], _Address) -> inet6_tcp; -mod([_|Opts]) -> - mod(Opts); -mod([]) -> - mod(). +mod([{ip, Address}|Opts], undefined) -> + mod(Opts, Address); +mod([_|Opts], Address) -> + mod(Opts, Address); +mod([], Address) -> + mod(Address). --- otp_src_R13A/lib/kernel/src/gen_udp.erl.ORIG 2009-03-12 13:19:00.000000000 +0100 +++ otp_src_R13A/lib/kernel/src/gen_udp.erl 2009-04-02 10:03:37.000000000 +0200 @@ -29,7 +29,7 @@ open(Port, []). open(Port, Opts) -> - Mod = mod(Opts), + Mod = mod(Opts, undefined), {ok,UP} = Mod:getserv(Port), Mod:open(UP, Opts). @@ -97,21 +97,29 @@ %% Create a port/socket from a file descriptor %% fdopen(Fd, Opts) -> - Mod = mod(), + Mod = mod(Opts, undefined), Mod:fdopen(Fd, Opts). -%% Get the udp_module -mod() -> inet_db:udp_module(). +%% Get the udp_module, but IPv6 address overrides default IPv4 +mod(Address) -> + case inet_db:udp_module() of + inet_udp when is_tuple(Address), size(Address) =:= 8 -> + inet6_udp; + Mod -> + Mod + end. -%% Get the udp_module, but option udp_module|inet|inet6 overrides -mod([{udp_module,Mod}|_]) -> +%% Get the udp_module, but option tcp_module|inet|inet6 overrides +mod([{udp_module,Mod}|_], _Address) -> Mod; -mod([inet|_]) -> +mod([inet|_], _Address) -> inet_udp; -mod([inet6|_]) -> +mod([inet6|_], _Address) -> inet6_udp; -mod([_|Opts]) -> - mod(Opts); -mod([]) -> - mod(). +mod([{ip, Address}|Opts], undefined) -> + mod(Opts, Address); +mod([_|Opts], Address) -> + mod(Opts, Address); +mod([], Address) -> + mod(Address). From info@REDACTED Sun Apr 5 13:44:12 2009 From: info@REDACTED (G.Isenmann) Date: Sun, 5 Apr 2009 13:44:12 +0200 Subject: [erlang-patches] R13A patches for os_mon on dragonfly Message-ID: <20090405134412.5f4201a6@horse.intern> Hi, would it be possible to include these small patches into R13B? I believe they have no side effect on other platforms and improve the situation on dragonfly. CC dragonfly-users: - The first patch is a copy of pkgsrc/wip/erlang/patches/patch-aa. - The others are probably also neccessary for both pkgsrc/lang/erlang (R12B) and pkgsrc/wip/erlang (R12B-5). - Noticed this while playing with rabbitmq. - Have ignored other patches from wip/erlang that probably need modifications for dragonfly but which do not look so simple (e.g. for erts/emulator/sys/unix/sys_float.c). -- Goetz -------------- next part -------------- A non-text attachment was scrubbed... Name: patch-aa Type: application/octet-stream Size: 443 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: cpu_sup.erl.patch Type: application/octet-stream Size: 1138 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: disksup.erl.patch Type: application/octet-stream Size: 872 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: memsup.erl.patch Type: application/octet-stream Size: 1973 bytes Desc: not available URL: From mikpe@REDACTED Sun Apr 5 17:48:27 2009 From: mikpe@REDACTED (Mikael Pettersson) Date: Sun, 5 Apr 2009 17:48:27 +0200 Subject: [erlang-patches] R13A patches for os_mon on dragonfly In-Reply-To: <20090405134412.5f4201a6@horse.intern> References: <20090405134412.5f4201a6@horse.intern> Message-ID: <18904.53963.247870.204471@pilspetsen.it.uu.se> G.Isenmann writes: > Hi, would it be possible to include these small patches into R13B? I > believe they have no side effect on other platforms and improve the > situation on dragonfly. > > CC dragonfly-users: ... > - Have ignored other patches from wip/erlang that probably need > modifications for dragonfly but which do not look so simple (e.g. > for erts/emulator/sys/unix/sys_float.c). I assume the sys_float.c stuff is related to FP exceptions on dragonfly. You don't need FP exceptions if you ./configure --disable-hipe (which should be the default since HiPE doesn't support that platform yet). Enabling FP exceptions on a Unix-like OS involves writing sigaction() handler code to inspect and modify the faulting mcontext. Unfortunately that's an area where different OSes differ, so for OSes that we (as in the Erlang/OTP and HiPE developers) don't have access to, it's up to the users of those OSes to contribute the required code. From magnus@REDACTED Mon Apr 6 12:54:04 2009 From: magnus@REDACTED (Magnus Henoch) Date: Mon, 06 Apr 2009 11:54:04 +0100 Subject: [erlang-patches] HTML cover report should escape comments Message-ID: <84prfqm4s3.fsf@linux-b2a3.site> cover does not escape < and > in comments when generating HTML reports. Here is a patch that fixes that: (R12B-5 and R13A) --- cover.erl.orig 2009-04-06 11:44:29.000000000 +0100 +++ cover.erl 2009-04-06 11:46:11.000000000 +0100 @@ -1792,7 +1792,7 @@ eof -> ignore; "%"++_=Line -> %Comment line - not executed. - io:put_chars(OutFd, [tab(),Line]), + io:put_chars(OutFd, [tab(), escape_lt_and_gt(Line, HTML)]), print_lines(Module, InFd, OutFd, L+1, HTML); RawLine -> Line = escape_lt_and_gt(RawLine,HTML), -- Magnus Henoch, magnus@REDACTED Erlang Training and Consulting http://www.erlang-consulting.com/ From egil@REDACTED Mon Apr 6 14:52:48 2009 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Mon, 06 Apr 2009 14:52:48 +0200 Subject: [erlang-patches] R13A patches for os_mon on dragonfly In-Reply-To: <20090405134412.5f4201a6@horse.intern> References: <20090405134412.5f4201a6@horse.intern> Message-ID: <49D9FB20.4050703@erix.ericsson.se> G.Isenmann wrote: > Hi, would it be possible to include these small patches into R13B? I > believe they have no side effect on other platforms and improve the > situation on dragonfly. Your patches seems straightforward enough. I will try to include them in r13b. We do not have any dragonfly os to try your patches on so they will be included 'as-is' if it doesn't break any other code. Regards, Bj?rn-Egil Erlang/OTP, Ericsson AB From bgustavsson@REDACTED Mon Apr 6 16:03:30 2009 From: bgustavsson@REDACTED (Bjorn Gustavsson) Date: Mon, 6 Apr 2009 16:03:30 +0200 Subject: [erlang-patches] HTML cover report should escape comments In-Reply-To: <84prfqm4s3.fsf@linux-b2a3.site> References: <84prfqm4s3.fsf@linux-b2a3.site> Message-ID: <6672d0160904060703g177d1c34m293461751e07c04e@mail.gmail.com> On Mon, Apr 6, 2009 at 12:54 PM, Magnus Henoch wrote: > cover does not escape < and > in comments when generating HTML reports. > Here is a patch that fixes that: (R12B-5 and R13A) > > --- cover.erl.orig 2009-04-06 11:44:29.000000000 +0100 > +++ cover.erl 2009-04-06 11:46:11.000000000 +0100 > @@ -1792,7 +1792,7 @@ > eof -> > ignore; > "%"++_=Line -> %Comment line - not executed. > - io:put_chars(OutFd, [tab(),Line]), > + io:put_chars(OutFd, [tab(), escape_lt_and_gt(Line, HTML)]), > print_lines(Module, InFd, OutFd, L+1, HTML); > RawLine -> > Line = escape_lt_and_gt(RawLine,HTML), > Thanks for the patch. It will be included in R13B. /Bjorn > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-patches > -- Bj?rn Gustavsson, Erlang/OTP, Ericsson AB From kenji.rikitake@REDACTED Tue Apr 7 15:33:41 2009 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Tue, 7 Apr 2009 22:33:41 +0900 Subject: [erlang-patches] R13A test case example: how to test leap-second code on FreeBSD In-Reply-To: <6672d0160810170154h4f74cc8do7a79828363112729@mail.gmail.com> References: <20080914014111.GA7026@k2r.org> <6672d0160810170154h4f74cc8do7a79828363112729@mail.gmail.com> Message-ID: <20090407133341.GA10312@k2r.org> I found out a part of my patch was incorporated in R13A erts/emulator/beam/erl_time_sup.c, and I saw a question in the comment that there was no test case for checking whether the TAI (leap second) support really works. Here is a piece of code for testing on FreeBSD. (see /usr/src/share/zoneinfo/Makefile for the details) I think this will work on 7.x as well as 6.x. For testing a TAI-based clock on FreeBSD (with leap second support) perform the following script on root then the zone file will include the leap seconds: # -- begin -- cd /usr/src/share/zoneinfo make -DLEAPSECONDS clean install # CAUTION: set to your local timezone cp /usr/share/zoneinfo/Europe/Stockholm /etc/localtime # -- end -- For putting back into non-leap-second clock on FreeBSD, perform the following script on root: # -- begin -- cd /usr/src/share/zoneinfo make clean install # CAUTION: set to your local timezone cp /usr/share/zoneinfo/Europe/Stockholm /etc/localtime # -- end -- These scripts will change the timezone definition *system-wide*. I hope this helps and I appreciate you put in the code into R13A. Regards, Kenji Rikitake In the message <6672d0160810170154h4f74cc8do7a79828363112729@REDACTED> dated Fri, Oct 17, 2008 at 10:53:37AM +0200, Bjorn Gustavsson writes: > > A patch to correct erlang:universaltime_to_localtime/1 > > for FreeBSD running leap-second-enabled timezone > > by Kenji Rikitake > > 14-SEP-2008 > > > > * Summary > > > > This patch fixes the time calculation problem of > > FreeBSD 6.x and 7.x, which has the internal leap-second > > correction enabled. > > This patch is tested with Erlang/OTP R12B-4 source distribution. > > > > We will probably add the patch to R12B-5 with slight modifications. > > /Bjorn From mtalyans@REDACTED Wed Apr 8 18:11:09 2009 From: mtalyans@REDACTED (mtalyans) Date: Wed, 08 Apr 2009 09:11:09 -0700 Subject: [erlang-patches] Proposed patch to httpc_response.erl (R13A) Message-ID: Hi, I am new to Erlang, so please bear with me: Fix_relative_uri function was giving me errors, because Port variable is not a list, but an integer, and ++ operator bombed. Proposed patch (tested on several web pages with relative URI on the Location response, found working fine): mtalyans@REDACTED$ diff -Naur httpc_response.erl.orig httpc_response.erl --- httpc_response.erl.orig 2009-04-08 09:02:44.000000000 -0700 +++ httpc_response.erl 2009-04-08 09:03:12.000000000 -0700 @@ -364,13 +364,18 @@ end end. +list_port(Port) when is_list(Port) -> + Port; +list_port(Port) when is_integer(Port) -> + integer_to_list(Port). + %%% Guessing that we received a relative URI, fix it to become an absoluteURI fix_relative_uri(Request, RedirUrl) -> {Server, Port} = Request#request.address, Path = Request#request.path, - atom_to_list(Request#request.scheme) ++ "://" ++ Server ++ ":" ++ Port - ++ Path ++ RedirUrl. - + atom_to_list(Request#request.scheme) ++ "://" ++ Server ++ ":" ++ list_port(Port) + ++ Path ++ RedirUrl. + error(#request{id = Id}, Reason) -> {Id, {error, Reason}}. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenji.rikitake@REDACTED Sun Apr 12 06:12:45 2009 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Sun, 12 Apr 2009 13:12:45 +0900 Subject: [erlang-patches] R13A patch for erts/emulator/drivers/common/inet_drv.c Message-ID: <20090412041245.GA29991@k2r.org> This is a patch for compiling Erlang R13A on FreeBSD 7.1-RELEASE. Note that I apply all Giacomo's patches for Erlang R12B5 (available on FreeBSD port lang/erlang) BEFORE applying this patch. Kenji Rikitake R13A patch for solving a compilation error when building erts/emulator/drivers/common/inet_drv.c by Kenji Rikitake 12-APR-2009 Symptom: When building R13A in FreeBSD 7.1-RELEASE, the compiler flag HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_SACKDELAY is NOT enabled. Some code in erts/emulator/drivers/common/inet_drv.c incorrectly assumes HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_SACKDELAY is always true when HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_FLAGS is true in config.h. This assumption causes a compilation error. Workaround: apply the following patch. NOTE: this is a followup patch of Giacomo Olgeni's patch for FreeBSD at: http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/ports/lang/erlang/files/patch-erts_emulator_drivers_common_inet__drv.c?rev=1.1;content-type=text%2Fplain so Giacomo's patch must be applied before this patch to compile. --- erts/emulator/drivers/common/inet_drv.c.FCS 2009-04-12 12:16:52.000000000 +0900 +++ erts/emulator/drivers/common/inet_drv.c 2009-04-12 12:36:06.000000000 +0900 @@ -5301,16 +5301,19 @@ if (pmtud_enable && pmtud_disable) return -1; if (pmtud_enable) cflags |= SPP_PMTUD_ENABLE; if (pmtud_disable) cflags |= SPP_PMTUD_DISABLE; +# ifdef HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_SACKDELAY + /* The followings are missing in FreeBSD 7.1 */ sackdelay_enable =eflags& SCTP_FLAG_SACDELAY_ENABLE; sackdelay_disable=eflags& SCTP_FLAG_SACDELAY_DISABLE; if (sackdelay_enable && sackdelay_disable) return -1; if (sackdelay_enable) cflags |= SPP_SACKDELAY_ENABLE; if (sackdelay_disable) cflags |= SPP_SACKDELAY_DISABLE; +# endif arg.pap.spp_flags = cflags; # endif curr += 4; @@ -6207,17 +6210,19 @@ if (ap.spp_flags & SPP_PMTUD_ENABLE) { i = LOAD_ATOM (spec, i, am_pmtud_enable); n++; } if (ap.spp_flags & SPP_PMTUD_DISABLE) { i = LOAD_ATOM (spec, i, am_pmtud_disable); n++; } - +# ifdef HAVE_STRUCT_SCTP_PADDRPARAMS_SPP_SACKDELAY + /* SPP_SACKDELAY_* not in FreeBSD 7.1 */ if (ap.spp_flags & SPP_SACKDELAY_ENABLE) { i = LOAD_ATOM (spec, i, am_sackdelay_enable); n++; } if (ap.spp_flags & SPP_SACKDELAY_DISABLE) { i = LOAD_ATOM (spec, i, am_sackdelay_disable); n++; } # endif +# endif PLACE_FOR(spec, i, LOAD_NIL_CNT + LOAD_LIST_CNT + 2*LOAD_TUPLE_CNT); /* Close up the Flags list: */ From kenji.rikitake@REDACTED Sun Apr 12 07:33:33 2009 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Sun, 12 Apr 2009 14:33:33 +0900 Subject: [erlang-patches] R13A patch for lib/wx/examples Message-ID: <20090412053333.GA51822@k2r.org> This is a patch for compiling Erlang R13A on FreeBSD 7.1-RELEASE. Note that I apply all Giacomo's patches for Erlang R12B5 (available on FreeBSD port lang/erlang) BEFORE applying this patch. Kenji Rikitake R13A patch to solve lib/wx/examples installation errors on FreeBSD 7.1-RELEASE by Kenji Rikitake 12-APR-2009 Symptom: R13A lib/wx/examples files causes installation error on FreeBSD 7.1-RELEASE. This is caused by the Makefile code which errorneously trying to install BEAM binaries and other files as OS executables. Workaround: Using INSTALL_DATA instead of INSTALL_PROGRAM in the Makefiles solves this issue. Apply the following patches: --- ./lib/wx/examples/simple/Makefile.FCS 2009-03-13 00:04:24.000000000 +0900 +++ ./lib/wx/examples/simple/Makefile 2009-04-12 14:10:58.000000000 +0900 @@ -52,11 +52,11 @@ docs: release_spec: $(INSTALL_DIR) $(EXRELSYSDIR) $(INSTALL_DATA) $(TESTSRC) $(EXRELSYSDIR) - $(INSTALL_PROGRAM) copy.xpm sample.xpm $(TESTTARGETS) $(EXRELSYSDIR) + $(INSTALL_DATA) copy.xpm sample.xpm $(TESTTARGETS) $(EXRELSYSDIR) release_tests_spec: release_docs_spec: --- ./lib/wx/examples/sudoku/Makefile.FCS 2009-03-12 23:44:22.000000000 +0900 +++ ./lib/wx/examples/sudoku/Makefile 2009-04-12 14:11:32.000000000 +0900 @@ -52,11 +52,11 @@ docs: release_spec: $(INSTALL_DIR) $(EXRELSYSDIR) $(INSTALL_DATA) $(TESTSRC) sudoku.hrl $(EXRELSYSDIR) - $(INSTALL_PROGRAM) $(TESTTARGETS) $(EXRELSYSDIR) + $(INSTALL_DATA) $(TESTTARGETS) $(EXRELSYSDIR) release_tests_spec: release_docs_spec: From kenji.rikitake@REDACTED Sun Apr 12 09:12:46 2009 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Sun, 12 Apr 2009 16:12:46 +0900 Subject: [erlang-patches] R13A patches for os_mon on dragonfly In-Reply-To: <49D9FB20.4050703@erix.ericsson.se> References: <20090405134412.5f4201a6@horse.intern> <49D9FB20.4050703@erix.ericsson.se> Message-ID: <20090412071246.GA53449@k2r.org> Dear Bjorn and the list members: R13B as of 2009-04-11 is broken for FreeBSD 7.1-RELEASE. Please fix it as proposed. Kenji Rikitake R13B snapshot of 2009-04-11 has broken lib/os_mon/c_src/memsup.c for FreeBSD 7.1-RELEASE by Kenji Rikitake 12-APR-2009 Symptom: compilation error on lib/os_mon/c_src/memsup.c Possible reason: memsup.c was mangled between R13A and R13B, while trying to patch according to the "patch-aa" file in the following patch set for DragonFly BSD: http://erlang.org/pipermail/erlang-patches/2009-April/000395.html Workaround: Apply the patch "patch-aa" in the above article AS IS, as follows. --- lib/os_mon/c_src/memsup.c.FCS 2009-04-08 18:57:44.000000000 +0900 +++ lib/os_mon/c_src/memsup.c 2009-04-12 15:50:34.000000000 +0900 @@ -114,11 +114,11 @@ #include #include #if !defined (__OpenBSD__) && !defined (__NetBSD__) #include #endif -#if defined (__FreeBSD__) && defined(__DragonFly__) +#if defined (__FreeBSD__) || defined(__DragonFly__) #include #endif #endif #if defined (__linux__) From kenji.rikitake@REDACTED Sun Apr 12 09:20:53 2009 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Sun, 12 Apr 2009 16:20:53 +0900 Subject: [erlang-patches] R13B snapshop 2009-04-11 patch for lib/wx/examples Re: R13A patch for lib/wx/examples In-Reply-To: <20090412053333.GA51822@k2r.org> References: <20090412053333.GA51822@k2r.org> Message-ID: <20090412072053.GB53553@k2r.org> Sources under lib/wx/examples are broken on FreeBSD due to the Makefile errors. A patch follows. // Kenji Rikitake R13B snapshot 2009-04-11 patch to solve lib/wx/examples installation errors on FreeBSD 7.1-RELEASE by Kenji Rikitake 12-APR-2009 Symptom: R13B snapshot 2009-04-11 lib/wx/examples/xrc files causes installation error on FreeBSD 7.1-RELEASE. This is caused by the Makefile code which errorneously trying to install BEAM binaries and other files as OS executables. Workaround: Using INSTALL_DATA instead of INSTALL_PROGRAM in the Makefiles solves this issue. Apply the following patches: --- lib/wx/examples/xrc/Makefile.FCS 2009-04-07 23:37:42.000000000 +0900 +++ lib/wx/examples/xrc/Makefile 2009-04-12 15:44:38.000000000 +0900 @@ -60,11 +60,11 @@ docs: release_spec: $(INSTALL_DIR) $(EXRELSYSDIR) $(INSTALL_DATA) $(TESTSRC) $(EXRELSYSDIR) - $(INSTALL_PROGRAM) $(TESTTARGETS) $(EXRELSYSDIR) + $(INSTALL_DATA) $(TESTTARGETS) $(EXRELSYSDIR) $(INSTALL_DIR) $(EXRELSYSDIR)/rc $(INSTALL_DATA) $(TESTRESOURCE) $(EXRELSYSDIR)/rc release_tests_spec: In the message <20090412053333.GA51822@REDACTED> dated Sun, Apr 12, 2009 at 02:33:09PM +0900, Kenji Rikitake writes: > Date: Sun, 12 Apr 2009 14:33:33 +0900 > From: Kenji Rikitake > Subject: R13A patch for lib/wx/examples > To: olgeni@REDACTED > Cc: Kenji Rikitake , erlang-bugs@REDACTED, > erlang-patches@REDACTED > > This is a patch for compiling Erlang R13A on FreeBSD 7.1-RELEASE. > Note that I apply all Giacomo's patches for Erlang R12B5 > (available on FreeBSD port lang/erlang) BEFORE applying > this patch. > > Kenji Rikitake > > R13A patch to solve lib/wx/examples installation errors > on FreeBSD 7.1-RELEASE > by Kenji Rikitake 12-APR-2009 > > Symptom: > > R13A lib/wx/examples files causes installation error on FreeBSD > 7.1-RELEASE. This is caused by the Makefile code which errorneously > trying to install BEAM binaries and other files as OS executables. > > Workaround: > > Using INSTALL_DATA instead of INSTALL_PROGRAM in the Makefiles solves > this issue. > > Apply the following patches: > > --- ./lib/wx/examples/simple/Makefile.FCS 2009-03-13 00:04:24.000000000 +0900 > +++ ./lib/wx/examples/simple/Makefile 2009-04-12 14:10:58.000000000 +0900 > @@ -52,11 +52,11 @@ > docs: > > release_spec: > $(INSTALL_DIR) $(EXRELSYSDIR) > $(INSTALL_DATA) $(TESTSRC) $(EXRELSYSDIR) > - $(INSTALL_PROGRAM) copy.xpm sample.xpm $(TESTTARGETS) $(EXRELSYSDIR) > + $(INSTALL_DATA) copy.xpm sample.xpm $(TESTTARGETS) $(EXRELSYSDIR) > > release_tests_spec: > > release_docs_spec: > > --- ./lib/wx/examples/sudoku/Makefile.FCS 2009-03-12 23:44:22.000000000 +0900 > +++ ./lib/wx/examples/sudoku/Makefile 2009-04-12 14:11:32.000000000 +0900 > @@ -52,11 +52,11 @@ > docs: > > release_spec: > $(INSTALL_DIR) $(EXRELSYSDIR) > $(INSTALL_DATA) $(TESTSRC) sudoku.hrl $(EXRELSYSDIR) > - $(INSTALL_PROGRAM) $(TESTTARGETS) $(EXRELSYSDIR) > + $(INSTALL_DATA) $(TESTTARGETS) $(EXRELSYSDIR) > > release_tests_spec: > > release_docs_spec: > From dgud@REDACTED Tue Apr 14 09:21:30 2009 From: dgud@REDACTED (Dan Gudmundsson) Date: Tue, 14 Apr 2009 09:21:30 +0200 Subject: [erlang-patches] R13B snapshop 2009-04-11 patch for lib/wx/examples Re: R13A patch for lib/wx/examples In-Reply-To: <20090412072053.GB53553@k2r.org> References: <20090412053333.GA51822@k2r.org> <20090412072053.GB53553@k2r.org> Message-ID: <49E4397A.10108@erix.ericsson.se> Thanks, fixed. /Dan Kenji Rikitake wrote: > Sources under lib/wx/examples are broken on FreeBSD due to the Makefile > errors. A patch follows. // Kenji Rikitake > > R13B snapshot 2009-04-11 patch > to solve lib/wx/examples installation errors > on FreeBSD 7.1-RELEASE > by Kenji Rikitake 12-APR-2009 > > Symptom: > > R13B snapshot 2009-04-11 lib/wx/examples/xrc files causes installation > error on FreeBSD 7.1-RELEASE. This is caused by the Makefile code which > errorneously trying to install BEAM binaries and other files as OS > executables. > > Workaround: > > Using INSTALL_DATA instead of INSTALL_PROGRAM in the Makefiles solves > this issue. > > Apply the following patches: > > --- lib/wx/examples/xrc/Makefile.FCS 2009-04-07 23:37:42.000000000 +0900 > +++ lib/wx/examples/xrc/Makefile 2009-04-12 15:44:38.000000000 +0900 > @@ -60,11 +60,11 @@ > docs: > > release_spec: > $(INSTALL_DIR) $(EXRELSYSDIR) > $(INSTALL_DATA) $(TESTSRC) $(EXRELSYSDIR) > - $(INSTALL_PROGRAM) $(TESTTARGETS) $(EXRELSYSDIR) > + $(INSTALL_DATA) $(TESTTARGETS) $(EXRELSYSDIR) > $(INSTALL_DIR) $(EXRELSYSDIR)/rc > $(INSTALL_DATA) $(TESTRESOURCE) $(EXRELSYSDIR)/rc > > release_tests_spec: > > > > > > > In the message <20090412053333.GA51822@REDACTED> > dated Sun, Apr 12, 2009 at 02:33:09PM +0900, > Kenji Rikitake writes: >> Date: Sun, 12 Apr 2009 14:33:33 +0900 >> From: Kenji Rikitake >> Subject: R13A patch for lib/wx/examples >> To: olgeni@REDACTED >> Cc: Kenji Rikitake , erlang-bugs@REDACTED, >> erlang-patches@REDACTED >> >> This is a patch for compiling Erlang R13A on FreeBSD 7.1-RELEASE. >> Note that I apply all Giacomo's patches for Erlang R12B5 >> (available on FreeBSD port lang/erlang) BEFORE applying >> this patch. >> >> Kenji Rikitake >> >> R13A patch to solve lib/wx/examples installation errors >> on FreeBSD 7.1-RELEASE >> by Kenji Rikitake 12-APR-2009 >> >> Symptom: >> >> R13A lib/wx/examples files causes installation error on FreeBSD >> 7.1-RELEASE. This is caused by the Makefile code which errorneously >> trying to install BEAM binaries and other files as OS executables. >> >> Workaround: >> >> Using INSTALL_DATA instead of INSTALL_PROGRAM in the Makefiles solves >> this issue. >> >> Apply the following patches: >> >> --- ./lib/wx/examples/simple/Makefile.FCS 2009-03-13 00:04:24.000000000 +0900 >> +++ ./lib/wx/examples/simple/Makefile 2009-04-12 14:10:58.000000000 +0900 >> @@ -52,11 +52,11 @@ >> docs: >> >> release_spec: >> $(INSTALL_DIR) $(EXRELSYSDIR) >> $(INSTALL_DATA) $(TESTSRC) $(EXRELSYSDIR) >> - $(INSTALL_PROGRAM) copy.xpm sample.xpm $(TESTTARGETS) $(EXRELSYSDIR) >> + $(INSTALL_DATA) copy.xpm sample.xpm $(TESTTARGETS) $(EXRELSYSDIR) >> >> release_tests_spec: >> >> release_docs_spec: >> >> --- ./lib/wx/examples/sudoku/Makefile.FCS 2009-03-12 23:44:22.000000000 +0900 >> +++ ./lib/wx/examples/sudoku/Makefile 2009-04-12 14:11:32.000000000 +0900 >> @@ -52,11 +52,11 @@ >> docs: >> >> release_spec: >> $(INSTALL_DIR) $(EXRELSYSDIR) >> $(INSTALL_DATA) $(TESTSRC) sudoku.hrl $(EXRELSYSDIR) >> - $(INSTALL_PROGRAM) $(TESTTARGETS) $(EXRELSYSDIR) >> + $(INSTALL_DATA) $(TESTTARGETS) $(EXRELSYSDIR) >> >> release_tests_spec: >> >> release_docs_spec: >> > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-patches > From egil@REDACTED Wed Apr 15 12:13:16 2009 From: egil@REDACTED (=?ISO-8859-1?Q?Bj=F6rn-Egil_Dahlberg?=) Date: Wed, 15 Apr 2009 12:13:16 +0200 Subject: [erlang-patches] R13A patches for os_mon on dragonfly In-Reply-To: <20090412071246.GA53449@k2r.org> References: <20090405134412.5f4201a6@horse.intern> <49D9FB20.4050703@erix.ericsson.se> <20090412071246.GA53449@k2r.org> Message-ID: <49E5B33C.8040506@erix.ericsson.se> Hi, The patch was applied by hand and a typo was introduced. Never do something yourself that a machine can do better ... The corrected version is now in r13b. // Bj?rn-Egil Erlang/OTP Kenji Rikitake wrote: > Dear Bjorn and the list members: > > R13B as of 2009-04-11 is broken for FreeBSD 7.1-RELEASE. > Please fix it as proposed. > > Kenji Rikitake > > R13B snapshot of 2009-04-11 > has broken lib/os_mon/c_src/memsup.c > for FreeBSD 7.1-RELEASE > by Kenji Rikitake 12-APR-2009 > > Symptom: compilation error on lib/os_mon/c_src/memsup.c > > Possible reason: > > memsup.c was mangled between R13A and R13B, while trying to > patch according to the "patch-aa" file in the following patch set > for DragonFly BSD: > > http://erlang.org/pipermail/erlang-patches/2009-April/000395.html > > Workaround: > > Apply the patch "patch-aa" in the above article AS IS, as follows. > > --- lib/os_mon/c_src/memsup.c.FCS 2009-04-08 18:57:44.000000000 +0900 > +++ lib/os_mon/c_src/memsup.c 2009-04-12 15:50:34.000000000 +0900 > @@ -114,11 +114,11 @@ > #include > #include > #if !defined (__OpenBSD__) && !defined (__NetBSD__) > #include > #endif > -#if defined (__FreeBSD__) && defined(__DragonFly__) > +#if defined (__FreeBSD__) || defined(__DragonFly__) > #include > #endif > #endif > > #if defined (__linux__) From davidepesa@REDACTED Fri Apr 17 23:34:49 2009 From: davidepesa@REDACTED (Davide Pesavento) Date: Fri, 17 Apr 2009 23:34:49 +0200 Subject: [erlang-patches] Build system ignores LDFLAGS In-Reply-To: <2da21fe50904040405p5a1daae7ja6a0ac8868de406f@mail.gmail.com> References: <2da21fe50903311313h11e175dfwee2a6b742deacc2d@mail.gmail.com> <2da21fe50904040405p5a1daae7ja6a0ac8868de406f@mail.gmail.com> Message-ID: <2da21fe50904171434o51133324vc667cc4e966063b2@mail.gmail.com> On Sat, Apr 4, 2009 at 13:05, Davide Pesavento wrote: > On Tue, Mar 31, 2009 at 22:13, Davide Pesavento wrote: >> Hello, >> >> Erlang's build system seems to ignore custom LDFLAGS. This is the QA >> warning shown by Portage (Gentoo Linux's package manager) after >> building R12B-5 with LDFLAGS="-Wl,-O1 -Wl,--as-needed >> -Wl,--hash-style=gnu" >> >> QA Notice: Files built without respecting LDFLAGS have been detected >> ?Please include the following list of files in your report: >> /usr/lib64/erlang/lib/runtime_tools-1.7.3/priv/lib/trace_file_drv.so >> /usr/lib64/erlang/lib/runtime_tools-1.7.3/priv/lib/trace_ip_drv.so >> /usr/lib64/erlang/lib/megaco-3.9.1.1/priv/lib/megaco_flex_scanner_drv_mt.so >> /usr/lib64/erlang/lib/megaco-3.9.1.1/priv/lib/megaco_flex_scanner_drv.so >> /usr/lib64/erlang/lib/erl_interface-3.5.9/bin/erl_call >> /usr/lib64/erlang/lib/ssl-3.10/priv/bin/ssl_esock >> /usr/lib64/erlang/lib/asn1-1.6.2/priv/lib/asn1_erl_drv.so >> /usr/lib64/erlang/lib/crypto-1.5.3/priv/lib/crypto_drv.so >> /usr/lib64/erlang/lib/common_test-1.3.4/priv/lib/erl_rx_driver.so >> /usr/lib64/erlang/erts-5.6.5/bin/child_setup >> >> Before digging into the Makefiles, I'd like to know if you already >> have some ideas about the root cause of this issue. >> > > This bug is still present in R13A. > > ?* QA Notice: Files built without respecting LDFLAGS have been detected > ?* ?Please include the following list of files in your report: > ?* /usr/lib64/erlang/lib/runtime_tools-1.8/priv/lib/trace_file_drv.so > ?* /usr/lib64/erlang/lib/runtime_tools-1.8/priv/lib/trace_ip_drv.so > ?* /usr/lib64/erlang/lib/erl_interface-3.6/bin/erl_call > ?* /usr/lib64/erlang/lib/crypto-1.6/priv/lib/crypto_drv.so > ?* /usr/lib64/erlang/lib/megaco-3.10.0.1/priv/lib/megaco_flex_scanner_drv_mt.so > ?* /usr/lib64/erlang/lib/megaco-3.10.0.1/priv/lib/megaco_flex_scanner_drv.so > ?* /usr/lib64/erlang/lib/ssl-3.10.1/priv/bin/ssl_esock > ?* /usr/lib64/erlang/lib/asn1-1.6.8/priv/lib/asn1_erl_drv.so > ?* /usr/lib64/erlang/erts-5.7/bin/child_setup > > Best regards, > Davide > The attached patch fixes the problem for me: LDFLAGS are now respected. Regards, Davide -------------- next part -------------- A non-text attachment was scrubbed... Name: erlang-R13A-LDFLAGS.patch Type: application/octet-stream Size: 4225 bytes Desc: not available URL: From pfisher@REDACTED Wed Apr 22 16:03:48 2009 From: pfisher@REDACTED (Paul Fisher) Date: Wed, 22 Apr 2009 09:03:48 -0500 Subject: [erlang-patches] Producing dependencies Makefile for Erlang using erlc(1) In-Reply-To: <49087D61.4020104@dumbbell.fr> References: <49087D61.4020104@dumbbell.fr> Message-ID: <49EF23C4.60309@alertlogic.net> Did anything ever happen with this patch? I would love to see such a thing added to erlc, since for better or worse, we do use .hrl files for record and guard definitions pretty heavily. -- paul Jean-S?bastien P?dron wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello, > > When using erlc(1) and standard Makefiles to compile Erlang source > files, there's currently no way to track header dependencies. Thus, if a > header is modified, a module that depends on it will be recompiled only > if the dependency is explicitly indicated in the Makefile. This becomes > problematic when the header is external (for instance, a header from > another application, such as xmerl.hrl). > > Attached is a patch that adds support for producing dependencies > Makefiles to erlc(1) and compiler(3). It was modeled after GCC. > > For example, let's take the following module: > -module(mod1). > -include("header1.hrl"). > ... > > The command "erlc -M mod1.erl" will output: > mod1.beam: mod1.erl header1.hrl > > The patch adds the following options to erlc(1) and compiler(3): > > -M generate a rule describing dependencies; output on > stdout. > -MF File rule(s) is(are) written to `File'. > -MT Target change the name of the rule emitted. > -MQ Target same as -MT but quote special characters for make(1). > -MG consider missing headers as generated files and add the > to the dependencies > -MP add a phony target for each dependency. > -MD same as -M -MT file.Pbeam > > They're the same as GCC. The following options are not supported: > > -MM ignore system headers > -MMD same as -MD but ignore system headers > > I choose to keep the same names as GCC because I'm working on Erlang > support in Automake and it wants to use these options. Regarding > compiler(3), options could have a more Erlang-fashion name. > > The patch, against R12B-4, includes the documentation updates. But I > don't know how to make it, so it's untested. > > Thanks, > > PS: I already sent an older patch to erlang-questions@ more than a year > ago. The attached patch obsoletes it. > > - -- > Jean-S?bastien P?dron > http://www.dumbbell.fr/ > > PGP Key: http://www.dumbbell.fr/pgp/pubkey.asc > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (FreeBSD) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkkIfWAACgkQa+xGJsFYOlP9swCdGsB6Ydsa6yTz3dLijCeyFAGh > NzgAoMAsrNe2oEan+1ItXO+IuRVuSNwU > =GOml > -----END PGP SIGNATURE----- > From kenji.rikitake@REDACTED Mon Apr 27 02:04:24 2009 From: kenji.rikitake@REDACTED (Kenji Rikitake) Date: Mon, 27 Apr 2009 09:04:24 +0900 Subject: [erlang-patches] R13B *private* port for FreeBSD with necessary patches In-Reply-To: <20090412072053.GB53553@k2r.org> References: <20090412053333.GA51822@k2r.org> <20090412072053.GB53553@k2r.org> Message-ID: <20090427000424.GA13162@k2r.org> I've compiled a *private* (= unofficial) R13B port for FreeBSD with necessary patches (mostly from Giacomo Olgeni) and one from me (about SCTP). This port is now under testing on FreeBSD 7.1-RELEASE. It is still preliminary so your feedback is welcome. I hope Giacomo will release the official one soon. The tar archive URL is at http://www.ne.jp/asahi/bdx/info/software/erlang-port-R13B-20090427-0.tar.gz Regards, Kenji Rikitake From ext@REDACTED Mon Apr 27 11:31:48 2009 From: ext@REDACTED (David Sveningsson) Date: Mon, 27 Apr 2009 11:31:48 +0200 Subject: [erlang-patches] Producing dependencies Makefile for Erlang using erlc(1) In-Reply-To: <49EF23C4.60309@alertlogic.net> References: <49087D61.4020104@dumbbell.fr> <49EF23C4.60309@alertlogic.net> Message-ID: <49F57B84.3030409@sidvind.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Paul Fisher wrote: > Did anything ever happen with this patch? I would love to see such a > thing added to erlc, since for better or worse, we do use .hrl files for > record and guard definitions pretty heavily. > > > -- > paul I would also like to see this functionality added. Currently I use grep+sed magic to create dependency rules. > Jean-S?bastien P?dron wrote: > Hello, > > When using erlc(1) and standard Makefiles to compile Erlang source > files, there's currently no way to track header dependencies. Thus, if a > header is modified, a module that depends on it will be recompiled only > if the dependency is explicitly indicated in the Makefile. This becomes > problematic when the header is external (for instance, a header from > another application, such as xmerl.hrl). > > Attached is a patch that adds support for producing dependencies > Makefiles to erlc(1) and compiler(3). It was modeled after GCC. > > For example, let's take the following module: > -module(mod1). > -include("header1.hrl"). > ... > > The command "erlc -M mod1.erl" will output: > mod1.beam: mod1.erl header1.hrl > > The patch adds the following options to erlc(1) and compiler(3): > > -M generate a rule describing dependencies; output on > stdout. > -MF File rule(s) is(are) written to `File'. > -MT Target change the name of the rule emitted. > -MQ Target same as -MT but quote special characters for make(1). > -MG consider missing headers as generated files and add the > to the dependencies > -MP add a phony target for each dependency. > -MD same as -M -MT file.Pbeam > > They're the same as GCC. The following options are not supported: > > -MM ignore system headers > -MMD same as -MD but ignore system headers > > I choose to keep the same names as GCC because I'm working on Erlang > support in Automake and it wants to use these options. Regarding > compiler(3), options could have a more Erlang-fashion name. > > The patch, against R12B-4, includes the documentation updates. But I > don't know how to make it, so it's untested. > > Thanks, > > PS: I already sent an older patch to erlang-questions@ more than a year > ago. The attached patch obsoletes it. > >> > _______________________________________________ > erlang-patches mailing list > erlang-patches@REDACTED > http://www.erlang.org/mailman/listinfo/erlang-patches -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkn1e4QACgkQ6pa1H/H5pqW7HACgqkP7+KjU/jyA9aWpWuiXcRzp VR4Anjc5ykYROfiJOpJ+NS82OkUrO0eg =C8ul -----END PGP SIGNATURE----- From chris@REDACTED Mon Apr 27 16:18:26 2009 From: chris@REDACTED (Christopher Stelma) Date: Mon, 27 Apr 2009 10:18:26 -0400 Subject: [erlang-patches] base64:decode trailing whitespace patch for otp_src_R13B/lib/stdlib/src/base64.erl Message-ID: <4cc93c240904270718w7d85252hd567aa3aad9bdaac@mail.gmail.com> Trailing whitespace (after "=") is stripped, but the return value from base64:strip_spaces is not in the same format expected by base64:decode. example of the problem: ---------------------------------------------------------------------- 3> base64:decode("cXV1eA=="). <<"quux">> 4> base64:decode("cXV1eA==\n"). ** exception error: no function clause matching base64:decode([61,"=Ae1VXc"], {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,...}, []) in function base64:decode/1 ---------------------------------------------------------------------- more specifically to the internal api: ---------------------------------------------------------------------- 7> base64:strip_spaces("foo==\n", []). [61,"=oof"] 8> base64:strip_spaces("foo==", []). "==oof" ---------------------------------------------------------------------- patch attached. -- Christopher Stelma chris@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: base64fix.diff Type: text/x-diff Size: 554 bytes Desc: not available URL: From goryachev@REDACTED Mon Apr 27 18:10:50 2009 From: goryachev@REDACTED (Igor Goryachev) Date: Mon, 27 Apr 2009 20:10:50 +0400 Subject: [erlang-patches] base64:decode trailing whitespace patch for otp_src_R13B/lib/stdlib/src/base64.erl In-Reply-To: <4cc93c240904270718w7d85252hd567aa3aad9bdaac@mail.gmail.com> (Christopher Stelma's message of "Mon, 27 Apr 2009 10:18:26 -0400") References: <4cc93c240904270718w7d85252hd567aa3aad9bdaac@mail.gmail.com> Message-ID: <87ws962i2d.fsf@yandex-team.ru> Christopher Stelma writes: > Trailing whitespace (after "=") is stripped, but the return value from > base64:strip_spaces is not in the same format expected by > base64:decode. > > example of the problem: > > ---------------------------------------------------------------------- > 3> base64:decode("cXV1eA=="). > <<"quux">> > 4> base64:decode("cXV1eA==\n"). > ** exception error: no function clause matching > base64:decode([61,"=Ae1VXc"], > > {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, > > -1,-1,-1,-1,-1,-1,-1,-1,...}, > []) > in function base64:decode/1 > ---------------------------------------------------------------------- Hello, Christopher! Doesn't base64:mime_decode/1 make deal? % erl Erlang (BEAM) emulator version 5.6.3 [source] [smp:2] [async-threads:0] [kernel-poll:false] Eshell V5.6.3 (abort with ^G) 1> base64:mime_decode("cXV1eA==\n"). <<"quux">> 2> -- Igor Goryachev Yandex development team. From chris@REDACTED Mon Apr 27 18:53:19 2009 From: chris@REDACTED (Christopher Stelma) Date: Mon, 27 Apr 2009 12:53:19 -0400 Subject: [erlang-patches] base64:decode trailing whitespace patch for otp_src_R13B/lib/stdlib/src/base64.erl In-Reply-To: <87ws962i2d.fsf@yandex-team.ru> References: <4cc93c240904270718w7d85252hd567aa3aad9bdaac@mail.gmail.com> <87ws962i2d.fsf@yandex-team.ru> Message-ID: <4cc93c240904270953n1d7f291bub56af358880b3e5b@mail.gmail.com> mime_decode does work in this case, but it strips other characters as well. The return value from one case in strip_spaces is not in the correct format. It returns a list of two elements, $= and a string, [$=, A] instead of concatenating and returning a single string [$= | A]. This is the format returned by the strip function for mime_decode, but it removes other characters as well, which may not be correct for every use case. On Mon, Apr 27, 2009 at 12:10 PM, Igor Goryachev wrote: > Christopher Stelma writes: > > > Trailing whitespace (after "=") is stripped, but the return value from > > base64:strip_spaces is not in the same format expected by > > base64:decode. > > > > example of the problem: > > > > ---------------------------------------------------------------------- > > 3> base64:decode("cXV1eA=="). > > <<"quux">> > > 4> base64:decode("cXV1eA==\n"). > > ** exception error: no function clause matching > > base64:decode([61,"=Ae1VXc"], > > > > {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, > > > > -1,-1,-1,-1,-1,-1,-1,-1,...}, > > []) > > in function base64:decode/1 > > ---------------------------------------------------------------------- > > Hello, Christopher! > > Doesn't base64:mime_decode/1 make deal? > > % erl > Erlang (BEAM) emulator version 5.6.3 [source] [smp:2] [async-threads:0] > [kernel-poll:false] > > Eshell V5.6.3 (abort with ^G) > 1> base64:mime_decode("cXV1eA==\n"). > <<"quux">> > 2> > > > -- > Igor Goryachev > Yandex development team. > -- Christopher Stelma chris@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernie@REDACTED Wed Apr 29 08:36:25 2009 From: bernie@REDACTED (Bernard Duggan) Date: Wed, 29 Apr 2009 16:36:25 +1000 Subject: [erlang-patches] Handling of http chunked encoding Message-ID: <49F7F569.5070103@m5net.com> Hi all, We had to make a slight modification to erlang's handling of chunked encoding to make it work with a system we have here. The problem is this: We're using http chunked encoding to implement a long term connection where status updates are periodically sent as http chunks. My understanding is that this is a bit of an abuse of the system (I didn't come up with it, I swear :)), but that it's also not an especially uncommon use. Each status update is a full chunk with the size and complete body. The problem is that the http library won't forward on a chunk to the client process until the size field for the following chunk has been received, due to it wanting to check if it's the last chunk (indicated by the next size field being 0). The net effect is that we can't extract a status update chunk until the next one arrives (which is some indeterminate time away). The attached patch makes a small modification to forward any full chunk received, regardless of whether the size field for the following chunk has been received yet. I'm not sure whether or not you'll want to include it (there may be a very good reason for it working the way it does, and by my understanding it's not technically breaking any rules as it currently works), but it doesn't seem to do any harm and gets clients valid data sooner. The patch is against R13B. Cheers, Bernard -------------- next part -------------- A non-text attachment was scrubbed... Name: http_chunk_patch.diff Type: text/x-diff Size: 1302 bytes Desc: not available URL: