[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] netconn_recv issue
From: |
am85 |
Subject: |
Re: [lwip-users] netconn_recv issue |
Date: |
Thu, 26 Aug 2010 01:29:30 -0700 (PDT) |
Hi Kieran,
Thank you very much.
I'm trying to implement this code, but I have the same problem.
do
{
netbuf_data(Buffer, (void *) &dataptr, &len);
data = dataptr;
if( strncmp(data, "GET / ", 4 ) == 0 )
{
/* Send home page: text only */
netconn_write( RxConn, (char *)(file.data), file.len, NETCONN_COPY
);
}
else if( strncmp(data, "GET /image1.gif", 15 ) == 0 )
{
/* Send first picture */
netconn_write( RxConn, (char *)(file.data), file.len, NETCONN_COPY
);
}
else if( strncmp(data, "GET /image2.gif", 15 ) == 0 )
{
/* Send second picture */
netconn_write( RxConn, (char *)(file.data), file.len, NETCONN_COPY
);
}
} while(netbuf_next(Buffer) == -1);
Thanks to the previous answers.
With regards,
am85
Kieran Mansley wrote:
>
>
> On 25 Aug 2010, at 09:27, am85 wrote:
>>
>>
>> The problem is, I receive three requests only the last GET command. The
>> succeeding GET requests ("GET / " and "GET /image1.gif",) are all
>> failing.
>> Any idea on this one?
>
> Try putting the code that does netbuf_data() inside a loop that checks
> netbuf_next() (and processes that one too if it's there). It's likely
> that all three of the requests are there but they've been delivered to the
> application together.
>
> Kieran
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
--
View this message in context:
http://old.nabble.com/netconn_recv-issue-tp29529860p29540011.html
Sent from the lwip-users mailing list archive at Nabble.com.
- [lwip-users] netconn_recv issue, am85, 2010/08/25
- Re: [lwip-users] netconn_recv issue, David Empson, 2010/08/26
- Re: [lwip-users] netconn_recv issue, am85, 2010/08/27
- [lwip-users] Ethernet driver for OS, Timmy Brolin, 2010/08/30
- Re: [lwip-users] Ethernet driver for OS, Jeff Barber, 2010/08/31