Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vinoski committed Feb 10, 2012
1 parent ac369a3 commit 0944464
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
12 changes: 7 additions & 5 deletions doc/yaws.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1610,11 +1610,13 @@ \section{All out/1 return values}
data in one go. (Typically if a file is very large or if data
arrives from back end servers on the network.)

\item \verb+{streamcontent_with_timeout, MimeType, FirstChunk, Timeout}+ Similar
to above, but with an explicit timeout. The deafult timeout is 30 secs. I.e if
the application fails to deliver data to the Yaws process, the streaming will
stop. This is often not the desired behaviour in Comet/Ajax applications. It's
possible to provide 'infinity' as timeout.
\item
\verb+{streamcontent_with_timeout, MimeType, FirstChunk, Timeout}+
Similar to above, but with an explicit timeout. The default timeout
is 30 secs, i.e. if the application fails to deliver data to the
\Yaws\ process, the streaming will stop. This is often not the
desired behaviour in Comet/Ajax applications. It's possible to
provide 'infinity' as timeout.

\item \verb+{streamcontent_from_pid, MimeType, Pid}+ This return value
is similar to the \verb+streamcontent+ return value above. However
Expand Down
14 changes: 7 additions & 7 deletions src/yaws_websockets.erl
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ check_reserved_bits(#ws_frame_info{rsv=RSV}) ->

%% http://www.erlang.org/doc/apps/stdlib/unicode_usage.html#id191467
%% Heuristic identification of UTF-8
check_utf8(Unframed = #ws_frame_info{opcode = text, data=Bin})
check_utf8(Unframed = #ws_frame_info{opcode=text, data=Bin})
when is_binary(Bin) ->
case unicode:characters_to_binary(Bin,utf8,utf8) of
Bin ->
Expand All @@ -341,12 +341,12 @@ ws_frame_info(#ws_state{sock=Socket},
{ws_frame_info_secondary, Length, MaskingKey, Payload, Excess}
= ws_frame_info_secondary(Socket, Len1, Rest),
FrameInfo = #ws_frame_info{fin=Fin,
rsv=Rsv,
opcode=opcode_to_atom(Opcode),
masked=Masked,
masking_key=MaskingKey,
length=Length,
payload=Payload},
rsv=Rsv,
opcode=opcode_to_atom(Opcode),
masked=Masked,
masking_key=MaskingKey,
length=Length,
payload=Payload},
{FrameInfo, Excess};
Other ->
Other
Expand Down

0 comments on commit 0944464

Please sign in to comment.