aboutsummaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorAlexey Shchepin <alexey@process-one.net>2004-04-17 19:00:10 +0000
committerAlexey Shchepin <alexey@process-one.net>2004-04-17 19:00:10 +0000
commit0ab31f08229106730d5f33298ae1b75a3df29968 (patch)
treed00997fee38205947bfd67fc49c3e48137c5ec53 /src/web
parent* src/ejabberd.erl: Added searching of files in code:priv_lib (diff)
* src/web/ejabberd_http.erl: Increased receive buffer
* src/mod_irc/mod_irc_connection.erl: Support for "/quote" command SVN Revision: 224
Diffstat (limited to 'src/web')
-rw-r--r--src/web/ejabberd_http.erl4
-rw-r--r--src/web/ejabberd_http_poll.erl28
2 files changed, 17 insertions, 15 deletions
diff --git a/src/web/ejabberd_http.erl b/src/web/ejabberd_http.erl
index c5988d342..7569e11a9 100644
--- a/src/web/ejabberd_http.erl
+++ b/src/web/ejabberd_http.erl
@@ -40,9 +40,9 @@ start_link({SockMod, Socket}, Opts) ->
?INFO_MSG("started: ~p", [{SockMod, Socket}]),
case SockMod of
gen_tcp ->
- inet:setopts(Socket, [{packet, http}]);
+ inet:setopts(Socket, [{packet, http}, {recbuf, 8192}]);
ssl ->
- ssl:setopts(Socket, [{packet, http}])
+ ssl:setopts(Socket, [{packet, http}, {recbuf, 8192}])
end,
{ok, proc_lib:spawn_link(ejabberd_http,
receive_headers,
diff --git a/src/web/ejabberd_http_poll.erl b/src/web/ejabberd_http_poll.erl
index f53dba5bd..4366d89d7 100644
--- a/src/web/ejabberd_http_poll.erl
+++ b/src/web/ejabberd_http_poll.erl
@@ -77,19 +77,19 @@ process_request(#request{path = [],
data = Data} = Request) ->
case catch parse_request(Data) of
{ok, ID1, Key, NewKey, Packet} ->
- ID = case ID1 of
- "0" ->
- NewID = sha:sha(term_to_binary({now(), make_ref()})),
- {ok, Pid} = start(NewID, ""),
- mnesia:transaction(
- fun() ->
- mnesia:write(#http_poll{id = NewID,
- pid = Pid})
- end),
- NewID;
- _ ->
- ID1
- end,
+ ID = if
+ (ID1 == "0") or (ID1 == "mobile") ->
+ NewID = sha:sha(term_to_binary({now(), make_ref()})),
+ {ok, Pid} = start(NewID, ""),
+ mnesia:transaction(
+ fun() ->
+ mnesia:write(#http_poll{id = NewID,
+ pid = Pid})
+ end),
+ NewID;
+ true ->
+ ID1
+ end,
case http_put(ID, Key, NewKey, Packet) of
{error, not_exists} ->
{200, ?BAD_REQUEST, ""};
@@ -106,6 +106,8 @@ process_request(#request{path = [],
if
ID == ID1 ->
{200, [?CT], OutPacket};
+ ID1 == "mobile" ->
+ {200, [?CT], [ID, $\n, OutPacket]};
true ->
Cookie = "ID=" ++ ID ++ "; expires=-1",
{200, [?CT, {"Set-Cookie", Cookie}],