version 2.35, 1999/02/07 18:24:19
|
version 2.36, 1999/02/22 22:10:11
|
Line 80 PRIVATE int HTGuess_flush (HTStream * me
|
Line 80 PRIVATE int HTGuess_flush (HTStream * me
|
** that we are investigating. |
** that we are investigating. |
*/ |
*/ |
if (me->cnt) { |
if (me->cnt) { |
if (STREAM_TRACE) |
HTTRACE(STREAM_TRACE, "GUESSING.... Result of content analysis: Text=%d%% Newlines=%d%% Ctrl=%d%% High=%d%%\n" _ |
HTTrace("GUESSING.... Result of content analysis: Text=%d%% Newlines=%d%% Ctrl=%d%% High=%d%%\n", |
(int)(100*me->text_cnt/me->cnt + 0.5) _ |
(int)(100*me->text_cnt/me->cnt + 0.5), |
(int)(100*me->lf_cnt /me->cnt + 0.5) _ |
(int)(100*me->lf_cnt /me->cnt + 0.5), |
(int)(100*me->ctrl_cnt/me->cnt + 0.5) _ |
(int)(100*me->ctrl_cnt/me->cnt + 0.5), |
|
(int)(100*me->high_cnt/me->cnt + 0.5)); |
(int)(100*me->high_cnt/me->cnt + 0.5)); |
} |
} |
|
|
Line 154 PRIVATE int HTGuess_flush (HTStream * me
|
Line 153 PRIVATE int HTGuess_flush (HTStream * me
|
if (HTResponse_format(response) == WWW_UNKNOWN) { |
if (HTResponse_format(response) == WWW_UNKNOWN) { |
HTParentAnchor * anchor = HTRequest_anchor(me->request); |
HTParentAnchor * anchor = HTRequest_anchor(me->request); |
char * addr = HTAnchor_physical(anchor); |
char * addr = HTAnchor_physical(anchor); |
if (STREAM_TRACE) HTTrace("GUESSING.... Hmm - trying local bindings\n"); |
HTTRACE(STREAM_TRACE, "GUESSING.... Hmm - trying local bindings\n"); |
HTBind_getResponseBindings (response, addr); |
HTBind_getResponseBindings (response, addr); |
} |
} |
|
|
Line 162 PRIVATE int HTGuess_flush (HTStream * me
|
Line 161 PRIVATE int HTGuess_flush (HTStream * me
|
** If nothing worked then give up and say binary... |
** If nothing worked then give up and say binary... |
*/ |
*/ |
if (HTResponse_format(response) == WWW_UNKNOWN) { |
if (HTResponse_format(response) == WWW_UNKNOWN) { |
if (STREAM_TRACE) HTTrace("GUESSING.... That's it - I'm giving up!\n"); |
HTTRACE(STREAM_TRACE, "GUESSING.... That's it - I'm giving up!\n"); |
HTResponse_setFormat(response, WWW_BINARY); |
HTResponse_setFormat(response, WWW_BINARY); |
} |
} |
|
|
if (STREAM_TRACE) { |
HTTRACE(STREAM_TRACE, "Guessed..... Content-Type `%s\'\n" _ HTAtom_name(HTResponse_format(response))); |
HTFormat format = HTResponse_format(response); |
|
HTTrace("Guessed..... Content-Type `%s\'\n", HTAtom_name(format)); |
|
} |
|
|
|
/* |
/* |
** Set up the new stream stack with the type we figured out |
** Set up the new stream stack with the type we figured out |
Line 177 PRIVATE int HTGuess_flush (HTStream * me
|
Line 173 PRIVATE int HTGuess_flush (HTStream * me
|
if ((me->target = HTStreamStack(HTResponse_format(response), |
if ((me->target = HTStreamStack(HTResponse_format(response), |
me->output_format, me->output_stream, |
me->output_format, me->output_stream, |
me->request, NO)) == NULL) { |
me->request, NO)) == NULL) { |
if (STREAM_TRACE) HTTrace("HTGuess..... Can't convert media type\n"); |
HTTRACE(STREAM_TRACE, "HTGuess..... Can't convert media type\n"); |
me->target = HTErrorStream(); |
me->target = HTErrorStream(); |
} |
} |
me->transparent = YES; |
me->transparent = YES; |