|
|
@ -42,26 +42,26 @@ extern "C"
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int kdemain( int argc, char **argv )
|
|
|
|
int kdemain( int argc, char **argv )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug() << "*** kio_msits Init" << endl;
|
|
|
|
kdDebug() << "*** tdeio_msits Init" << endl;
|
|
|
|
|
|
|
|
|
|
|
|
TDEInstance instance( "kio_msits" );
|
|
|
|
TDEInstance instance( "tdeio_msits" );
|
|
|
|
|
|
|
|
|
|
|
|
if ( argc != 4 )
|
|
|
|
if ( argc != 4 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug() << "Usage: kio_msits protocol domain-socket1 domain-socket2" << endl;
|
|
|
|
kdDebug() << "Usage: tdeio_msits protocol domain-socket1 domain-socket2" << endl;
|
|
|
|
exit (-1);
|
|
|
|
exit (-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ProtocolMSITS slave ( argv[2], argv[3] );
|
|
|
|
ProtocolMSITS slave ( argv[2], argv[3] );
|
|
|
|
slave.dispatchLoop();
|
|
|
|
slave.dispatchLoop();
|
|
|
|
|
|
|
|
|
|
|
|
kdDebug() << "*** kio_msits Done" << endl;
|
|
|
|
kdDebug() << "*** tdeio_msits Done" << endl;
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ProtocolMSITS::ProtocolMSITS (const TQCString &pool_socket, const TQCString &app_socket)
|
|
|
|
ProtocolMSITS::ProtocolMSITS (const TQCString &pool_socket, const TQCString &app_socket)
|
|
|
|
: SlaveBase ("kio_msits", pool_socket, app_socket)
|
|
|
|
: SlaveBase ("tdeio_msits", pool_socket, app_socket)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_chmFile = 0;
|
|
|
|
m_chmFile = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -88,12 +88,12 @@ void ProtocolMSITS::get( const KURL& url )
|
|
|
|
chmUnitInfo ui;
|
|
|
|
chmUnitInfo ui;
|
|
|
|
TQByteArray buf;
|
|
|
|
TQByteArray buf;
|
|
|
|
|
|
|
|
|
|
|
|
kdDebug() << "kio_msits::get() " << url.path() << endl;
|
|
|
|
kdDebug() << "tdeio_msits::get() " << url.path() << endl;
|
|
|
|
|
|
|
|
|
|
|
|
if ( !parseLoadAndLookup ( url, fileName ) )
|
|
|
|
if ( !parseLoadAndLookup ( url, fileName ) )
|
|
|
|
return; // error() has been called by parseLoadAndLookup
|
|
|
|
return; // error() has been called by parseLoadAndLookup
|
|
|
|
|
|
|
|
|
|
|
|
kdDebug() << "kio_msits::get: parseLoadAndLookup returned " << fileName << endl;
|
|
|
|
kdDebug() << "tdeio_msits::get: parseLoadAndLookup returned " << fileName << endl;
|
|
|
|
|
|
|
|
|
|
|
|
if ( LCHMUrlFactory::handleFileType( url.path(), htmdata ) )
|
|
|
|
if ( LCHMUrlFactory::handleFileType( url.path(), htmdata ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -110,7 +110,7 @@ void ProtocolMSITS::get( const KURL& url )
|
|
|
|
|
|
|
|
|
|
|
|
if ( !ResolveObject ( fileName, &ui) )
|
|
|
|
if ( !ResolveObject ( fileName, &ui) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug() << "kio_msits::get: could not resolve filename " << fileName << endl;
|
|
|
|
kdDebug() << "tdeio_msits::get: could not resolve filename " << fileName << endl;
|
|
|
|
error( TDEIO::ERR_DOES_NOT_EXIST, url.prettyURL() );
|
|
|
|
error( TDEIO::ERR_DOES_NOT_EXIST, url.prettyURL() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -119,7 +119,7 @@ void ProtocolMSITS::get( const KURL& url )
|
|
|
|
|
|
|
|
|
|
|
|
if ( RetrieveObject (&ui, (unsigned char*) buf.data(), 0, ui.length) == 0 )
|
|
|
|
if ( RetrieveObject (&ui, (unsigned char*) buf.data(), 0, ui.length) == 0 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug() << "kio_msits::get: could not retrieve filename " << fileName << endl;
|
|
|
|
kdDebug() << "tdeio_msits::get: could not retrieve filename " << fileName << endl;
|
|
|
|
error( TDEIO::ERR_NO_CONTENT, url.prettyURL() );
|
|
|
|
error( TDEIO::ERR_NO_CONTENT, url.prettyURL() );
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -235,7 +235,7 @@ void ProtocolMSITS::stat (const KURL & url)
|
|
|
|
TQString fileName;
|
|
|
|
TQString fileName;
|
|
|
|
chmUnitInfo ui;
|
|
|
|
chmUnitInfo ui;
|
|
|
|
|
|
|
|
|
|
|
|
kdDebug() << "kio_msits::stat (const KURL& url) " << url.path() << endl;
|
|
|
|
kdDebug() << "tdeio_msits::stat (const KURL& url) " << url.path() << endl;
|
|
|
|
|
|
|
|
|
|
|
|
if ( !parseLoadAndLookup ( url, fileName ) )
|
|
|
|
if ( !parseLoadAndLookup ( url, fileName ) )
|
|
|
|
return; // error() has been called by parseLoadAndLookup
|
|
|
|
return; // error() has been called by parseLoadAndLookup
|
|
|
@ -246,7 +246,7 @@ void ProtocolMSITS::stat (const KURL & url)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kdDebug() << "kio_msits::stat: adding an entry for " << fileName << endl;
|
|
|
|
kdDebug() << "tdeio_msits::stat: adding an entry for " << fileName << endl;
|
|
|
|
UDSEntry entry;
|
|
|
|
UDSEntry entry;
|
|
|
|
|
|
|
|
|
|
|
|
if ( isDirectory ( fileName ) )
|
|
|
|
if ( isDirectory ( fileName ) )
|
|
|
@ -272,7 +272,7 @@ void ProtocolMSITS::listDir (const KURL & url)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString filepath;
|
|
|
|
TQString filepath;
|
|
|
|
|
|
|
|
|
|
|
|
kdDebug() << "kio_msits::listDir (const KURL& url) " << url.path() << endl;
|
|
|
|
kdDebug() << "tdeio_msits::listDir (const KURL& url) " << url.path() << endl;
|
|
|
|
|
|
|
|
|
|
|
|
if ( !parseLoadAndLookup ( url, filepath ) )
|
|
|
|
if ( !parseLoadAndLookup ( url, filepath ) )
|
|
|
|
return; // error() has been called by parseLoadAndLookup
|
|
|
|
return; // error() has been called by parseLoadAndLookup
|
|
|
@ -285,7 +285,7 @@ void ProtocolMSITS::listDir (const KURL & url)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kdDebug() << "kio_msits::listDir: enumerating directory " << filepath << endl;
|
|
|
|
kdDebug() << "tdeio_msits::listDir: enumerating directory " << filepath << endl;
|
|
|
|
|
|
|
|
|
|
|
|
TQValueVector<TQString> listing;
|
|
|
|
TQValueVector<TQString> listing;
|
|
|
|
|
|
|
|
|
|
|
|