Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
eb6fa2f1
Commit
eb6fa2f1
authored
Nov 29, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move vfp from worker to busyobj
parent
58dc8e53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
22 deletions
+29
-22
cache.h
bin/varnishd/cache/cache.h
+12
-2
cache_center.c
bin/varnishd/cache/cache_center.c
+6
-9
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+11
-11
No files found.
bin/varnishd/cache/cache.h
View file @
eb6fa2f1
...
...
@@ -334,7 +334,6 @@ struct worker {
struct
vbc
*
vbc
;
struct
object
*
fetch_obj
;
enum
body_status
body_status
;
struct
vfp
*
vfp
;
struct
vgz
*
vgz_rx
;
struct
vef_priv
*
vef_priv
;
unsigned
fetch_failed
;
...
...
@@ -485,7 +484,16 @@ oc_getlru(const struct objcore *oc)
return
(
oc
->
methods
->
getlru
(
oc
));
}
/* Busy Object structure ---------------------------------------------*/
/* Busy Object structure ---------------------------------------------
*
* The busyobj structure captures the aspects of an object related to,
* and while it is being fetched from the backend.
*
* One of these aspects will be how much has been fetched, which
* streaming delivery will make use of.
*
* XXX: many fields from worker needs to move here.
*/
struct
busyobj
{
unsigned
magic
;
...
...
@@ -493,6 +501,8 @@ struct busyobj {
uint8_t
*
vary
;
unsigned
is_gzip
;
unsigned
is_gunzip
;
struct
vfp
*
vfp
;
};
/* Object structure --------------------------------------------------*/
...
...
bin/varnishd/cache/cache_center.c
View file @
eb6fa2f1
...
...
@@ -706,7 +706,6 @@ cnt_fetchbody(struct sess *sp)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
wrk
=
sp
->
wrk
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
->
busyobj
,
BUSYOBJ_MAGIC
);
assert
(
sp
->
handling
==
VCL_RET_HIT_FOR_PASS
||
...
...
@@ -739,8 +738,6 @@ cnt_fetchbody(struct sess *sp)
*
*/
AZ
(
wrk
->
vfp
);
/* We do nothing unless the param is set */
if
(
!
cache_param
->
http_gzip_support
)
wrk
->
do_gzip
=
wrk
->
do_gunzip
=
0
;
...
...
@@ -776,13 +773,13 @@ cnt_fetchbody(struct sess *sp)
/* ESI takes precedence and handles gzip/gunzip itself */
if
(
wrk
->
do_esi
)
wrk
->
vfp
=
&
vfp_esi
;
wrk
->
busyobj
->
vfp
=
&
vfp_esi
;
else
if
(
wrk
->
do_gunzip
)
wrk
->
vfp
=
&
vfp_gunzip
;
wrk
->
busyobj
->
vfp
=
&
vfp_gunzip
;
else
if
(
wrk
->
do_gzip
)
wrk
->
vfp
=
&
vfp_gzip
;
wrk
->
busyobj
->
vfp
=
&
vfp_gzip
;
else
if
(
wrk
->
busyobj
->
is_gzip
)
wrk
->
vfp
=
&
vfp_testgzip
;
wrk
->
busyobj
->
vfp
=
&
vfp_testgzip
;
if
(
wrk
->
do_esi
||
sp
->
esi_level
>
0
)
wrk
->
do_stream
=
0
;
...
...
@@ -890,7 +887,7 @@ cnt_fetchbody(struct sess *sp)
http_Setup
(
wrk
->
bereq
,
NULL
);
http_Setup
(
wrk
->
beresp
,
NULL
);
wrk
->
vfp
=
NULL
;
wrk
->
busyobj
->
vfp
=
NULL
;
assert
(
WRW_IsReleased
(
wrk
));
AZ
(
wrk
->
vbc
);
AN
(
sp
->
director
);
...
...
@@ -960,7 +957,7 @@ cnt_streambody(struct sess *sp)
http_Setup
(
wrk
->
bereq
,
NULL
);
http_Setup
(
wrk
->
beresp
,
NULL
);
wrk
->
vfp
=
NULL
;
wrk
->
busyobj
->
vfp
=
NULL
;
AZ
(
wrk
->
vbc
);
AN
(
sp
->
director
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
eb6fa2f1
...
...
@@ -236,7 +236,7 @@ fetch_straight(struct worker *w, struct http_conn *htc, ssize_t cl)
}
else
if
(
cl
==
0
)
return
(
0
);
i
=
w
->
vfp
->
bytes
(
w
,
htc
,
cl
);
i
=
w
->
busyobj
->
vfp
->
bytes
(
w
,
htc
,
cl
);
if
(
i
<=
0
)
return
(
FetchError
(
w
,
"straight insufficient bytes"
));
return
(
0
);
...
...
@@ -293,7 +293,7 @@ fetch_chunked(struct worker *w, struct http_conn *htc)
if
(
cl
<
0
)
return
(
FetchError
(
w
,
"chunked header number syntax"
));
if
(
cl
>
0
&&
w
->
vfp
->
bytes
(
w
,
htc
,
cl
)
<=
0
)
if
(
cl
>
0
&&
w
->
busyobj
->
vfp
->
bytes
(
w
,
htc
,
cl
)
<=
0
)
return
(
-
1
);
i
=
HTC_Read
(
w
,
htc
,
buf
,
1
);
...
...
@@ -315,7 +315,7 @@ fetch_eof(struct worker *w, struct http_conn *htc)
int
i
;
assert
(
w
->
body_status
==
BS_EOF
);
i
=
w
->
vfp
->
bytes
(
w
,
htc
,
SSIZE_MAX
);
i
=
w
->
busyobj
->
vfp
->
bytes
(
w
,
htc
,
SSIZE_MAX
);
if
(
i
<
0
)
return
(
-
1
);
return
(
0
);
...
...
@@ -494,8 +494,8 @@ FetchBody(struct worker *w, struct object *obj)
CHECK_OBJ_NOTNULL
(
obj
,
OBJECT_MAGIC
);
CHECK_OBJ_NOTNULL
(
obj
->
http
,
HTTP_MAGIC
);
if
(
w
->
vfp
==
NULL
)
w
->
vfp
=
&
vfp_nop
;
if
(
w
->
busyobj
->
vfp
==
NULL
)
w
->
busyobj
->
vfp
=
&
vfp_nop
;
AssertObjCorePassOrBusy
(
obj
->
objcore
);
...
...
@@ -518,24 +518,24 @@ FetchBody(struct worker *w, struct object *obj)
break
;
case
BS_LENGTH
:
cl
=
fetch_number
(
w
->
h_content_length
,
10
);
w
->
vfp
->
begin
(
w
,
cl
>
0
?
cl
:
0
);
w
->
busyobj
->
vfp
->
begin
(
w
,
cl
>
0
?
cl
:
0
);
cls
=
fetch_straight
(
w
,
w
->
htc
,
cl
);
mklen
=
1
;
if
(
w
->
vfp
->
end
(
w
))
if
(
w
->
busyobj
->
vfp
->
end
(
w
))
cls
=
-
1
;
break
;
case
BS_CHUNKED
:
w
->
vfp
->
begin
(
w
,
cl
);
w
->
busyobj
->
vfp
->
begin
(
w
,
cl
);
cls
=
fetch_chunked
(
w
,
w
->
htc
);
mklen
=
1
;
if
(
w
->
vfp
->
end
(
w
))
if
(
w
->
busyobj
->
vfp
->
end
(
w
))
cls
=
-
1
;
break
;
case
BS_EOF
:
w
->
vfp
->
begin
(
w
,
cl
);
w
->
busyobj
->
vfp
->
begin
(
w
,
cl
);
cls
=
fetch_eof
(
w
,
w
->
htc
);
mklen
=
1
;
if
(
w
->
vfp
->
end
(
w
))
if
(
w
->
busyobj
->
vfp
->
end
(
w
))
cls
=
-
1
;
break
;
case
BS_ERROR
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment