/[mldonkey]/mldonkey/src/utils/net/http_server.ml
ViewVC logotype

Diff of /mldonkey/src/utils/net/http_server.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by spiralvoice, Wed Mar 2 19:28:16 2005 UTC revision 1.13 by spiralvoice, Mon Jun 20 18:38:49 2005 UTC
# Line 345  let complete_multipart_data request ic t Line 345  let complete_multipart_data request ic t
345              |  _ ->              |  _ ->
346                  let tmpfile = Filename.temp_file "http_" "" in                  let tmpfile = Filename.temp_file "http_" "" in
347                  if !debug then begin                  if !debug then begin
348                      lprintf "WARNING: saving to file %s" tmpfile; lprint_newline ();                      lprintf "WARNING: saving to file %s\n" tmpfile;
349                    end;                    end;
350                  let oc = open_out tmpfile in                  let oc = open_out tmpfile in
351                  let rec iter n empty_line =                  let rec iter n empty_line =
# Line 394  let complete_multipart_data request ic t Line 394  let complete_multipart_data request ic t
394              end;              end;
395            raise Exit            raise Exit
396        | [] ->        | [] ->
397            if !debug then begin            if !debug then lprintf "NO LINES\n";
               lprintf "NO LINES"; lprint_newline ();  
             end;  
398            raise Exit            raise Exit
399      in      in
400      if !end_boundary_found then field :: previous else      if !end_boundary_found then field :: previous else
# Line 408  let complete_multipart_data request ic t Line 406  let complete_multipart_data request ic t
406    
407  let parse_post_args f len req b =  let parse_post_args f len req b =
408  (* parse post args *)  (* parse post args *)
409    lprintf "CALL HANDLR"; lprint_newline ();    lprintf "CALL HANDLR\n";
410    let s = String.sub b.rbuf b.rpos len in    let s = String.sub b.rbuf b.rpos len in
411    Select.buf_used b len;    Select.buf_used b len;
412    let args = Url.cut_args s in    let args = Url.cut_args s in
# Line 417  let parse_post_args f len req b = Line 415  let parse_post_args f len req b =
415    f b req    f b req
416        
417  let check_len f len b pos2 =  let check_len f len b pos2 =
418    lprintf "check_len: len %d rlen %d" len b.rlen; lprint_newline ();    lprintf "check_len: len %d rlen %d\n" len b.rlen;
419    if b.rlen >= len then f b    if b.rlen >= len then f b
420    
421  let complete_post_request ( f : handler ) buf request =  let complete_post_request ( f : handler ) buf request =
422    let len = request.options.content_length in    let len = request.options.content_length in
423    lprintf "check_len: len %d rlen %d" len buf.rlen; lprint_newline ();    lprintf "check_len: len %d rlen %d\n" len buf.rlen;
424    if buf.rlen >= len then    if buf.rlen >= len then
425      parse_post_args f len request buf      parse_post_args f len request buf
426    else    else
# Line 637  let give_doc buf request = Line 635  let give_doc buf request =
635      stream_out_string buf ans;      stream_out_string buf ans;
636      at_write_end buf.fd_task shutdown;      at_write_end buf.fd_task shutdown;
637    with e ->    with e ->
638        lprintf "No such file: %s (%s)" file (Printexc2.to_string e);        lprintf "No such file: %s (%s)\n" file (Printexc2.to_string e);
       lprint_newline ();  
639        simple_error_404 buf;        simple_error_404 buf;
640        at_write_end buf.fd_task shutdown        at_write_end buf.fd_task shutdown
641  *)        *)      

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26