]> err.no Git - sope/blob - skyrix-sope/NGObjWeb/WOHttpAdaptor/WORequestParser.h
added svn:keywords and svn:ignore where appropriate. removed CVS artifacts.
[sope] / skyrix-sope / NGObjWeb / WOHttpAdaptor / WORequestParser.h
1 /*
2   Copyright (C) 2000-2004 SKYRIX Software AG
3
4   This file is part of OpenGroupware.org.
5
6   OGo is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #ifndef __WOHttpAdaptor_WORequestParser_H__
24 #define __WOHttpAdaptor_WORequestParser_H__
25
26 #import <Foundation/NSObject.h>
27
28 /*
29   WORequestParser (NOT FINISHED YET)
30   
31   A specialized parser for WO HTTP requests. It has some advanced features
32   like streaming large request bodies to disk and mapping them into memory
33   instead of keeping the whole thing in memory all the time.
34   It also correctly works with HTTP methods that have no content-length
35   specified (the NGHttpParser tries to parse till EOF by default).
36
37   Note: since the parser keep transient state in the ivars, you need to have
38   at least one parser per thread when running in a multithreaded environment.
39   
40   Note: if parsing fails you *need* to close the socket connection !
41 */
42
43 @class NSException;
44 @class NGBufferedStream;
45 @class WORequest;
46
47 @interface WORequestParser : NSObject
48 {
49   NGBufferedStream *in;
50   NSException *lastException;
51   int (*readByte)(id,SEL);
52   
53   /* transient */
54   unsigned char pushBack;
55 }
56
57 - (id)initWithBufferedStream:(NGBufferedStream *)_in;
58
59 /* parsing */
60
61 - (WORequest *)parseNextRequest;
62 - (NSException *)lastException;
63
64 @end
65
66 #endif /* __WOHttpAdaptor_WORequestParser_H__ */