Hello community,
here is the log from the commit of package opensuse-updater
checked in at Thu Nov 16 16:14:30 CET 2006.
--------
--- KDE/opensuse-updater/opensuse-updater.changes 2006-11-14 19:21:34.000000000 +0100
+++ /mounts/work_src_done/STABLE/opensuse-updater/opensuse-updater.changes 2006-11-16 14:18:26.000000000 +0100
@@ -1,0 +2,7 @@
+Thu Nov 16 14:15:03 CET 2006 - dmacvicar@suse.de
+
+- Dont use xmlrpc over http, but direct to the socket.
+ (#218468). Zenworks backend working again.
+- r457
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ opensuse-updater.spec ++++++
--- /var/tmp/diff_new_pack.nWh60c/_old 2006-11-16 16:14:17.000000000 +0100
+++ /var/tmp/diff_new_pack.nWh60c/_new 2006-11-16 16:14:17.000000000 +0100
@@ -15,7 +15,7 @@
Group: System/Management
Summary: KDE updater applet for OpenSUSE
Version: 0.4
-Release: 11
+Release: 13
URL: http://en.opensuse.org/KDE_Updater_Applet
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: opensuseupdater-%{version}.tar.bz2
@@ -70,6 +70,10 @@
/opt/kde3/share/config.kcfg/opensuseupdater_settings.kcfg
%changelog -n opensuse-updater
+* Thu Nov 16 2006 - dmacvicar@suse.de
+- Dont use xmlrpc over http, but direct to the socket.
+ (#218468). Zenworks backend working again.
+- r457
* Tue Nov 14 2006 - dmacvicar@suse.de
- fix autostart (#220209)
- allow checking from the UI (#219954)
++++++ opensuseupdater-0.4.tar.bz2 ++++++
Binary files old/opensuseupdater-0.4/doc/en/index.cache.bz2 and new/opensuseupdater-0.4/doc/en/index.cache.bz2 differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/opensuseupdater-0.4/kxmlrpcclient/kxmlrpcquery.cpp new/opensuseupdater-0.4/kxmlrpcclient/kxmlrpcquery.cpp
--- old/opensuseupdater-0.4/kxmlrpcclient/kxmlrpcquery.cpp 2006-10-02 11:09:12.000000000 +0200
+++ new/opensuseupdater-0.4/kxmlrpcclient/kxmlrpcquery.cpp 2006-11-16 14:09:25.000000000 +0100
@@ -1,4 +1,5 @@
/**************************************************************************
+* Copyright (C) 2006 by Novell Inc. *
* Copyright (C) 2006 by Narayan Newton *
* Copyright (C) 2003 - 2004 by Frerich Raabe *
* Tobias Koenig *
@@ -9,6 +10,12 @@
* (at your option) any later version. *
***************************************************************************/
+#include
+#include
+#include
+#include
+#include
+
#include
#include
#include
@@ -18,6 +25,8 @@
#include "kxmlrpcquery.h"
+using namespace KNetwork;
+
/**
@file
@@ -25,77 +34,106 @@
Implementation of KXmlRpcResult and KXmlRpcQuery
**/
-
-
//small macro taken from HTTP IOSlave
#define KIO_ARGS QByteArray packedArgs; QDataStream kioArgsStream( packedArgs, IO_WriteOnly ); kioArgsStream
+#define ZMD_UNIX_SOCKET "/var/run/zmd/zmd-web.socket"
+#define BUFFER_SIZE 6000
+
KXmlRpcQuery *KXmlRpcQuery::create( const QVariant &id, QObject *parent, const char *name ) {
return new KXmlRpcQuery( id, parent, name );
}
-void KXmlRpcQuery::call( const QString &server, const QString &method,
- const QValueList<QVariant> &args, const QString &userAgent ) {
-
- const QString xmlMarkup = markupCall( method, args );
- QByteArray postData;
- QDataStream stream( postData, IO_WriteOnly );
- stream.writeRawBytes( xmlMarkup.utf8(), xmlMarkup.utf8().length() );
-
- KIO_ARGS << (int)1 << KURL(server);
- KIO::TransferJob *job = new KIO::TransferJob(KURL(server), KIO::CMD_SPECIAL, packedArgs, postData, false);
-
- if ( !job ) {
- kdWarning() << "Unable to create KIO job for " << server << endl;
- return;
- }
- job->addMetaData( "UserAgent", userAgent );
- job->addMetaData( "content-type", "Content-Type: text/xml; charset=utf-8" );
- job->addMetaData( "ConnectTimeout", "50" );
-
- connect( job, SIGNAL( data( KIO::Job *, const QByteArray & ) ),
- this, SLOT( slotData( KIO::Job *, const QByteArray & ) ) );
- connect( job, SIGNAL( result( KIO::Job * ) ),
- this, SLOT( slotResult( KIO::Job * ) ) );
-
- m_pendingJobs.append( job );
-}
-
-void KXmlRpcQuery::slotData( KIO::Job *, const QByteArray &data ) {
-
- unsigned int oldSize = m_buffer.size();
- m_buffer.resize( oldSize + data.size() );
- memcpy( m_buffer.data() + oldSize, data.data(), data.size() );
+KXmlRpcQuery::KXmlRpcQuery( const QVariant &id, QObject *parent, const char *name )
+ : QObject( parent, name ), m_id( id )
+{
+
}
-void KXmlRpcQuery::slotResult( KIO::Job *job ) {
-
- m_pendingJobs.remove( job );
-
- if ( job->error() != 0 ) {
-
- emit fault( job->error(), job->errorString(), m_id );
- emit finished( this );
- return ;
- }
+void KXmlRpcQuery::call( const QString &server, const QString &method,
+ const QValueList<QVariant> &args, const QString &userAgent )
+{
- QString data = QString::fromUtf8( m_buffer.data(), m_buffer.size() );
+ struct sockaddr_un serveraddr;
+ struct sockaddr_un clientaddr;
+
+ int sd=-1, rc, bytesReceived;
+ char buffer[BUFFER_SIZE];
+
+ QString xmlMarkup = markupCall( method, args );
+
+ QByteArray postData;
+ QDataStream stream( postData, IO_WriteOnly );
+ stream.writeRawBytes( xmlMarkup.utf8(), xmlMarkup.utf8().length() );
+
+ sd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (sd < 0)
+ {
+ kdError() << "Can't create unix socket." << endl;
+ return;
+ }
+
+ kdDebug() << "socket created" << endl;
+
+ memset(&serveraddr, 0, sizeof(serveraddr));
+ serveraddr.sun_family = AF_UNIX;
+ strcpy(serveraddr.sun_path, ZMD_UNIX_SOCKET);
+
+ rc = ::connect(sd, (struct sockaddr *)&serveraddr, SUN_LEN(&serveraddr));
+ if (rc < 0)
+ {
+ kdError() << "Can't connect unix socket." << endl;
+ return;
+ }
+ kdDebug() << "socket connected" << endl;
+
+ rc = send(sd, postData.data(), postData.size(), 0);
+ if (rc < 0)
+ {
+ kdError() << "Can't send." << endl;
+ return;
+ }
+ kdDebug() << "sent " << rc << " bytes" << endl;
+
+ bytesReceived = 0;
+
+ shutdown(sd,1);
+
+ //rc = recv(sd, & buffer[bytesReceived], BUFFER_SIZE - bytesReceived, 0);
+ rc = read(sd, & buffer[bytesReceived], BUFFER_SIZE - bytesReceived );
+
+ if (rc < 0)
+ {
+ kdError() << "Can't receive" << endl;
+ return;
+ }
+ else if (rc == 0)
+ {
+ kdError() << "Server closed connection" << endl;
+ return;
+ }
+ bytesReceived += rc;
+
+ kdDebug() << "Received " << bytesReceived << " bytes" << endl;
+
+ if (sd != -1)
+ close(sd);
+
+ QString data_s = QString::fromUtf8( buffer, bytesReceived );
+ kdDebug() << "got: " << endl << data_s << endl;
QDomDocument doc;
QString errMsg;
int errLine, errCol;
- if ( !doc.setContent( data, false, &errMsg, &errLine, &errCol ) ) {
-
- emit fault( -1, i18n( "Received invalid XML markup: %1 at %2:%3" )
- .arg( errMsg ).arg( errLine ).arg( errCol ), m_id );
+ if ( !doc.setContent( data_s, false, &errMsg, &errLine, &errCol ) )
+ {
+ emit fault( -1, i18n( "Received invalid XML markup: %1 at %2:%3" ).arg( errMsg ).arg( errLine ).arg( errCol ), m_id );
emit finished( this );
return ;
- }
-
- m_buffer.truncate( 0 );
-
- if ( isMessageResponse( doc ) )
+ }
+
+ if ( isMessageResponse( doc ) )
emit message( parseMessageResponse( doc ).data(), m_id );
else if ( isFaultResponse( doc ) ) {
emit fault( parseFaultResponse( doc ).errorCode(), parseFaultResponse( doc ).errorString(), m_id );
@@ -103,7 +141,7 @@
emit fault( 1, i18n( "Unknown type of XML markup received" ), m_id );
}
- emit finished( this );
+ emit finished( this );
}
bool KXmlRpcQuery::isMessageResponse( const QDomDocument &doc ) const {
@@ -267,13 +305,6 @@
return QVariant();
}
-KXmlRpcQuery::KXmlRpcQuery( const QVariant &id, QObject *parent, const char *name )
- : QObject( parent, name ), m_id( id )
-{}
-
-KXmlRpcQuery::~KXmlRpcQuery() {
-
- QValueListKIO::Job*::Iterator it;
- for ( it = m_pendingJobs.begin(); it != m_pendingJobs.end(); ++it )
- (*it)->kill();
+KXmlRpcQuery::~KXmlRpcQuery()
+{
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/opensuseupdater-0.4/kxmlrpcclient/kxmlrpcquery.h new/opensuseupdater-0.4/kxmlrpcclient/kxmlrpcquery.h
--- old/opensuseupdater-0.4/kxmlrpcclient/kxmlrpcquery.h 2006-10-02 11:09:12.000000000 +0200
+++ new/opensuseupdater-0.4/kxmlrpcclient/kxmlrpcquery.h 2006-11-16 14:05:04.000000000 +0100
@@ -12,6 +12,7 @@
#ifndef _KXML_RPC_QUERY_H_
#define _KXML_RPC_QUERY_H_
+#include
#include
#include
@@ -22,6 +23,7 @@
class QString;
class QDomDocument;
class QDomElement;
+class KNetwork::KBufferedSocket;
/**
@@ -98,11 +100,6 @@
void fault( int, const QString&, const QVariant &id );
void finished( KXmlRpcQuery* );
- private slots:
-
- void slotData( KIO::Job *job, const QByteArray &data );
- void slotResult( KIO::Job *job );
-
private:
bool isMessageResponse( const QDomDocument &doc ) const;
@@ -121,8 +118,6 @@
QByteArray m_buffer;
QVariant m_id;
-
- QValueListKIO::Job* m_pendingJobs;
};
#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/opensuseupdater-0.4/updater/updatersettingswidget_base.cpp new/opensuseupdater-0.4/updater/updatersettingswidget_base.cpp
--- old/opensuseupdater-0.4/updater/updatersettingswidget_base.cpp 2006-11-03 11:21:54.000000000 +0100
+++ new/opensuseupdater-0.4/updater/updatersettingswidget_base.cpp 2006-11-15 18:20:22.000000000 +0100
@@ -3,7 +3,7 @@
/****************************************************************************
** Form implementation generated from reading ui file './updatersettingswidget_base.ui'
**
-** Created: Fri Nov 3 11:21:52 2006
+** Created: Wed Nov 15 18:20:22 2006
** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.6 edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/opensuseupdater-0.4/updater/updatersettingswidget_base.h new/opensuseupdater-0.4/updater/updatersettingswidget_base.h
--- old/opensuseupdater-0.4/updater/updatersettingswidget_base.h 2006-11-03 11:21:52.000000000 +0100
+++ new/opensuseupdater-0.4/updater/updatersettingswidget_base.h 2006-11-15 18:20:20.000000000 +0100
@@ -1,7 +1,7 @@
/****************************************************************************
** Form interface generated from reading ui file './updatersettingswidget_base.ui'
**
-** Created: Fri Nov 3 11:21:52 2006
+** Created: Wed Nov 15 18:20:20 2006
** by: The User Interface Compiler ($Id: qt/main.cpp 3.3.6 edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/opensuseupdater-0.4/updater/zmd/ZmdUpdater.cpp new/opensuseupdater-0.4/updater/zmd/ZmdUpdater.cpp
--- old/opensuseupdater-0.4/updater/zmd/ZmdUpdater.cpp 2006-11-06 17:30:15.000000000 +0100
+++ new/opensuseupdater-0.4/updater/zmd/ZmdUpdater.cpp 2006-11-15 17:37:59.000000000 +0100
@@ -79,7 +79,7 @@
connect(core, SIGNAL(lockListing(QValueList<PackageLock>)),
this, SLOT(gotLockListing(QValueList<PackageLock>)));
#endif
-
+ core->ping();
}
UpdaterCapabilities ZmdUpdater::capabilities()
@@ -517,7 +517,8 @@
// break;
// case ZMD_UDS:
core->setServer(UDS_SERVER_ADDY);
- core->setUser("dmacvicar");
+ //core->setUser("dmacvicar");
+
// break;
//default:
// core->setServer(QString("http://") + TCP_SERVER_ADDY + QString(TCP_SERVER_POSTFIX));
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/opensuseupdater-0.4/updater/zmd/ZmdUpdater.h new/opensuseupdater-0.4/updater/zmd/ZmdUpdater.h
--- old/opensuseupdater-0.4/updater/zmd/ZmdUpdater.h 2006-11-03 17:37:50.000000000 +0100
+++ new/opensuseupdater-0.4/updater/zmd/ZmdUpdater.h 2006-11-15 14:33:35.000000000 +0100
@@ -46,7 +46,9 @@
/* The TCP and UDS address of the local zmd server */
#define TCP_SERVER_ADDY "127.0.0.1"
#define TCP_SERVER_POSTFIX ":2544/zmd/RPC2"
-#define UDS_SERVER_ADDY "udshttp:/var/run/zmd/zmd-web.socket"
+//#define UDS_SERVER_ADDY "udshttp:/var/run/zmd/zmd-web.socket"
+
+#define UDS_SERVER_ADDY "/var/run/zmd/zmd-web.socket"
//Program Options
#define BUGGY_ZMD //turns on bug workarounds for ZMD
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/opensuseupdater-0.4/updater/zmd/ZmdUpdaterCore.cpp new/opensuseupdater-0.4/updater/zmd/ZmdUpdaterCore.cpp
--- old/opensuseupdater-0.4/updater/zmd/ZmdUpdaterCore.cpp 2006-11-03 17:37:41.000000000 +0100
+++ new/opensuseupdater-0.4/updater/zmd/ZmdUpdaterCore.cpp 2006-11-16 13:57:36.000000000 +0100
@@ -69,6 +69,24 @@
server->setUrl(url);
}
+void ZmdUpdaterCore::ping()
+{
+ IS_ZMD_BUSY;
+
+ QValueList<QVariant> data;
+
+ server->call("zmd.system.ping", data,
+ this, SLOT(slotPong(const QValueList<QVariant>&, const QVariant&)),
+ this, SLOT(faultData(int, const QString&, const QVariant&)));
+}
+
+void ZmdUpdaterCore::slotPong(const QValueList<QVariant>&, const QVariant&)
+{
+ kdDebug() << "pong?" << endl;
+ emit pong();
+}
+
+
void ZmdUpdaterCore::addUser(Identity id)
{
IS_ZMD_BUSY;
@@ -168,7 +186,7 @@
void ZmdUpdaterCore::getServices()
{
IS_ZMD_BUSY;
-
+ kdDebug() << k_funcinfo << endl;
server->call("zmd.system.service_list", QValueList<QVariant>(),
this, SLOT(serviceData(const QValueList<QVariant>&, const QVariant&)),
this, SLOT(faultData(int, const QString&, const QVariant&)));
@@ -200,7 +218,7 @@
//Data slot, returning information from xml-rpc
void ZmdUpdaterCore::serviceData(const QValueList<QVariant>& data, const QVariant& t)
{
-
+ kdDebug() << k_funcinfo << endl;
if (data.front().canCast(QVariant::String) == true && data.front().toString().isEmpty() != true)
{
//We get a string back and its not empty, must have come from adding a service
@@ -246,7 +264,7 @@
void ZmdUpdaterCore::getCatalogs()
{
IS_ZMD_BUSY;
-
+ kdDebug() << k_funcinfo << endl;
server->call("zmd.system.catalog_list", QValueList<QVariant>(),
this, SLOT(catalogData(const QValueList<QVariant>&, const QVariant&)),
this, SLOT(faultData(int, const QString&, const QVariant&)));
@@ -280,7 +298,7 @@
void ZmdUpdaterCore::catalogData(const QValueList<QVariant>& data, const QVariant& t)
{
-
+ kdDebug() << k_funcinfo << endl;
if (data.front().canCast(QVariant::String) == true)
{
/*
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/opensuseupdater-0.4/updater/zmd/ZmdUpdaterCore.h new/opensuseupdater-0.4/updater/zmd/ZmdUpdaterCore.h
--- old/opensuseupdater-0.4/updater/zmd/ZmdUpdaterCore.h 2006-11-03 17:37:49.000000000 +0100
+++ new/opensuseupdater-0.4/updater/zmd/ZmdUpdaterCore.h 2006-11-15 17:32:25.000000000 +0100
@@ -81,6 +81,11 @@
~ZmdUpdaterCore();
/**
+ ping the daemon
+ **/
+ void ping();
+
+ /**
This method sets the url for the server, this
also decides whether it uses the http ioslave
or the uds ioslave.
@@ -285,7 +290,7 @@
void cancelTransaction();
signals:
-
+ void pong();
void userListing(QValueList<Identity>);
void serviceListing(QValueList<Service>);
void catalogListing(QValueList<Catalog>);
@@ -333,6 +338,8 @@
private slots:
+ void slotPong(const QValueList<QVariant>&, const QVariant&);
+
void catalogData(const QValueList<QVariant>&, const QVariant&);
void identityData(const QValueList<QVariant>&, const QVariant&);
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org