3 * This file is part of the KDE project, module kdesu.
4 * Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
7 #ifndef __Handler_h_included__
8 #define __Handler_h_included__
10 #include <sys/types.h>
16 * A ConnectionHandler handles a client. It is called from the main program
17 * loop whenever there is data to read from a corresponding socket.
18 * It keeps reading data until a newline is read. Then, a command is parsed
22 class ConnectionHandler
: public SocketSecurity
26 ConnectionHandler(int fd
);
29 /** Handle incoming data. */
32 /* Send back exit code. */
36 enum Results
{ Res_OK
, Res_NO
};
38 int doCommand(QByteArray buf
);
39 void respond(int ok
, const QByteArray
&s
= QByteArray());
40 QByteArray
makeKey(int namspace
, const QByteArray
&s1
,
41 const QByteArray
&s2
= QByteArray(), const QByteArray
&s3
= QByteArray()) const;
44 int m_Priority
, m_Scheduler
;
45 QByteArray m_Buf
, m_Pass
, m_Host
;