Branch: Tag:

1998-08-20

1998-08-20 18:04:52 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Improved debug

Rev: server/protocols/http.pike:1.113

6: Inside #if defined(MAGIC_ERROR)
  #ifdef MAGIC_ERROR   inherit "highlight_pike";   #endif - constant cvs_version = "$Id: http.pike,v 1.112 1998/08/20 07:41:47 per Exp $"; + constant cvs_version = "$Id: http.pike,v 1.113 1998/08/20 18:04:52 grubba Exp $";   // HTTP protocol module.   #include <config.h>   private inherit "roxenlib";
25:   int req_time = HRTIME();   #endif    + #ifdef REQUEST_DEBUG + #define DPERROR(X) roxen_perror((X)+"\n") + #else + #define DPERROR(X) + #endif +    #ifdef FD_DEBUG - #define MARK_FD(X) catch(mark_fd(my_fd->query_fd(), (X)+" "+remoteaddr)) + #define MARK_FD(X) catch{DPERROR(X); mark_fd(my_fd->query_fd(), (X)+" "+remoteaddr);}   #else - #define MARK_FD(X) + #define MARK_FD(X) DPERROR(X)   #endif      constant decode = MIME.decode_base64;
111:      void send(string|object what, int|void len)   { + #ifdef REQUEST_DEBUG +  roxen_perror(sprintf("send(%O, %O)\n", what, len)); + #endif /* REQUEST_DEBUG */ +     if(!what) return;    if(!pipe) setup_pipe();    if(!pipe) return;
890: Inside #if defined(FD_DEBUG)
  #ifdef FD_DEBUG   void timer(int start)   { -  if(pipe) +  if(pipe) { +  // FIXME: Disconnect if no data has been sent for a long while +  // (30min?)    MARK_FD(sprintf("HTTP_piping_%d_%d_%d_%d_(%s)",    pipe->sent,    stringp(pipe->current_input) ?
898: Inside #if defined(FD_DEBUG)
   pipe->last_called,    _time(1) - start,    not_query)); -  else +  } else {    MARK_FD("HTTP piping, but no pipe for "+not_query); -  +  }    call_out(timer, 30, start);   }   #endif
948:    return format_backtrace(bt,eid)+"<hr noshade><pre>"+data+"</pre>";   }    +    // Send the result.   void send_result(mapping|void result)   {
985:    pipe = 0;    return;    } -  my_fd = 0; file = 0; +  my_fd = 0; +  file = 0;    return;    }