request_rec *r;
wctx_t *wctx;
hc_condition_t *cond;
- const char *method;
+ const char *method = NULL;
hc = hc_get_hcworker(ctx, worker, ptemp);
wctx = (wctx_t *)hc->context;
break;
case HEAD:
- if (!wctx->req) {
- wctx->req = apr_psprintf(ctx->p,
- "HEAD %s%s%s HTTP/1.0\r\nHost: %s:%d\r\n\r\n",
- (wctx->path ? wctx->path : ""),
- (wctx->path && *hc->s->hcuri ? "/" : "" ),
- (*hc->s->hcuri ? hc->s->hcuri : ""),
- hc->s->hostname, (int)hc->s->port);
- }
method = "HEAD";
- break;
-
+ /* fallthru */
case GET:
+ if (!method) { /* did we fall thru? If not, we are GET */
+ method = "GET";
+ }
if (!wctx->req) {
wctx->req = apr_psprintf(ctx->p,
- "GET %s%s%s HTTP/1.0\r\nHost: %s:%d\r\n\r\n",
+ "%s %s%s%s HTTP/1.0\r\nHost: %s:%d\r\n\r\n",
+ method,
(wctx->path ? wctx->path : ""),
(wctx->path && *hc->s->hcuri ? "/" : "" ),
(*hc->s->hcuri ? hc->s->hcuri : ""),
hc->s->hostname, (int)hc->s->port);
}
- method = "GET";
break;
default:
baton->worker = worker;
baton->ptemp = ptemp;
- if (ctx->hctp) {
+ if (!ctx->hctp) {
+ hc_check(NULL, baton);
+ }
#if HC_USE_THREADS
+ else {
rv = apr_thread_pool_push(ctx->hctp, hc_check, (void *)baton,
APR_THREAD_TASK_PRIORITY_NORMAL, NULL);
-#endif
- ;
- } else {
- hc_check(NULL, baton);
}
+#endif
}
workers++;
}