lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Benjamin:

On Mon, Oct 7, 2013 at 2:49 PM, Benjamin Kober <kober@optisense.com> wrote:
> my problem is not parsing the http response but that I get only the
> first line of it. Till now I didn't found out how to read out more than
> one line from the socket. It seems as if the library cuts everything
> after the first newline sign.

Don't consider this an insult, but experience says I need to ask it. ¿
Are you calling receive more than one time, i.e., in a loop or just
once ?

Because I think receive with the default pattern reads a single line,
so the way to "read out more than one line" is to "call receive more
than one time".


>> I think this library has HTTP modules. Use one of them.
> These modules where designed to write a client and not a server.

Also, reading an HTTP response from a client is very similar to
reading a request from a server, and writing the request is similar to
writing the response,  so you could get inspiration from the client
module.

F.O.S.