Update of /cvsroot/freenet/freenet/src/freenet/client/http
In directory sc8-pr-cvs1:/tmp/cvs-serv17951/src/freenet/client/http

Modified Files:
        FproxyServlet.java NodeStatusServlet.java SFRContext.java 
        SplitFileRequestServlet.java 
Log Message:
6195: (mostly) asynchronous trailer writing, lots of logging improvements (most code 
supports selective logging now), bugfixes


Index: FproxyServlet.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/http/FproxyServlet.java,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -r1.106 -r1.107
--- FproxyServlet.java  3 Sep 2003 18:10:12 -0000       1.106
+++ FproxyServlet.java  18 Sep 2003 17:48:05 -0000      1.107
@@ -131,7 +131,7 @@
                if (bucketFactory == null) {
                    bucketFactory = bf;
                    if(bucketFactory != null) {
-                       if(logger != null && logger.shouldLog(Logger.DEBUG))
+                       if(logger != null && logger.shouldLog(Logger.DEBUG,this))
                            logger.log(this, "Got BucketFactory from context",
                                       Logger.DEBUG);
                    } else {
@@ -277,7 +277,7 @@
        makeOnlyBucketFactory(tbf);
     
        logger.log(this, "New FproxyServlet created", Logger.MINOR);
-       if(logger.shouldLog(Logger.DEBUG)) {
+       if(logger.shouldLog(Logger.DEBUG,this)) {
            logger.log(this, "   requestHtl = " + requestHtl, Logger.DEBUGGING);
            logger.log(this, "   filter = " + runFilter, Logger.DEBUGGING);
            logger.log(this, "   filterParanoidStringCheck = " + 
filterParanoidStringCheck, 
@@ -303,7 +303,7 @@
        // Stuff that needs to get finalized
        Bucket data = null;
        
-       boolean logDEBUG = logger.shouldLog(Logger.DEBUG);
+       boolean logDEBUG = logger.shouldLog(Logger.DEBUG,this);
        
        try {
            if(logDEBUG) logger.log(this, "Got GET request", Logger.DEBUGGING);
@@ -939,7 +939,7 @@
        try {
            key = URLEncoder.encode(key);
            String encKey = HTMLEncoder.encode(key);
-           boolean logDEBUG = logger.shouldLog(Logger.DEBUG);
+           boolean logDEBUG = logger.shouldLog(Logger.DEBUG,this);
            if(logDEBUG) logger.log(this, "Key before encoding: "+key+
                                    " , key after encoding: "+encKey, Logger.DEBUG);
            PrintWriter pagew = null;
@@ -1230,7 +1230,7 @@
      * @exception  IOException  Description of the Exception
      */
     protected void sendRobots(HttpServletResponse resp) throws IOException {
-       if(logger.shouldLog(Logger.DEBUG)) logger.log(this, "Sending robots.txt", 
Logger.DEBUGGING);
+       if(logger.shouldLog(Logger.DEBUG,this)) logger.log(this, "Sending robots.txt", 
Logger.DEBUGGING);
        OutputStream out = resp.getOutputStream();
 
        //     if (!isLocalConnection) {
@@ -1271,7 +1271,7 @@
            HttpServletResponseImpl.getNameForStatus(status);
 
        // show it
-       if(logger.shouldLog(Logger.DEBUG))
+       if(logger.shouldLog(Logger.DEBUG,this))
            logger.log(this, "Sending HTTP error: " + statusString,
                       Logger.DEBUGGING);
        PrintWriter pw = resp.getWriter();

Index: NodeStatusServlet.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/http/NodeStatusServlet.java,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- NodeStatusServlet.java      2 Sep 2003 17:05:21 -0000       1.69
+++ NodeStatusServlet.java      18 Sep 2003 17:48:06 -0000      1.70
@@ -1368,7 +1368,7 @@
         resp.setStatus(HttpServletResponse.SC_OK);
         resp.setContentType("text/plain");
 
-       boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG);
+       boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
         final StringMap[] refs = rt.getSnapshot().refData();
         if ((refs == null) || (refs.length < 1)) {
             resp.getWriter().println(""); // so that document is not empty.
@@ -1443,7 +1443,7 @@
             HttpServletResponseImpl.getNameForStatus(status);
 
         // show it
-       if(Core.logger.shouldLog(Logger.DEBUG))
+       if(Core.logger.shouldLog(Logger.DEBUG,this))
            Core.logger.log(this, "Sending HTTP error: " + statusString,
                            Logger.DEBUGGING);
         PrintWriter pw = resp.getWriter();

Index: SFRContext.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/http/SFRContext.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- SFRContext.java     18 Jul 2003 18:07:54 -0000      1.24
+++ SFRContext.java     18 Sep 2003 17:48:06 -0000      1.25
@@ -211,7 +211,7 @@
                        return "You must specify the name of a folder writable by "+
                            "the node, or which the node can create";
                    else {
-                       if(logger.shouldLog(Logger.DEBUG)) 
+                       if(logger.shouldLog(Logger.DEBUG,this)) 
                            logger.log(this, "WriteToDisk set to true for "+this,
                                       Logger.DEBUG);
                        writeToDisk = true;
@@ -247,7 +247,7 @@
         // DO NOT call this on the downloading thread.
         // Cancels and releases all resources as soon as possible.
         synchronized void cancel() {
-           boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG);
+           boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
            if(logDEBUG) logger.log(this, "In cancel(), state "+stateAsString(), 
                                    Logger.DEBUG);
             if (canceling) {
@@ -397,7 +397,7 @@
                             else {
                                 // No decoder at all.
                                 decoderErrMsg = "No FEC decoder specified in 
SplitFile metadata!";
-                               if(logger.shouldLog(Logger.DEBUG)) 
+                               if(logger.shouldLog(Logger.DEBUG,this)) 
                                    logger.log(this, "No FEC decoder specified for 
"+uri,
                                               new Exception("debug"), logger.DEBUG);
                             }
@@ -488,7 +488,7 @@
         RequestThread t = null;
         
         void doBackgroundRequest() {
-           if(logger.shouldLog(Logger.DEBUG))
+           if(logger.shouldLog(Logger.DEBUG,this))
                logger.log(this, "doBackgroundRequest for "+this, Logger.DEBUG);
            if(t == null) {
                t = new RequestThread();
@@ -498,7 +498,7 @@
        
        class RequestThread extends Thread {
            public void run() {
-               if(logger.shouldLog(Logger.DEBUG))
+               if(logger.shouldLog(Logger.DEBUG,this))
                    logger.log(this, "Starting RequestThread", Logger.DEBUG);
                try {
                    doRequest(null, null);

Index: SplitFileRequestServlet.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/client/http/SplitFileRequestServlet.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- SplitFileRequestServlet.java        18 Jul 2003 18:07:54 -0000      1.52
+++ SplitFileRequestServlet.java        18 Sep 2003 17:48:06 -0000      1.53
@@ -130,7 +130,7 @@
        else
            filterPassThroughMimeTypes = Node.filterPassThroughMimeTypes;
         logger.log(this, "New SplitFileRequestServlet created", Logger.MINOR);
-       if(logger.shouldLog(Logger.DEBUG)) {
+       if(logger.shouldLog(Logger.DEBUG,this)) {
            logger.log(this, "   requestHtl = " + defaultHtl, Logger.DEBUGGING);
            logger.log(this, "   sfBlockHtl = " + defaultBlockHtl, Logger.DEBUGGING);
            logger.log(this, "   sfRequestRetries = " + defaultRetries, 
@@ -305,7 +305,7 @@
         // Parse out url
         String key = null;
         String path = null;
-       boolean logDEBUG = logger.shouldLog(Logger.DEBUG);
+       boolean logDEBUG = logger.shouldLog(Logger.DEBUG,this);
         try {
            if(logDEBUG) logger.log(this, "Got request: "+key, Logger.DEBUG);
            // getRequestURI() does not include params, so can be decoded
@@ -373,7 +373,7 @@
     protected void onDownload(HttpServletRequest req, HttpServletResponse resp,
                               SFRContext context)
         throws ServletException, IOException {
-       boolean logDEBUG = logger.shouldLog(Logger.DEBUG);
+       boolean logDEBUG = logger.shouldLog(Logger.DEBUG,this);
        if(logDEBUG) logger.log(this, "onDownload(,,"+context+") on "+this,
                                Logger.DEBUG);
         try {
@@ -391,7 +391,7 @@
     protected void onCancel(HttpServletRequest req, HttpServletResponse resp,
                             SFRContext context)
         throws ServletException, IOException {
-       boolean logDEBUG = logger.shouldLog(Logger.DEBUG);
+       boolean logDEBUG = logger.shouldLog(Logger.DEBUG,this);
        if(logDEBUG) logger.log(this, "Called onCancel()", Logger.DEBUG);
         context.cancel();
        if(logDEBUG) logger.log(this, "Out of context.cancel()", Logger.DEBUG);
@@ -641,7 +641,7 @@
                                     SFRContext context)
         throws ServletException, IOException {
        
-       boolean logDEBUG = logger.shouldLog(Logger.DEBUG);
+       boolean logDEBUG = logger.shouldLog(Logger.DEBUG,this);
         // if the download has already started, skip the bottom
         // frame and redirect to the status_progress page.
         if (context.state != STATE_STARTING) {

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to