Author: rfm
Date: Mon Apr 25 13:08:15 2016
New Revision: 39692

URL: http://svn.gna.org/viewcvs/gnustep?rev=39692&view=rev
Log:
fixup delegate protocol to not include methods the delegate doesn't need

Modified:
    libs/webserver/trunk/WebServer.h

Modified: libs/webserver/trunk/WebServer.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/webserver/trunk/WebServer.h?rev=39692&r1=39691&r2=39692&view=diff
==============================================================================
--- libs/webserver/trunk/WebServer.h    (original)
+++ libs/webserver/trunk/WebServer.h    Mon Apr 25 13:08:15 2016
@@ -232,6 +232,71 @@
 - (BOOL) processRequest: (WebServerRequest*)request
               response: (WebServerResponse*)response
                    for: (WebServer*)http;
+@end
+
+
+/** This is an informal protocol documenting optional methods which will
+ * be used if implemented by the delegate.
+ */
+@interface     NSObject(WebServerDelegate)
+
+/* If your delegate implements this method, it will be called before the
+ * first call to handle a request (ie before -preProcessRequest:response:for:
+ * or -processRequest:response:for:) to provide the delegate with the
+ * request header information and allow it to decide whether the request
+ * body should be processed incrementally (return value is non-zero) or not
+ * (return value is zero).  The returned value is treated as a guide
+ * to how much request data should be buffered at a time.<br />
+ * This method is called <em>before</em> any HTTP basic authentication
+ * is done, and may (if threading is turned on) be called from a thread
+ * other than the master one.<br />
+ * If your delegate turns on incremental parsing for a request, then any
+ * time that more incoming data is read, the web server class will look
+ * at how much data it has and decide (based on the return value from this
+ * method) to call your  -processRequest:response:for: method (preceded
+ * by -preProcessRequest:response:for: if it is implemented) so that you 
+ * can handle the new request data.<br />
+ * Your code can check to see if the request is complete by using the
+ * -isCompletedRequest: method, and can check for the latest data added
+ * to the request body using the * -incrementalDataForRequest: method.
+ */
+- (uint32_t) incrementalRequest: (WebServerRequest*)request
+                            for: (WebServer*)http;
+
+/**
+ * If your delegate implements this method, it will be called by the
+ * -completedWithResponse: method before the response data is actually
+ * written to the client.<br />
+ * This method may re-write the response, changing the result of the
+ * earlier methods.<br />
+ * You may use the [WebServer-userInfoForRequest:] method to obtain
+ * any information passed from an earlier stage of processing.<br />
+ * NB. if threading is turned on this method may be called from a thread
+ * other than the master one.
+ */
+- (void) postProcessRequest: (WebServerRequest*)request
+                  response: (WebServerResponse*)response
+                       for: (WebServer*)http;
+
+/**
+ * If your delegate implements this method, it will be called before the
+ * [(WebServerDelegate)-processRequest:response:for:] method and with the
+ * same parameters.<br />
+ * If this method returns YES, then it is assumed to have completed the
+ * processing of the request and the main
+ * [(WebServerDelegate)-processRequest:response:for:]
+ * method is not called.  Otherwise processing continues as normal.<br />
+ * You may use the [WebServer-setUserInfo:forRequest:] method to pass
+ * information to the [(WebServerDelegate)-processRequest:response:for:]
+ * and/or -postProcessRequest:response:for: methods.<br />
+ * NB. This method is called <em>before</em> any HTTP basic authentication
+ * is done, and may (if threading is turned on) be called from a thread
+ * other than the master one.
+ */
+- (BOOL) preProcessRequest: (WebServerRequest*)request
+                 response: (WebServerResponse*)response
+                      for: (WebServer*)http;
+
 /**
  * Log an error or warning ... if the delegate does not implement this
  * method, the message is logged to stderr using the NSLog function.
@@ -269,70 +334,6 @@
  * method, no logging is done.
  */
 - (void) webLog: (NSString*)message for: (WebServer*)http;
-@end
-
-
-/** This is an informal protocol documenting optional methods which will
- * be used if implemented by the delegate.
- */
-@interface     NSObject(WebServerDelegate)
-
-/* If your delegate implements this method, it will be called before the
- * first call to handle a request (ie before -preProcessRequest:response:for:
- * or -processRequest:response:for:) to provide the delegate with the
- * request header information and allow it to decide whether the request
- * body should be processed incrementally (return value is non-zero) or not
- * (return value is zero).  The returned value is treated as a guide
- * to how much request data should be buffered at a time.<br />
- * This method is called <em>before</em> any HTTP basic authentication
- * is done, and may (if threading is turned on) be called from a thread
- * other than the master one.<br />
- * If your delegate turns on incremental parsing for a request, then any
- * time that more incoming data is read, the web server class will look
- * at how much data it has and decide (based on the return value from this
- * method) to call your  -processRequest:response:for: method (preceded
- * by -preProcessRequest:response:for: if it is implemented) so that you 
- * can handle the new request data.<br />
- * Your code can check to see if the request is complete by using the
- * -isCompletedRequest: method, and can check for the latest data added
- * to the request body using the * -incrementalDataForRequest: method.
- */
-- (uint32_t) incrementalRequest: (WebServerRequest*)request
-                            for: (WebServer*)http;
-
-/**
- * If your delegate implements this method, it will be called by the
- * -completedWithResponse: method before the response data is actually
- * written to the client.<br />
- * This method may re-write the response, changing the result of the
- * earlier methods.<br />
- * You may use the [WebServer-userInfoForRequest:] method to obtain
- * any information passed from an earlier stage of processing.<br />
- * NB. if threading is turned on this method may be called from a thread
- * other than the master one.
- */
-- (void) postProcessRequest: (WebServerRequest*)request
-                  response: (WebServerResponse*)response
-                       for: (WebServer*)http;
-
-/**
- * If your delegate implements this method, it will be called before the
- * [(WebServerDelegate)-processRequest:response:for:] method and with the
- * same parameters.<br />
- * If this method returns YES, then it is assumed to have completed the
- * processing of the request and the main
- * [(WebServerDelegate)-processRequest:response:for:]
- * method is not called.  Otherwise processing continues as normal.<br />
- * You may use the [WebServer-setUserInfo:forRequest:] method to pass
- * information to the [(WebServerDelegate)-processRequest:response:for:]
- * and/or -postProcessRequest:response:for: methods.<br />
- * NB. This method is called <em>before</em> any HTTP basic authentication
- * is done, and may (if threading is turned on) be called from a thread
- * other than the master one.
- */
-- (BOOL) preProcessRequest: (WebServerRequest*)request
-                 response: (WebServerResponse*)response
-                      for: (WebServer*)http;
 
 @end
 


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to