summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/CopyJob.h1
-rw-r--r--include/HttpServ.h18
-rw-r--r--include/ReadJob.h1
-rw-r--r--include/Socket.h2
-rw-r--r--include/Task.h2
5 files changed, 9 insertions, 15 deletions
diff --git a/include/CopyJob.h b/include/CopyJob.h
index a4f4bca..67cbf36 100644
--- a/include/CopyJob.h
+++ b/include/CopyJob.h
@@ -17,7 +17,6 @@ class CopyJob : public Task {
Handle * s, * d;
ssize_t siz, cursiz;
char buffer[COPY_BUFSIZ];
- int current;
};
#else
diff --git a/include/HttpServ.h b/include/HttpServ.h
index 7ac40e2..18295bc 100644
--- a/include/HttpServ.h
+++ b/include/HttpServ.h
@@ -6,6 +6,7 @@
#include <String.h>
#include <Variables.h>
#include <Action.h>
+#include <Task.h>
#include <Exceptions.h>
/*
@@ -16,24 +17,17 @@
* qui est obligatoirement statique et doit posseder l'url /bin/start.
*/
-class HttpServ : public Base {
+class HttpServ : public Task {
public:
HttpServ(int = 1500, const String & = String("GruiK Server v0.1")) throw (GeneralException);
~HttpServ() {}
- void MainLoop(Action *);
+ void SetMenu(Action *);
+ virtual String GetName();
+ protected:
+ virtual int Do();
private:
- String GetMime(const String &);
- void ProcessRequest(Action *, Socket);
- bool ParseUri(String &, String &, Handle *);
- void ParseVars(Handle *, int);
- void ShowError(Handle *);
- void SendHeads(Handle *, const String &);
- void SendRedirect(Handle *);
- String name;
Socket Listener;
- Variables * Vars;
int localport;
- bool bad;
};
extern String endhl, endnl;
diff --git a/include/ReadJob.h b/include/ReadJob.h
index 90ba2c8..5cc4846 100644
--- a/include/ReadJob.h
+++ b/include/ReadJob.h
@@ -14,7 +14,6 @@ class ReadJob : public Task {
virtual String GetName();
private:
Handle * s, * d;
- int current;
};
#else
diff --git a/include/Socket.h b/include/Socket.h
index 9d70205..6bd612c 100644
--- a/include/Socket.h
+++ b/include/Socket.h
@@ -36,7 +36,7 @@ class Socket : public Handle {
bool SetLocal(String, int = 0);
bool Connect(String, int);
bool Listen();
- Socket Accept();
+ Socket Accept() throw (GeneralException);
bool IsConnected();
bool IsListening();
size_t WriteFile(Output &);
diff --git a/include/Task.h b/include/Task.h
index f2d4b0b..1842314 100644
--- a/include/Task.h
+++ b/include/Task.h
@@ -26,6 +26,8 @@ class Task : public Base {
protected:
virtual int Do() throw (GeneralException);
+ int current;
+
private:
int state;
bool suspended;