Changeset 7352


Ignore:
Timestamp:
Apr 28, 2017, 1:37:26 PM (5 years ago)
Author:
Nicklas Nordborg
Message:

Merged patch release 3.10.1 to the trunk.

Location:
trunk
Files:
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/clients/web/net/sf/basedb/clients/web/servlet/Download.java

    r7159 r7352  
    185185      dc = sc.newDbControl();
    186186      f = File.getByPath(dc, path, false);
     187      in = f.getDownloadStream(startByte);
    187188      // The ETag is used to support pause/resume when downloading
    188189      // Seems to work without it in Firefox but not in IE
     
    222223      response.setHeader("ETag", eTag);
    223224     
    224       in = f.getDownloadStream(startByte);
    225       dc.close();
     225      dc.commit();
    226226      out = response.getOutputStream();
    227227      response.flushBuffer();
  • trunk/src/core/net/sf/basedb/core/signal/ThreadSignalHandler.java

    r6898 r7352  
    150150 
    151151  /**
     152    If TRUE, at least one ABORT signal has been recieved.
     153    @since 3.10.1
     154  */
     155  private boolean hasAborted;
     156 
     157  /**
    152158    Create a new thread signal handler. It will interrupt the
    153159    current thread when it recieves the {@link Signal#ABORT} signal.
     
    191197    if (Signal.ABORT.equals(signal))
    192198    {
     199      hasAborted = true;
    193200      logger.debug("Sending signal " + signal + " to thread: " + workerThread);
    194201      if (forceStop)
     
    235242  }
    236243 
    237 }
     244  /**
     245    Check if the given signal has been received by this signal handler.
     246    @param signal The signal to check for
     247    @return TRUE if the signal has been received, FALSE otherwise
     248    @since 3.10.1
     249  */
     250  public boolean hasReceived(Signal signal)
     251  {
     252    return hasAborted && signal == Signal.ABORT;
     253  }
     254
     255}
  • trunk/src/core/net/sf/basedb/util/StaticCache.java

    r7324 r7352  
    631631    {
    632632      log.debug("Interrupted while waiting for " + lockType + " lock on: " + key);
     633      Thread.currentThread().interrupt();
    633634      rwLock = null;
    634635    }
  • trunk/src/test/TestFileServer.java

    r7290 r7352  
    2626import java.io.ByteArrayOutputStream;
    2727import java.io.FileInputStream;
     28import java.io.FileWriter;
     29import java.security.SecureRandom;
     30import java.security.cert.Certificate;
    2831import java.security.cert.X509Certificate;
     32import java.util.Base64;
    2933import java.util.Set;
     34
     35import javax.net.ssl.SSLContext;
     36import javax.net.ssl.SSLSocket;
     37import javax.net.ssl.SSLSocketFactory;
     38import javax.net.ssl.TrustManager;
     39import javax.net.ssl.X509TrustManager;
    3040
    3141public class TestFileServer
     
    7585      if (serverCertificateFile != null)
    7686      {
     87        java.io.File certFile = new java.io.File(serverCertificateFile);
     88        if (!certFile.exists())
     89        {
     90          downloadCertificate(name, certFile);
     91        }
     92       
    7793        ByteArrayOutputStream out = new ByteArrayOutputStream();
    78         FileUtil.copy(new FileInputStream(serverCertificateFile), out);
     94        FileUtil.copy(new FileInputStream(certFile), out);
    7995        out.close();
    8096        fs.setServerCertificate(out.toByteArray());
     
    223239    System.out.println(message);
    224240  }
     241 
     242  private static void downloadCertificate(String host, java.io.File certFile)
     243    throws Exception
     244  {
     245    // TrustManager implemenation that trusts all certificates
     246   
     247    TrustManager trustAll = new X509TrustManager()
     248    {
     249      @Override
     250      public X509Certificate[] getAcceptedIssuers()
     251      {
     252        return null;
     253      }
     254      @Override
     255      public void checkClientTrusted(X509Certificate[] certs, String authType)
     256      {}
     257      @Override
     258      public void checkServerTrusted(X509Certificate[] certs, String authType)
     259      {}
     260    };
     261   
     262    SSLSocket socket = null;
     263    FileWriter out = null;
     264    try
     265    {
     266     
     267      // Creates a new SSL context and factory with our trust-all trust manager
     268      SSLContext sc = SSLContext.getInstance("SSL");
     269      sc.init(null, new TrustManager[] { trustAll }, new SecureRandom());
     270      SSLSocketFactory factory = sc.getSocketFactory();
     271     
     272      // Connect to the host
     273      socket = (SSLSocket) factory.createSocket(host, 443);
     274      socket.startHandshake();
     275     
     276      // And get the certificate
     277      Certificate[] certs = socket.getSession().getPeerCertificates();
     278      Certificate cert = certs[0];
     279     
     280      // Save it to the file
     281      out = new FileWriter(certFile);
     282      out.write("-----BEGIN CERTIFICATE-----\n");
     283      out.write(Base64.getEncoder().encodeToString(cert.getEncoded()));
     284      out.write("\n-----END CERTIFICATE-----\n");
     285      out.close();
     286    }
     287    finally
     288    {
     289      if (socket != null) socket.close();
     290      if (out != null) out.close();
     291    }
     292  }
    225293}
  • trunk/www/common/plugin/finish_job.jsp

    r7317 r7352  
    189189        <th>Job description</th>
    190190        <td>
    191           <textarea class="text" rows="4" name="job_description" id="job_description"
     191          <textarea class="text" rows="4" name="description" id="description"
    192192            ><%=HTML.encodeTags(job.getDescription())%></textarea>
    193193        </td>
    194194        <td style="width: 20px;">
    195           <base:zoom textarea="job_description" title="Job description" />
     195          <base:zoom textarea="description" title="Job description" />
    196196        </td>
    197197      </tr>
  • trunk/www/filemanager/fileservers/fileservers.js

    r7333 r7352  
    6666      Buttons.addClickHandler('btnImport', Buttons.runPlugin, attributes);
    6767      Buttons.addClickHandler('btnRunPlugin', Buttons.runPlugin, attributes);
    68      
    69       TabControl.addTabActivateListener('main.annotations', AnnotationsList.loadOnce);
    70       TabControl.addTabActivateListener('main.overview', Overview.loadOnce);
    71       TabControl.addTabActivateListener('main.history', History.loadOnce);
    7268    }
    7369    else if (pageId == 'list-page')
  • trunk/www/impersonate.jsp

    r6167 r7352  
    6161    <input type="hidden" name="again" value="1">
    6262    <input type="hidden" name="redirect" value="">
     63    <input type="hidden" name="useAutoStartPage" value="0">
    6364 
    6465    <div class="content">
  • trunk/www/login.js

    r7114 r7352  
    5454    }
    5555   
    56     if (Exception) Exception.fixWindow();
     56    if (window.Exception) Exception.fixWindow();
    5757  }
    5858 
     
    6464  {
    6565    var frm = document.forms[pLoginForm];
     66    if (!frm.login) return;
    6667    pUseLastLogin = Data.int(frm.login, 'use-last-login', 1);
    6768    if (pUseLastLogin)
Note: See TracChangeset for help on using the changeset viewer.