Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
offcntools
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李维杰
offcntools
Commits
1eb5bca0
Commit
1eb5bca0
authored
Oct 22, 2021
by
李维杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
93ab85c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
96 deletions
+97
-96
live_get_push_pull_address.cpp
live_get_push_pull_address/live_get_push_pull_address.cpp
+97
-96
No files found.
live_get_push_pull_address/live_get_push_pull_address.cpp
View file @
1eb5bca0
// live_get_push_pull_address.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
// live_get_push_pull_address.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
//
#include <iostream>
#include <iostream>
#include "../thirdparty/curl/http_request.h"
#include "../thirdparty/curl/http_request.h"
void
printf_help
()
{
void
printf_help
()
std
::
cout
<<
"Enter room's password:"
;
{
}
std
::
cout
<<
"Enter room's password:"
;
}
int
main
()
{
int
main
()
bool
ret
=
HttpRequest
::
Init
();
{
if
(
!
ret
)
bool
ret
=
HttpRequest
::
Init
();
{
if
(
!
ret
)
std
::
cout
<<
"Init http failed!"
<<
std
::
endl
;
{
return
-
1
;
std
::
cout
<<
"Init http failed!"
<<
std
::
endl
;
}
return
-
1
;
std
::
cout
<<
"webserver address:"
<<
HttpRequest
::
GetWebServerUrl
()
<<
std
::
endl
;
}
std
::
cout
<<
"webserver address:"
<<
HttpRequest
::
GetWebServerUrl
()
<<
std
::
endl
;
printf_help
();
printf_help
();
std
::
string
keyword
;
std
::
string
token
;
std
::
string
keyword
;
std
::
string
roomid
;
std
::
string
token
;
std
::
string
roomid
;
std
::
map
<
std
::
string
,
std
::
string
>
pull_urls
;
std
::
map
<
std
::
string
,
std
::
string
>
push_urls
;
std
::
map
<
std
::
string
,
std
::
string
>
pull_urls
;
std
::
map
<
std
::
string
,
std
::
string
>
push_urls
;
while
(
std
::
cin
>>
keyword
)
{
while
(
std
::
cin
>>
keyword
)
if
(
keyword
==
"q"
)
{
{
if
(
keyword
==
"q"
)
return
0
;
{
}
return
0
;
}
if
(
keyword
.
empty
())
{
if
(
keyword
.
empty
())
std
::
cout
<<
"password is empty ..."
<<
std
::
endl
;
{
continue
;
std
::
cout
<<
"password is empty ..."
<<
std
::
endl
;
}
continue
;
}
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
"<------------------------------------------------------------------------------------------------------------------------"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
"<------------------------------------------------------------------------------------------------------------------------"
<<
std
::
endl
;
if
(
!
HttpRequest
::
LogIn
(
"offcn-live"
,
keyword
,
token
,
roomid
))
{
if
(
!
HttpRequest
::
LogIn
(
"offcn-live"
,
keyword
,
token
,
roomid
))
std
::
cout
<<
"login webserver failed ..."
<<
std
::
endl
;
{
}
std
::
cout
<<
"login webserver failed ..."
<<
std
::
endl
;
else
}
{
else
std
::
cout
<<
"roomid:"
<<
roomid
<<
std
::
endl
;
{
std
::
cout
<<
"token:"
<<
token
<<
std
::
endl
;
std
::
cout
<<
"roomid:"
<<
roomid
<<
std
::
endl
;
std
::
cout
<<
"token:"
<<
token
<<
std
::
endl
;
if
(
!
HttpRequest
::
GetPushUrl
(
token
,
push_urls
))
{
if
(
!
HttpRequest
::
GetPushUrl
(
token
,
push_urls
))
std
::
cout
<<
"get push url failed ..."
<<
std
::
endl
;
{
}
std
::
cout
<<
"get push url failed ..."
<<
std
::
endl
;
else
}
{
else
std
::
cout
<<
std
::
endl
;
{
std
::
cout
<<
"push url:"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
"push url:"
<<
std
::
endl
;
std
::
map
<
std
::
string
,
std
::
string
>::
iterator
itor
;
for
(
itor
=
push_urls
.
begin
();
itor
!=
push_urls
.
end
();
itor
++
)
std
::
map
<
std
::
string
,
std
::
string
>::
iterator
itor
;
{
for
(
itor
=
push_urls
.
begin
();
itor
!=
push_urls
.
end
();
itor
++
)
std
::
cout
<<
itor
->
second
<<
std
::
endl
;
{
}
std
::
cout
<<
itor
->
second
<<
std
::
endl
;
}
}
}
if
(
!
HttpRequest
::
GetPullUrl
(
token
,
pull_urls
))
{
if
(
!
HttpRequest
::
GetPullUrl
(
token
,
pull_urls
))
std
::
cout
<<
"get pull url failed ..."
<<
std
::
endl
;
{
}
std
::
cout
<<
"get pull url failed ..."
<<
std
::
endl
;
else
}
{
else
std
::
cout
<<
std
::
endl
;
{
std
::
cout
<<
"pull url:"
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
"pull url:"
<<
std
::
endl
;
std
::
map
<
std
::
string
,
std
::
string
>::
iterator
itor
;
for
(
itor
=
pull_urls
.
begin
();
itor
!=
pull_urls
.
end
();
itor
++
)
std
::
map
<
std
::
string
,
std
::
string
>::
iterator
itor
;
{
for
(
itor
=
pull_urls
.
begin
();
itor
!=
pull_urls
.
end
();
itor
++
)
std
::
cout
<<
itor
->
first
<<
":"
<<
itor
->
second
<<
std
::
endl
;
{
}
std
::
cout
<<
itor
->
first
<<
":"
<<
itor
->
second
<<
std
::
endl
;
}
}
}
}
std
::
cout
<<
"------------------------------------------------------------------------------------------------------------------------>"
<<
std
::
endl
;
}
std
::
cout
<<
"------------------------------------------------------------------------------------------------------------------------>"
<<
std
::
endl
;
keyword
=
""
;
std
::
cout
<<
std
::
endl
<<
std
::
endl
;
keyword
=
""
;
printf_help
();
std
::
cout
<<
std
::
endl
<<
std
::
endl
;
}
printf_help
();
return
0
;
}
}
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment