You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wi...@apache.org on 2020/01/13 19:42:24 UTC
[couchdb-mochiweb] 25/37: Remove compile(tuple_calls) from
examples/keepalive
This is an automated email from the ASF dual-hosted git repository.
willholley pushed a commit to branch upstream
in repository https://gitbox.apache.org/repos/asf/couchdb-mochiweb.git
commit f3a5b37e956dc22bd48112fa4b6761275e46d1fa
Author: Bob Ippolito <bo...@redivi.com>
AuthorDate: Mon Mar 11 22:57:58 2019 +0000
Remove compile(tuple_calls) from examples/keepalive
---
examples/keepalive/keepalive.erl | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/examples/keepalive/keepalive.erl b/examples/keepalive/keepalive.erl
index a371e91..51a7c3a 100644
--- a/examples/keepalive/keepalive.erl
+++ b/examples/keepalive/keepalive.erl
@@ -1,7 +1,5 @@
-module(keepalive).
--compile(tuple_calls).
-
%% your web app can push data to clients using a technique called comet long
%% polling. browsers make a request and your server waits to send a
%% response until data is available. see wikipedia for a better explanation:
@@ -33,7 +31,7 @@ start(Options = [{port, _Port}]) ->
mochiweb_http:start([{name, ?MODULE}, {loop, ?LOOP} | Options]).
loop(Req) ->
- Path = Req:get(path),
+ Path = mochiweb_request:get(path, Req),
case string:tokens(Path, "/") of
["longpoll" | RestOfPath] ->
%% the "reentry" is a continuation -- what @mochiweb_http@
@@ -74,10 +72,10 @@ resume(Req, RestOfPath, Reentry) ->
%% if we didn't call @Reentry@ here then the function would finish and the
%% process would exit. calling @Reentry@ takes care of returning control
%% to @mochiweb_http@
- io:format("reentering loop via continuation in ~p~n", [Req:get(path)]),
+ io:format("reentering loop via continuation in ~p~n", [mochiweb_request:get(path, Req)]),
Reentry(Req).
ok(Req, Response) ->
- Req:ok({_ContentType = "text/plain",
- _Headers = [],
- Response}).
+ mochiweb_request:ok(
+ {_ContentType = "text/plain", _Headers = [], Response},
+ Req).