summaryrefslogtreecommitdiff
authordwmw2 <dwmw2>2003-06-07 15:49:06 (UTC)
committer dwmw2 <dwmw2>2003-06-07 15:49:06 (UTC)
commite02157a68d186a17778d3b393a327660df5fbac3 (patch) (unidiff)
tree3abede8e557239579041511b973c15a2d9e0f273
parent1a7addc9f586b35c4c4f5025030349c3064bc3b7 (diff)
downloadopie-e02157a68d186a17778d3b393a327660df5fbac3.zip
opie-e02157a68d186a17778d3b393a327660df5fbac3.tar.gz
opie-e02157a68d186a17778d3b393a327660df5fbac3.tar.bz2
Don't close the tty before invoking pppd. It makes it difficult to use.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/connect.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/ppp/connect.cpp b/noncore/settings/networksettings/ppp/connect.cpp
index 798431b..6905d79 100644
--- a/noncore/settings/networksettings/ppp/connect.cpp
+++ b/noncore/settings/networksettings/ppp/connect.cpp
@@ -767,129 +767,132 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
767 // call to setExpect otherwise the expect will miss a string 767 // call to setExpect otherwise the expect will miss a string
768 // that is already in the buffer. 768 // that is already in the buffer.
769 scriptindex++; 769 scriptindex++;
770 setExpect(scriptArgument); 770 setExpect(scriptArgument);
771 loopnest--; 771 loopnest--;
772 loopend = true; 772 loopend = true;
773 } 773 }
774 messg->setText(bm); 774 messg->setText(bm);
775 emit debugMessage(bm); 775 emit debugMessage(bm);
776 776
777 } 777 }
778 } 778 }
779 } 779 }
780 780
781 // this is a subroutine for the "Answer" script option 781 // this is a subroutine for the "Answer" script option
782 782
783 if(vmain == 150) { 783 if(vmain == 150) {
784 if(!expecting) { 784 if(!expecting) {
785 writeline(_ifaceppp->data()->modemAnswerStr()); 785 writeline(_ifaceppp->data()->modemAnswerStr());
786 setExpect(_ifaceppp->data()->modemAnswerResp()); 786 setExpect(_ifaceppp->data()->modemAnswerResp());
787 787
788 vmain = 2; 788 vmain = 2;
789 scriptindex++; 789 scriptindex++;
790 return; 790 return;
791 } 791 }
792 } 792 }
793 793
794 if(vmain == 30) { 794 if(vmain == 30) {
795// if (termwindow->isVisible()) 795// if (termwindow->isVisible())
796// return; 796// return;
797// if (termwindow->pressedContinue()) 797// if (termwindow->pressedContinue())
798// vmain = 10; 798// vmain = 10;
799// else 799// else
800 cancelbutton(); 800 cancelbutton();
801 } 801 }
802 802
803 if(vmain == 10) { 803 if(vmain == 10) {
804 if(!expecting) { 804 if(!expecting) {
805 805
806 int result; 806 int result;
807 807
808 timeout_timer->stop(); 808 timeout_timer->stop();
809 if_timeout_timer->stop(); // better be sure. 809 if_timeout_timer->stop(); // better be sure.
810 810
811 // stop reading of data 811 // stop reading of data
812 _ifaceppp->modem()->stop(); 812 _ifaceppp->modem()->stop();
813 813
814 if(_ifaceppp->data()->authMethod() == AUTH_TERMINAL) { 814 if(_ifaceppp->data()->authMethod() == AUTH_TERMINAL) {
815 // if (termwindow) { 815 // if (termwindow) {
816 // delete termwindow; 816 // delete termwindow;
817 // termwindow = 0L; 817 // termwindow = 0L;
818 // this->show(); 818 // this->show();
819 // } else { 819 // } else {
820 // termwindow = new LoginTerm(0L, 0L); 820 // termwindow = new LoginTerm(0L, 0L);
821 // hide(); 821 // hide();
822 // termwindow->show(); 822 // termwindow->show();
823 // vmain = 30; 823 // vmain = 30;
824 // return; 824 // return;
825 // } 825 // }
826 } 826 }
827 827
828 // Close the tty. This prevents the QTimer::singleShot() in 828 // Close the tty. This prevents the QTimer::singleShot() in
829 // Modem::readtty() from re-enabling the socket notifier. 829 // Modem::readtty() from re-enabling the socket notifier.
830 // The port is still held open by the helper process. 830 // The port is still held open by the helper process.
831 _ifaceppp->modem()->closetty(); 831
832 /* Er, there _is_ not QTimer::singleShot() in Modem::readtty(),
833 and closing the thing prevents pppd from using it later. */
834 //_ifaceppp->modem()->closetty();
832 835
833 killTimer( main_timer_ID ); 836 killTimer( main_timer_ID );
834 837
835 if_timeout_timer->start(_ifaceppp->data()->pppdTimeout()*1000); 838 if_timeout_timer->start(_ifaceppp->data()->pppdTimeout()*1000);
836 qDebug( "started if timeout timer with %i", _ifaceppp->data()->pppdTimeout()*1000); 839 qDebug( "started if timeout timer with %i", _ifaceppp->data()->pppdTimeout()*1000);
837 840
838 // find out PPP interface and notify the stats module 841 // find out PPP interface and notify the stats module
839// stats->setUnit(pppInterfaceNumber()); 842// stats->setUnit(pppInterfaceNumber());
840 843
841 qApp->flushX(); 844 qApp->flushX();
842 semaphore = true; 845 semaphore = true;
843 result = execppp(); 846 result = execppp();
844 847
845 emit debugMessage(i18n("Starting pppd...")); 848 emit debugMessage(i18n("Starting pppd..."));
846 qDebug("execppp() returned with return-code %i", result ); 849 qDebug("execppp() returned with return-code %i", result );
847 850
848 if(result) { 851 if(result) {
849 if(!_ifaceppp->data()->autoDNS()) 852 if(!_ifaceppp->data()->autoDNS())
850 adddns( _ifaceppp ); 853 adddns( _ifaceppp );
851 854
852 // O.K we are done here, let's change over to the if_waiting loop 855 // O.K we are done here, let's change over to the if_waiting loop
853 // where we wait for the ppp if (interface) to come up. 856 // where we wait for the ppp if (interface) to come up.
854 857
855 emit if_waiting_signal(); 858 emit if_waiting_signal();
856 } else { 859 } else {
857 860
858 // starting pppd wasn't successful. Error messages were 861 // starting pppd wasn't successful. Error messages were
859 // handled by execppp(); 862 // handled by execppp();
860 if_timeout_timer->stop(); 863 if_timeout_timer->stop();
861 this->hide(); 864 this->hide();
862 messg->setText(""); 865 messg->setText("");
863 //p_kppp->quit_b->setFocus(); 866 //p_kppp->quit_b->setFocus();
864 //p_kppp->show(); 867 //p_kppp->show();
865 qApp->processEvents(); 868 qApp->processEvents();
866 _ifaceppp->modem()->hangup(); 869 _ifaceppp->modem()->hangup();
867 emit stopAccounting(); 870 emit stopAccounting();
868 //p_kppp->con_win->stopClock(); 871 //p_kppp->con_win->stopClock();
869 _ifaceppp->modem()->closetty(); 872 _ifaceppp->modem()->closetty();
870 _ifaceppp->modem()->unlockdevice(); 873 _ifaceppp->modem()->unlockdevice();
871 874
872 } 875 }
873 876
874 return; 877 return;
875 } 878 }
876 } 879 }
877 880
878 // this is a "wait until cancel" entry 881 // this is a "wait until cancel" entry
879 882
880 if(vmain == 20) { 883 if(vmain == 20) {
881 } 884 }
882} 885}
883 886
884 887
885void ConnectWidget::set_con_speed_string() { 888void ConnectWidget::set_con_speed_string() {
886 // Here we are trying to determine the speed at which we are connected. 889 // Here we are trying to determine the speed at which we are connected.
887 // Usually the modem responds after connect with something like 890 // Usually the modem responds after connect with something like
888 // CONNECT 115200, so all we need to do is find the number after CONNECT 891 // CONNECT 115200, so all we need to do is find the number after CONNECT
889 // or whatever the modemConnectResp() is. 892 // or whatever the modemConnectResp() is.
890// p_kppp->con_speed = _ifaceppp->modem()->parseModemSpeed(myreadbuffer); 893// p_kppp->con_speed = _ifaceppp->modem()->parseModemSpeed(myreadbuffer);
891} 894}
892 895
893 896
894 897
895void ConnectWidget::readChar(unsigned char c) { 898void ConnectWidget::readChar(unsigned char c) {