summaryrefslogtreecommitdiff
path: root/core/qws/transferserver.cpp
Unidiff
Diffstat (limited to 'core/qws/transferserver.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/qws/transferserver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/qws/transferserver.cpp b/core/qws/transferserver.cpp
index 777c384..7bf6719 100644
--- a/core/qws/transferserver.cpp
+++ b/core/qws/transferserver.cpp
@@ -1,47 +1,48 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21/* OPIE */ 21/* OPIE */
22#include <opie2/odebug.h> 22#include <opie2/odebug.h>
23 23
24/* STD */
24#define _XOPEN_SOURCE 25#define _XOPEN_SOURCE
25#include <pwd.h> 26#include <pwd.h>
26#include <sys/types.h> 27#include <sys/types.h>
27#include <unistd.h> 28#include <unistd.h>
28#include <stdlib.h> 29#include <stdlib.h>
29#include <time.h> 30#include <time.h>
30 31
31#ifndef Q_OS_MACX 32#ifndef Q_OS_MACX
32#include <shadow.h> 33#include <shadow.h>
33#endif /* Q_OS_MACX */ 34#endif /* Q_OS_MACX */
34 35
35/* we need the _OS_LINUX stuff first ! */ 36/* we need the _OS_LINUX stuff first ! */
36 37
37#ifndef _OS_LINUX_ 38#ifndef _OS_LINUX_
38// Is anybody able to review this ? The include "uuid/uuid.h" couldn't be found 39// Is anybody able to review this ? The include "uuid/uuid.h" couldn't be found
39// anywhere ? Therfore I removed it completely.. 40// anywhere ? Therfore I removed it completely..
40// I think it should be made permanentyl !? (eilers) 41// I think it should be made permanentyl !? (eilers)
41#warning "Where should uuid/uuid.h be found ? Removed this part .. (eilers)" 42#warning "Where should uuid/uuid.h be found ? Removed this part .. (eilers)"
42#if 0 43#if 0
43 44
44extern "C" 45extern "C"
45{ 46{
46#include <uuid/uuid.h> 47#include <uuid/uuid.h>
47#define UUID_H_INCLUDED 48#define UUID_H_INCLUDED
@@ -1106,51 +1107,50 @@ void ServerDTP::connected()
1106 file.close(); 1107 file.close();
1107 emit completed(); 1108 emit completed();
1108 mode = Idle; 1109 mode = Idle;
1109 } 1110 }
1110 else { 1111 else {
1111 1112
1112 if ( !file.atEnd() ) { 1113 if ( !file.atEnd() ) {
1113 QCString s; 1114 QCString s;
1114 s.resize( block_size ); 1115 s.resize( block_size );
1115 int bytes = file.readBlock( s.data(), block_size ); 1116 int bytes = file.readBlock( s.data(), block_size );
1116 writeBlock( s.data(), bytes ); 1117 writeBlock( s.data(), bytes );
1117 } 1118 }
1118 } 1119 }
1119 break; 1120 break;
1120 case SendGzipFile: 1121 case SendGzipFile:
1121 if ( createTargzProc->isRunning() ) { 1122 if ( createTargzProc->isRunning() ) {
1122 // SHOULDN'T GET HERE, BUT DOING A SAFETY CHECK ANYWAY 1123 // SHOULDN'T GET HERE, BUT DOING A SAFETY CHECK ANYWAY
1123 owarn << "Previous tar --gzip process is still running; killing it..." << oendl; 1124 owarn << "Previous tar --gzip process is still running; killing it..." << oendl;
1124 createTargzProc->kill(); 1125 createTargzProc->kill();
1125 } 1126 }
1126 1127
1127 bytes_written = 0; 1128 bytes_written = 0;
1128 odebug << "==>start send tar process" << oendl; 1129 odebug << "==>start send tar process" << oendl;
1129 if ( !createTargzProc->start(Opie::Core::OProcess::NotifyOnExit, Opie::Core::OProcess::Stdout) ) 1130 if ( !createTargzProc->start(Opie::Core::OProcess::NotifyOnExit, Opie::Core::OProcess::Stdout) )
1130 qWarning("Error starting %s or %s", 1131 owarn << "Error starting " << createTargzProc->args()[0].data()
1131 createTargzProc->args()[0].data(), 1132 << " or " << gzipProc->args()[0].data() << oendl;
1132 gzipProc->args()[0].data());
1133 break; 1133 break;
1134 case SendBuffer: 1134 case SendBuffer:
1135 if ( !buf.open( IO_ReadOnly) ) { 1135 if ( !buf.open( IO_ReadOnly) ) {
1136 emit failed(); 1136 emit failed();
1137 mode = Idle; 1137 mode = Idle;
1138 return ; 1138 return ;
1139 } 1139 }
1140 1140
1141 // odebug << "Debug: Sending byte array" << oendl; 1141 // odebug << "Debug: Sending byte array" << oendl;
1142 bytes_written = 0; 1142 bytes_written = 0;
1143 while ( !buf.atEnd() ) 1143 while ( !buf.atEnd() )
1144 putch( buf.getch() ); 1144 putch( buf.getch() );
1145 buf.close(); 1145 buf.close();
1146 break; 1146 break;
1147 case RetrieveFile: 1147 case RetrieveFile:
1148 // retrieve file mode 1148 // retrieve file mode
1149 if ( file.exists() && !file.remove() ) { 1149 if ( file.exists() && !file.remove() ) {
1150 emit failed(); 1150 emit failed();
1151 mode = Idle; 1151 mode = Idle;
1152 return ; 1152 return ;
1153 } 1153 }
1154 1154
1155 if ( !file.open( IO_WriteOnly) ) { 1155 if ( !file.open( IO_WriteOnly) ) {
1156 emit failed(); 1156 emit failed();