Revision: 14624
Author: adrian.chadd
Date: Mon Apr 19 02:43:34 2010
Log: Issue #110 - Refactor out the client-facing TOS code in preparation for (later) adding some functionality to set the client-facing TOS based on an set of ACLs.


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

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

=======================================
--- /branches/LUSCA_HEAD/src/client_side.c      Mon Apr 19 02:27:56 2010
+++ /branches/LUSCA_HEAD/src/client_side.c      Mon Apr 19 02:43:34 2010
@@ -1409,36 +1409,10 @@
 static void clientCheckErrorMap(clientHttpRequest * http);
 static void clientCheckHeaderDone(clientHttpRequest * http);

-/*
- * accepts chunk of a http message in buf, parses prefix, filters headers and
- * such, writes processed message to the client's socket
- */
-void
-clientSendHeaders(void *data, HttpReply * rep)
-{
-    //const char *buf = ref.node->data + ref.offset;
-    clientHttpRequest *http = data;
-    StoreEntry *entry = http->entry;
-    ConnStateData *conn = http->conn;
+static void
+clientSetClientTOS(ConnStateData *conn, clientHttpRequest *http)
+{
     int fd = conn->fd;
-    assert(http->request != NULL);
-    dlinkDelete(&http->active, &ClientActiveRequests);
-    dlinkAdd(http, &http->active, &ClientActiveRequests);
-    debug(33, 5) ("clientSendHeaders: FD %d '%s'\n", fd, storeUrl(entry));
-    assert(conn->reqs.head != NULL);
-    if (DLINK_HEAD(conn->reqs) != http) {
-       /* there is another object in progress, defer this one */
-       debug(33, 2) ("clientSendHeaders: Deferring %s\n", storeUrl(entry));
-       return;
-    } else if (http->request->flags.reset_tcp) {
-       comm_reset_close(fd);
-       return;
-    } else if (!rep) {
-       /* call clientWriteComplete so the client socket gets closed */
-       clientWriteComplete(fd, NULL, 0, COMM_OK, http);
-       return;
-    }
-    assert(http->out.offset == 0);

     if (Config.zph_mode != ZPH_OFF) {
        int tos = 0;
@@ -1471,6 +1445,40 @@
            }
        }
     }
+}
+
+/*
+ * accepts chunk of a http message in buf, parses prefix, filters headers and
+ * such, writes processed message to the client's socket
+ */
+void
+clientSendHeaders(void *data, HttpReply * rep)
+{
+    //const char *buf = ref.node->data + ref.offset;
+    clientHttpRequest *http = data;
+    StoreEntry *entry = http->entry;
+    ConnStateData *conn = http->conn;
+    int fd = conn->fd;
+    assert(http->request != NULL);
+    dlinkDelete(&http->active, &ClientActiveRequests);
+    dlinkAdd(http, &http->active, &ClientActiveRequests);
+    debug(33, 5) ("clientSendHeaders: FD %d '%s'\n", fd, storeUrl(entry));
+    assert(conn->reqs.head != NULL);
+    if (DLINK_HEAD(conn->reqs) != http) {
+       /* there is another object in progress, defer this one */
+       debug(33, 2) ("clientSendHeaders: Deferring %s\n", storeUrl(entry));
+       return;
+    } else if (http->request->flags.reset_tcp) {
+       comm_reset_close(fd);
+       return;
+    } else if (!rep) {
+       /* call clientWriteComplete so the client socket gets closed */
+       clientWriteComplete(fd, NULL, 0, COMM_OK, http);
+       return;
+    }
+    assert(http->out.offset == 0);
+    clientSetClientTOS(conn, http);
+
     rep = http->reply = clientCloneReply(http, rep);
     if (!rep) {
ErrorState *err = errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY, http->orig_request);

--
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