Revision: 14458
Author: adrian.chadd
Date: Tue Mar 16 08:34:56 2010
Log: Refactor part of parseHttpRequest().


http://code.google.com/p/lusca-cache/source/detail?r=14458

Modified:
 /branches/LUSCA_HEAD/src/client_side.c

=======================================
--- /branches/LUSCA_HEAD/src/client_side.c      Sun Mar 14 08:10:48 2010
+++ /branches/LUSCA_HEAD/src/client_side.c      Tue Mar 16 08:34:56 2010
@@ -2457,6 +2457,20 @@
         *method_p = urlMethodGetKnownByCode(METHOD_NONE);
     return http;
 }
+
+static int
+parseHttpConnectRequest(ConnStateData *conn, clientHttpRequest *http)
+{
+       if (http->http_ver.major < 1) {
+           debug(33, 1) ("parseHttpRequest: Invalid HTTP version\n");
+           return 0;
+       }
+       if (conn->port->accel) {
+ debug(33, 1) ("parseHttpRequest: CONNECT not valid in accelerator mode\n");
+           return 0;
+       }
+       return 1;
+}

 /*
  *  parseHttpRequest()
@@ -2566,14 +2580,8 @@

     /* handle "accelerated" objects (and internal) */
     if (method->code == METHOD_CONNECT) {
-       if (http_ver.major < 1) {
-           debug(33, 1) ("parseHttpRequest: Invalid HTTP version\n");
-           goto invalid_request;
-       }
-       if (conn->port->accel) {
- debug(33, 1) ("parseHttpRequest: CONNECT not valid in accelerator mode\n");
-           goto invalid_request;
-       }
+        if (! parseHttpConnectRequest(conn, http))
+               goto invalid_request;
} else if (*url == '/' && Config.onoff.global_internal_static && internalCheck(url)) {
       internal:
        /* prepend our name & port */

--
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en.

Reply via email to