Changeset 22c0b8e


Ignore:
Timestamp:
Aug 21, 2009 11:36:21 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
35c9e99
Parents:
cdc184c
Message:
  • profiles.jsp: Bulletproofing, less memory usage
  • Updates: Verify zip at startup before extracting
  • Wrapper: Take a couple fields out of the log so it's narrower
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • installer/resources/wrapper.config

    rcdc184c r22c0b8e  
    118118#wrapper.logfile=$INSTALL_PATH/wrapper.log
    119119
    120 # Format of output for the log file.  (See docs for formats)
    121 wrapper.logfile.format=LPTM
     120# Format of output for the log file.
     121# The format consists of the tokens 'L' for log level, 'P' for prefix, 'D' for thread,
     122# 'T' for time, 'Z' for millisecond time, and 'M' for message
     123# Unfortunately the log timezone cannot be changed, see
     124# http://www.nabble.com/Log-message-timezone-td23651317.html
     125wrapper.logfile.format=TM
    122126
    123127# Log Level for log file output.  (See docs for log levels)
  • router/java/src/net/i2p/router/Router.java

    rcdc184c r22c0b8e  
    11101110            }
    11111111            System.out.println("INFO: Update file exists [" + UPDATE_FILE + "] - installing");
    1112             boolean ok = FileUtil.extractZip(updateFile, _context.getBaseDir());
     1112            // verify the whole thing first
     1113            // we could remember this fails, and not bother restarting, but who cares...
     1114            boolean ok = FileUtil.verifyZip(updateFile);
     1115            if (ok)
     1116                ok = FileUtil.extractZip(updateFile, _context.getBaseDir());
    11131117            if (ok)
    11141118                System.out.println("INFO: Update installed");
     
    11331137                }
    11341138            }
     1139            // exit whether ok or not
    11351140            if (System.getProperty("wrapper.version") != null)
    11361141                System.out.println("INFO: Restarting after update");
  • router/java/src/net/i2p/router/peermanager/ProfileOrganizerRenderer.java

    rcdc184c r22c0b8e  
    112112            RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
    113113            if (info != null) {
    114                 buf.append(" (").append(info.getCapabilities());
     114                // prevent HTML injection in the caps and version
     115                buf.append(" (").append(DataHelper.stripHTML(info.getCapabilities()));
    115116                String v = info.getOption("router.version");
    116117                if (v != null)
    117                     buf.append(' ').append(v);
     118                    buf.append(' ').append(DataHelper.stripHTML(v));
    118119                buf.append(')');
    119120            }
     
    154155            buf.append("&nbsp;<a href=\"configpeer.jsp?peer=").append(peer.toBase64()).append("\">+-</a></td>\n");
    155156            buf.append("</tr>");
     157            // let's not build the whole page in memory (~500 bytes per peer)
     158            out.write(buf.toString());
     159            buf.setLength(0);
    156160        }
    157161        buf.append("</table>");
     
    190194            RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
    191195            if (info != null)
    192                 buf.append("<td align=\"center\">" + info.getCapabilities() + "</td>");
     196                buf.append("<td align=\"center\">").append(DataHelper.stripHTML(info.getCapabilities())).append("</td>");
    193197            else
    194198                buf.append("<td>&nbsp;</td>");
Note: See TracChangeset for help on using the changeset viewer.