[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] evbuffer_search_eol not finding CRLF?
- To: libevent-users@xxxxxxxx
- Subject: [Libevent-users] evbuffer_search_eol not finding CRLF?
- From: Jeffrey Walton <noloader@xxxxxxxxx>
- Date: Tue, 11 Mar 2014 17:56:18 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Tue, 11 Mar 2014 17:56:22 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; bh=Qvb6K2LPzl2TcI/ycXEl7uwoj6BiWtvfDUacqJ9PQIk=; b=gsdnd1iKyuqcNu869RBV7UnvQJ3mDJZcrWV4YYhtSromz7RR5WcgSqobqmd+BBD7uF hYTEhZNBUmM0hrCRQ2tX3DfQ9crPCxOLzaHvdgIraHBsone8zjoqkZxmAGRRS+GA82Wp ruA4v5ATGouh+xajrkpdj+iEEL4JlpKjoS7lf8jlEhK+6QDQ5yEQOVhh9SDoQNHMx1LP m3TFAR+Y/0Z3a0UjDteQrVV0Q6h3Ye/UoBvl2DUUGd2JV5Ld1dxhcpMgIkON6uEUv+OE Vud9wSBP+bH/RNR4okTY0SL+mFj/tuCCeNKG2yeif6inBVait/yi39ekaJyrizX4GfZC Cs+w==
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
I'm using the following to connect to my server:
$ printf "GET / HTTP/1.0 \r\n\r\n" | openssl s_client -connect localhost:8443
19 bytes are read in the callback, and that's the length of the string
in the printf above.
But the following is returning -1 for pos:
size_t len = 0;
evbuffer_ptr loc;
memset(&loc, 0x00, sizeof(loc));
evbuffer* c_buf = bufferevent_get_input(bev);
ASSERT(c_buf);
loc = evbuffer_search_eol(c_buf, &loc, &len, EVBUFFER_EOL_CRLF);
if (loc.pos == -1)
{
/* No CRLF found */
return 0;
}
Any ideas what I am doing wrong?
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.