--- /dev/null
+#ifndef __COMMIO_H__
+#define __COMMIO_H__
+
+#include "fde.h"
+
+class CommIO
+{
+
+public:
+ static inline void NotifyIOCompleted();
+ static void ResetNotifications();
+ static void Initialise();
+ static void NotifyIOClose();
+
+private:
+ static void NULLFDHandler(int, void *);
+ static void FlushPipe();
+ static bool Initialised;
+ static bool DoneSignalled;
+ static int DoneFD;
+ static int DoneReadFD;
+};
+
+
+/* Inline code. TODO: make structued approach to inlining */
+void
+CommIO::NotifyIOCompleted()
+{
+ if (!Initialised)
+ Initialise();
+
+ if (!DoneSignalled) {
+ DoneSignalled = true;
+ FD_WRITE_METHOD(DoneFD, "!", 1);
+ }
+};
+
+#endif
/*
- * $Id: aiops.cc,v 1.2 2005/04/01 21:11:28 serassio Exp $
+ * $Id: aiops.cc,v 1.3 2005/04/06 19:01:02 serassio Exp $
*
* DEBUG: section 43 AIOPS
* AUTHOR: Stewart Forster <slf@connect.com.au>
#if HAVE_SCHED_H
#include <sched.h>
#endif
-#include "comm.h"
+#include "CommIO.h"
#define RIDICULOUS_LENGTH 4096
#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.am,v 1.105 2005/02/07 22:17:55 serassio Exp $
+# $Id: Makefile.am,v 1.106 2005/04/06 19:03:46 serassio Exp $
#
# Uncomment and customize the following to suit your needs:
#
clientStream.h \
comm.cc \
comm.h \
+ CommIO.h \
comm_select.cc \
comm_poll.cc \
comm_epoll.cc \
/*
- * $Id: comm.cc,v 1.402 2005/04/01 21:11:28 serassio Exp $
+ * $Id: comm.cc,v 1.403 2005/04/06 19:01:01 serassio Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
#include "StoreIOBuffer.h"
#include "comm.h"
#include "fde.h"
+#include "CommIO.h"
#include "ConnectionDetail.h"
#if defined(_SQUID_CYGWIN_)
void
CommIO::FlushPipe() {
char buf[256];
- read(DoneReadFD, buf, sizeof(buf));
+ FD_READ_METHOD(DoneReadFD, buf, sizeof(buf));
}
void
extern void commCheckHalfClosed(void *);
extern bool comm_has_incomplete_write(int);
-/* Where should this belong? */
-
-class CommIO
-{
-
-public:
- static inline void NotifyIOCompleted();
- static void ResetNotifications();
- static void Initialise();
- static void NotifyIOClose();
-
-private:
- static void NULLFDHandler(int, void *);
- static void FlushPipe();
- static bool Initialised;
- static bool DoneSignalled;
- static int DoneFD;
- static int DoneReadFD;
-};
-
/* Not sure where these should live yet */
class Acceptor
void removeCheck (int const);
};
-/* Inline code. TODO: make structued approach to inlining */
-void
-CommIO::NotifyIOCompleted()
-{
- if (!Initialised)
- Initialise();
-
- if (!DoneSignalled) {
- DoneSignalled = true;
- write(DoneFD, "!", 1);
- }
-};
-
#endif