Permalink
Browse files

regexp is gone

  • Loading branch information...
1 parent 6322dc6 commit 600f80e7b9a881e3a205180a2f4fdf42f710b7ea @nniclausse nniclausse committed Sep 7, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/tsung/ts_jabber.erl
View
@@ -163,13 +163,12 @@ parse(Data, State=#state_rcv{datasize=Size}) ->
%%----------------------------------------------------------------------
parse_bidi(Data, State) ->
RcvdXml = binary_to_list(Data),
- ?LOGF("RECEIVED : ~p~n",[RcvdXml],?DEB),
BidiElements =
[{"<presence[^>]*subscribe[\"\']", presence_bidi},
{"<proceed", starttls_bidi}],
lists:foldl(fun({Regex, Handler}, Acc)->
case re:run(RcvdXml,Regex) of
- {match,_,_} ->
+ {match,_} ->
?LOGF("RECEIVED : ~p~n",[RcvdXml],?DEB),
?MODULE:Handler(RcvdXml, State);
_Else ->
@@ -178,7 +177,7 @@ parse_bidi(Data, State) ->
end, {nodata, State}, BidiElements).
presence_bidi(RcvdXml, State)->
- {match,SubMatches} = regexp:matches(RcvdXml,"<presence[^>]*subscribe[\"\'][^>]*>"),
+ {match,SubMatches} = re:run(RcvdXml,"<presence[^>]*subscribe[\"\'][^>]*>",[global]),
bidi_resp(subscribed,RcvdXml,SubMatches,State).
starttls_bidi(_RcvdXml, #state_rcv{socket= Socket}=State)->

0 comments on commit 600f80e

Please sign in to comment.