Show
Ignore:
Timestamp:
01/13/06 23:32:35 (3 years ago)
Author:
edmanm
Message:

Use QAbstractSocket's isValid() method to determine if the control socket is
connected;
Check if the socket is ready for reading and writing before sending or
receiving;
Update the control test code for the method names I changed back in revision
75;
The authenticate() method in TorControl? will handle loading controller
authentication tokens itself, once it's implemented. (maybe)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/control/test/control_test.cpp

    r72 r84  
    3838   
    3939  /* Start Tor */ 
    40   if (!control.startTor(&errmsg)) { 
     40  if (!control.start(&errmsg)) { 
    4141    qDebug() << "Could not start Tor:" << errmsg; 
    4242    return -1; 
     
    4848  if (!control.connect(&errmsg)) { 
    4949    qDebug() << "Could not connect to Tor:" << errmsg; 
    50     control.stopTor(); 
     50    control.stop(); 
    5151    return -1; 
    5252  } else { 
     
    5555 
    5656  /* Authenticate */ 
    57   if (control.authenticate(QByteArray(), &errmsg)) { 
     57  if (control.authenticate(&errmsg)) { 
    5858    qDebug() << "Authentication Successful..."; 
    5959     
     
    7171  /* Disconnect the control socket and stop Tor */ 
    7272  control.disconnect(); 
    73   control.stopTor(); 
     73  control.stop(); 
    7474   
    7575  return 0;