Gui Bugfixen: Msgpack-error-fixen, Unneccessary-error-message-removen, popup-showen, und lock-contention-reducen.

Viel besser!
unstable
scriptjunkie 2011-12-16 09:52:12 -06:00
parent bb2ea62de8
commit 5bad92e021
6 changed files with 8 additions and 21 deletions

Binary file not shown.

View File

@ -265,6 +265,7 @@ public class DbConnectDialog extends OptionsDialog {
token = s.next();
}
} catch (FileNotFoundException fnfox){
fnfox.printStackTrace();
}
showDefaults();
}

4
external/source/gui/msfguijava/src/msfgui/MainFrame.java vendored Normal file → Executable file
View File

@ -265,7 +265,8 @@ public class MainFrame extends FrameView {
}
publish((Object)jobStrings);
} catch (MsfException msfEx) {
msfEx.printStackTrace();
if(!MsfguiApp.shuttingDown || !msfEx.getMessage().contains("Connection refused"))
msfEx.printStackTrace();
publish("Error getting session list "+msfEx);
if(!msfEx.getMessage().contains("timed out")) // on timeout, just retry
return new ArrayList();
@ -1655,6 +1656,7 @@ nameloop: for (int i = 0; i < names.length; i++) {
});
jobsList.addMouseListener( new PopupMouseListener() {
public void mouseReleased(MouseEvent e){
super.mouseReleased(e);
int indx = jobsList.locationToIndex(e.getPoint());
if (indx == -1)
return;

View File

@ -3,8 +3,6 @@ package msfgui;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.IOException;
@ -199,8 +197,7 @@ public class MeterpFileBrowser extends MsfFrame {
/** Retrieves list of files. */
private void getFiles() {
//Set up locking so the console doesn't eat our output
if(!lock.tryLock())
lock.lock();
lock.lock();
while(model.getRowCount() > 0)
model.removeRow(0);
@ -243,10 +240,8 @@ public class MeterpFileBrowser extends MsfFrame {
for(int i = 0; i < mainTable.getColumnCount(); i++)
if(mainTable.getColumnName(i).equals("Name"))
nameColumn = i;
if(nameColumn != -1){
if(nameColumn != -1)
mainTable.moveColumn(nameColumn, 0);
stop();
}
} catch (Exception ex) {
ex.printStackTrace();
if(ex.getMessage().toLowerCase().contains("unknown session"))

View File

@ -103,7 +103,6 @@ public class OpenConnectionDialog extends javax.swing.JDialog {
String host = info.get("host").toString();
int port = Integer.parseInt(info.get("port").toString());
boolean ssl = Boolean.parseBoolean(info.get("ssl").toString());
String type = info.get("type").toString();
RpcConnection rpc = RpcConnection.getConn(username, password.toCharArray(), host, port, ssl);
if(javax.swing.JOptionPane.showConfirmDialog(null, "Connect to last remembered rpcd?") == javax.swing.JOptionPane.YES_OPTION)
return rpc;

View File

@ -57,16 +57,6 @@ public class ProcessList extends MsfFrame {
this.rpcConn = rpcConn;
this.session = session;
this.lock = (ReentrantLock)sessionPopupMap.get(session.get("id")+"lock");
((DraggableTabbedPane)tabbedPane).setTabFocusListener(0, new FocusListener() {
public void focusGained(FocusEvent e) {
if(!lock.tryLock())
lock.lock();
}
public void focusLost(FocusEvent e) {
while(lock.getHoldCount() > 0)
lock.unlock();
}
});
//See if we need to move our tab
Map props = MsfguiApp.getPropertiesNode();
if(!props.get("tabWindowPreference").equals("window")){
@ -74,13 +64,12 @@ public class ProcessList extends MsfFrame {
(Component)sessionPopupMap.get(session.get("id")+"console")));
DraggableTabbedPane.show(mainPanel);
}
if(!lock.tryLock())
lock.lock();
listProcs();
}
/** Lists the processes that are running */
protected void listProcs() throws HeadlessException {
lock.lock();
if (runCommand("ps"))
return;
readTimer = new Timer(300, new ActionListener() {
@ -113,6 +102,7 @@ public class ProcessList extends MsfFrame {
readTimer.stop();
MsfguiApp.showMessage(null, ex.getMessage());
}
lock.unlock();
}
});
readTimer.start();