Previously...
- I resolved some problems with lists and test data.
- I resolved some problems with dictionaries.
- I encountered some problems with states.
The output of the test_receive_read looks like this:
1> megaphone:test_receive_read().
will try to send packet to port 4567
megaphone is now listening on port 4567
megaphone now has a connection on port 4567, starting...
megaphone is now running
Sent test packet to 4567
{ok,{http_request,'POST',{abs_path,"/"},{1,1}}}
{ok,{http_header,24,'User-Agent',undefined,
"curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"}}
{ok,{http_header,14,'Host',undefined,"localhost:4567"}}
{ok,{http_header,8,'Accept',undefined,"*/*"}}
ok
2>
A bunch of gibberish I know, but the basics are that the first call to recv results in the line
{ok,{http_request,'POST',{abs_path,"/"},{1,1}}}
Which denotes that the connection received an HTTP POST. The next three lines contain some of the header lines from the POST.
{ok,{http_header,24,'User-Agent',undefined,
"curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"}}
{ok,{http_header,14,'Host',undefined,"localhost:4567"}}
{ok,{http_header,8,'Accept',undefined,"*/*"}}
A small victory I know, but I may as well savor it, since so much of what I do seems to be fixing problems in my stuff. It's nice when something works for a change.
Next time: start on send tests.
No comments:
Post a Comment