ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/Search/HttpHandler.h
(Generate patch)

Comparing trunk/Search/HttpHandler.h (file contents):
Revision 12 by douglas, 2002-12-06T12:03:05-08:00 vs.
Revision 13 by douglas, 2002-12-06T19:56:56-08:00

# Line 53 | Line 53
53  
54   #include "Search.h"
55   #include "URL.h"
56 < //#include <jni.h>
56 >
57 > // Lovely C Sockets!
58 > #ifdef _WIN32
59 >
60 > // Windows Sockets
61 > #include <winsock2.h>
62 > #include <windows.h>
63 >
64 > #else
65 >
66 > // BSD Sockets
67 > #include <unistd.h>
68 > #include <sys/types.h>
69 > #include <sys/socket.h>
70 > #include <netinet/in.h>
71 > #include <netdb.h>
72 >
73 > #define INVALID_SOCKET -1
74 > #define SOCKET_ERROR -1
75 >
76 > typedef int SOCKET;
77 >
78 > inline int closesocket(SOCKET s) { return close(s); }
79 >
80 > #endif // _WIN32
81  
82   class HttpHandler
83   {
84   private:
85 < /*      char* jarPath;
62 <        JavaVMOption options[1];
63 <        JNIEnv* env;
64 <        JavaVM* jvm;
65 <        JavaVMInitArgs vm_args;
66 <        long status;
67 <        jclass cls;
68 <        jmethodID mid;*/
85 >        SOCKET http;
86          int begin;
87          string page;
88 < //      void setJarPath();
88 >        string type;
89 >        unsigned length;
90 >        void error(const string prefix, bool host = false);
91   public:
92          HttpHandler();
93          ~HttpHandler();
# Line 76 | Line 95 | public:
95          HttpHandler& getline(string& line, char endline = '\n');
96          bool good();
97          void clear();
98 +        string contentType() { return type; }
99 +        unsigned contentLength() { return length; }
100   };
101  
102   #endif // _HttpHandler_h_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines