<HTML>
<HEAD>
<TITLE>Question about http client</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi All,<BR>
<BR>
I am a rank beginner, so please bear with me:<BR>
<BR>
I am fetching Web content from a set of URLs using <a href="http:request">http:request</a>. For most of URLs everything works fine; however for some of them I see error reports on the console that look like so:<BR>
<BR>
<0.49.0> spawned pid <0.50.0> (here my main process spawns another one to do the fetch)<BR>
<BR>
=ERROR REPORT==== 15-Apr-2009::13:29:50 ===<BR>
** Generic server <0.51.0> terminating <BR>
** Last message in was {tcp_closed,#Port<0.1570>}<BR>
** When Server state == {state,<BR>
                            {request,#Ref<0.0.0.67>,<0.50.0>,0,http,<BR>
                                {"message.real.com",80},<BR>
                                "/Msg/7.0/win32",[],get,<BR>
                                {http_request_h,undefined,"keep-alive",<BR>
                                    undefined,undefined,undefined,undefined,<BR>
                                    undefined,undefined,undefined,undefined,<BR>
                                    undefined,undefined,undefined,undefined,<BR>
                                    undefined,undefined,"message.real.com",<BR>
                                    undefined,undefined,undefined,undefined,<BR>
                                    undefined,undefined,undefined,undefined,<BR>
                                    undefined,[],undefined,undefined,<BR>
                                    undefined,undefined,"0",undefined,<BR>
                                    undefined,undefined,undefined,undefined,<BR>
                                    undefined,[]},<BR>
                                {[],[]},<BR>
                                {http_options,"HTTP/1.1",5000,true,[],<BR>
                                    undefined,true},<BR>
                                "<a href="http://message.real.com/Msg/7.0/win32",[]">http://message.real.com/Msg/7.0/win32",[]</a>,<BR>
                                none,[]},<BR>
                            {tcp_session,<BR>
                                {{"message.real.com",80},<0.51.0>},<BR>
                                false,http,#Port<0.1570>,1,keep_alive},<BR>
                            undefined,undefined,undefined,<BR>
                            {httpc_response,parse,[nolimit,true]},<BR>
                            {[],[]},<BR>
                            {[],[]},<BR>
                            new,[],nolimit,nolimit,<BR>
                            {options,<BR>
                                {undefined,[]},<BR>
                                0,2,5,120000,2,disabled,enabled,false},<BR>
                            {timers,<BR>
                                [{#Ref<0.0.0.67>,#Ref<0.0.0.77>}],<BR>
                                undefined},<BR>
                            httpc_manager,undefined}<BR>
** Reason for termination == <BR>
** session_remotly_closed<BR>
<0.50.0>: normal clause "ERLANG: Request error session_remotly_closed on <a href="http://message.real.com/Msg/7.0/win32">http://message.real.com/Msg/7.0/win32</a>" (here my fetched process gets results)<BR>
<BR>
As far as I can tell, session has been remotely closed. I don’t mind a failure like this, but I would like to get rid of the error reports, as I am fetching many, many URLs. I set verbose option to false, and I also catch everything around the call to <a href="http:request">http:request</a> (in fact, the last line in the snippet is my own printout of the normal clause in the try/catch), all to no avail. It seems that what is terminating is not the process I have spawned to do the fetch.<BR>
<BR>
In other cases, I get content properly fetched, and then get an error report with a timeout:<BR>
<BR>
<0.49.0> spawned pid <0.50.0><BR>
<0.50.0>: normal clause "Normal completion"<BR>
<BR>
=ERROR REPORT==== 15-Apr-2009::13:35:05 ===<BR>
** Generic server <0.51.0> terminating <BR>
** Last message in was {timeout,#Ref<0.0.0.67>}<BR>
** When Server state == {state,undefined,<BR>
                            {tcp_session,<BR>
                                {{"links.preplogic.com",80},<0.51.0>},<BR>
                                false,http,#Port<0.1570>,1,keep_alive},<BR>
                            undefined,undefined,undefined,undefined,<BR>
                            {[],[]},<BR>
                            {[],[]},<BR>
                            keep_alive,[],nolimit,nolimit,<BR>
                            {options,<BR>
                                {undefined,[]},<BR>
                                0,2,5,120000,2,disabled,enabled,false},<BR>
                            {timers,[],#Ref<0.0.0.78>},<BR>
                            httpc_manager,undefined}<BR>
** Reason for termination == <BR>
** {{badrecord,request},<BR>
    [{httpc_handler,handle_info,2},<BR>
     {gen_server,handle_msg,5},<BR>
     {proc_lib,init_p_do_apply,3}]}<BR>
<BR>
Could someone in the know help me to solve this issue?<BR>
<BR>
Thanks in advance!</SPAN></FONT>
</BODY>
</HTML>